| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | QPrintDevice::QPrintDevice() | - |
| 8 | : d(new QPlatformPrintDevice()) | - |
| 9 | { | - |
| 10 | } | - |
| 11 | | - |
| 12 | QPrintDevice::QPrintDevice(const QString &id) | - |
| 13 | : d(new QPlatformPrintDevice(id)) | - |
| 14 | { | - |
| 15 | } | - |
| 16 | | - |
| 17 | QPrintDevice::QPrintDevice(QPlatformPrintDevice *dd) | - |
| 18 | : d(dd) | - |
| 19 | { | - |
| 20 | } | - |
| 21 | | - |
| 22 | QPrintDevice::QPrintDevice(const QPrintDevice &other) | - |
| 23 | : d(other.d) | - |
| 24 | { | - |
| 25 | } | - |
| 26 | | - |
| 27 | QPrintDevice::~QPrintDevice() | - |
| 28 | { | - |
| 29 | } | - |
| 30 | | - |
| 31 | QPrintDevice &QPrintDevice::operator=(const QPrintDevice &other) | - |
| 32 | { | - |
| 33 | d = other.d; | - |
| 34 | return *this; | - |
| 35 | } | - |
| 36 | | - |
| 37 | bool QPrintDevice::operator==(const QPrintDevice &other) const | - |
| 38 | { | - |
| 39 | if (d && other.d) | - |
| 40 | return d->id() == other.d->id(); | - |
| 41 | return d == other.d; | - |
| 42 | } | - |
| 43 | | - |
| 44 | QString QPrintDevice::id() const | - |
| 45 | { | - |
| 46 | return isValid() ? d->id() : QString(); | - |
| 47 | } | - |
| 48 | | - |
| 49 | QString QPrintDevice::name() const | - |
| 50 | { | - |
| 51 | return isValid() ? d->name() : QString(); | - |
| 52 | } | - |
| 53 | | - |
| 54 | QString QPrintDevice::location() const | - |
| 55 | { | - |
| 56 | return isValid() ? d->location() : QString(); | - |
| 57 | } | - |
| 58 | | - |
| 59 | QString QPrintDevice::makeAndModel() const | - |
| 60 | { | - |
| 61 | return isValid() ? d->makeAndModel() : QString(); | - |
| 62 | } | - |
| 63 | | - |
| 64 | bool QPrintDevice::isValid() const | - |
| 65 | { | - |
| 66 | return d && d->isValid(); | - |
| 67 | } | - |
| 68 | | - |
| 69 | bool QPrintDevice::isDefault() const | - |
| 70 | { | - |
| 71 | return isValid() && d->isDefault(); | - |
| 72 | } | - |
| 73 | | - |
| 74 | bool QPrintDevice::isRemote() const | - |
| 75 | { | - |
| 76 | return isValid() && d->isRemote(); | - |
| 77 | } | - |
| 78 | | - |
| 79 | QPrint::DeviceState QPrintDevice::state() const | - |
| 80 | { | - |
| 81 | return isValid() ? d->state() : QPrint::Error; | - |
| 82 | } | - |
| 83 | | - |
| 84 | bool QPrintDevice::isValidPageLayout(const QPageLayout &layout, int resolution) const | - |
| 85 | { | - |
| 86 | return isValid() && d->isValidPageLayout(layout, resolution); | - |
| 87 | } | - |
| 88 | | - |
| 89 | bool QPrintDevice::supportsMultipleCopies() const | - |
| 90 | { | - |
| 91 | return isValid() && d->supportsMultipleCopies(); | - |
| 92 | } | - |
| 93 | | - |
| 94 | bool QPrintDevice::supportsCollateCopies() const | - |
| 95 | { | - |
| 96 | return isValid() && d->supportsCollateCopies(); | - |
| 97 | } | - |
| 98 | | - |
| 99 | QPageSize QPrintDevice::defaultPageSize() const | - |
| 100 | { | - |
| 101 | return isValid() ? d->defaultPageSize() : QPageSize(); | - |
| 102 | } | - |
| 103 | | - |
| 104 | QList<QPageSize> QPrintDevice::supportedPageSizes() const | - |
| 105 | { | - |
| 106 | return isValid() ? d->supportedPageSizes() : QList<QPageSize>(); | - |
| 107 | } | - |
| 108 | | - |
| 109 | QPageSize QPrintDevice::supportedPageSize(const QPageSize &pageSize) const | - |
| 110 | { | - |
| 111 | return isValid() ? d->supportedPageSize(pageSize) : QPageSize(); | - |
| 112 | } | - |
| 113 | | - |
| 114 | QPageSize QPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSizeId) const | - |
| 115 | { | - |
| 116 | return isValid() ? d->supportedPageSize(pageSizeId) : QPageSize(); | - |
| 117 | } | - |
| 118 | | - |
| 119 | QPageSize QPrintDevice::supportedPageSize(const QString &pageName) const | - |
| 120 | { | - |
| 121 | return isValid() ? d->supportedPageSize(pageName) : QPageSize(); | - |
| 122 | } | - |
| 123 | | - |
| 124 | QPageSize QPrintDevice::supportedPageSize(const QSize &pointSize) const | - |
| 125 | { | - |
| 126 | return isValid() ? d->supportedPageSize(pointSize) : QPageSize(); | - |
| 127 | } | - |
| 128 | | - |
| 129 | QPageSize QPrintDevice::supportedPageSize(const QSizeF &size, QPageSize::Unit units) const | - |
| 130 | { | - |
| 131 | return isValid() ? d->supportedPageSize(size, units) : QPageSize(); | - |
| 132 | } | - |
| 133 | | - |
| 134 | bool QPrintDevice::supportsCustomPageSizes() const | - |
| 135 | { | - |
| 136 | return isValid() && d->supportsCustomPageSizes(); | - |
| 137 | } | - |
| 138 | | - |
| 139 | QSize QPrintDevice::minimumPhysicalPageSize() const | - |
| 140 | { | - |
| 141 | return isValid() ? d->minimumPhysicalPageSize() : QSize(); | - |
| 142 | } | - |
| 143 | | - |
| 144 | QSize QPrintDevice::maximumPhysicalPageSize() const | - |
| 145 | { | - |
| 146 | return isValid() ? d->maximumPhysicalPageSize() : QSize(); | - |
| 147 | } | - |
| 148 | | - |
| 149 | QMarginsF QPrintDevice::printableMargins(const QPageSize &pageSize, | - |
| 150 | QPageLayout::Orientation orientation, | - |
| 151 | int resolution) const | - |
| 152 | { | - |
| 153 | return isValid() ? d->printableMargins(pageSize, orientation, resolution) : QMarginsF(); | - |
| 154 | } | - |
| 155 | | - |
| 156 | int QPrintDevice::defaultResolution() const | - |
| 157 | { | - |
| 158 | return isValid() ? d->defaultResolution() : 0; | - |
| 159 | } | - |
| 160 | | - |
| 161 | QList<int> QPrintDevice::supportedResolutions() const | - |
| 162 | { | - |
| 163 | return isValid() ? d->supportedResolutions() : QList<int>(); | - |
| 164 | } | - |
| 165 | | - |
| 166 | QPrint::InputSlot QPrintDevice::defaultInputSlot() const | - |
| 167 | { | - |
| 168 | return isValid() ? d->defaultInputSlot() : QPrint::InputSlot(); | - |
| 169 | } | - |
| 170 | | - |
| 171 | QList<QPrint::InputSlot> QPrintDevice::supportedInputSlots() const | - |
| 172 | { | - |
| 173 | return isValid() ? d->supportedInputSlots() : QList<QPrint::InputSlot>(); | - |
| 174 | } | - |
| 175 | | - |
| 176 | QPrint::OutputBin QPrintDevice::defaultOutputBin() const | - |
| 177 | { | - |
| 178 | return isValid() ? d->defaultOutputBin() : QPrint::OutputBin(); | - |
| 179 | } | - |
| 180 | | - |
| 181 | QList<QPrint::OutputBin> QPrintDevice::supportedOutputBins() const | - |
| 182 | { | - |
| 183 | return isValid() ? d->supportedOutputBins() : QList<QPrint::OutputBin>(); | - |
| 184 | } | - |
| 185 | | - |
| 186 | QPrint::DuplexMode QPrintDevice::defaultDuplexMode() const | - |
| 187 | { | - |
| 188 | return isValid() ? d->defaultDuplexMode() : QPrint::DuplexNone; | - |
| 189 | } | - |
| 190 | | - |
| 191 | QList<QPrint::DuplexMode> QPrintDevice::supportedDuplexModes() const | - |
| 192 | { | - |
| 193 | return isValid() ? d->supportedDuplexModes() : QList<QPrint::DuplexMode>(); | - |
| 194 | } | - |
| 195 | | - |
| 196 | QPrint::ColorMode QPrintDevice::defaultColorMode() const | - |
| 197 | { | - |
| 198 | return isValid() ? d->defaultColorMode() : QPrint::GrayScale; | - |
| 199 | } | - |
| 200 | | - |
| 201 | QList<QPrint::ColorMode> QPrintDevice::supportedColorModes() const | - |
| 202 | { | - |
| 203 | return isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>(); | - |
| 204 | } | - |
| 205 | | - |
| 206 | | - |
| 207 | QList<QMimeType> QPrintDevice::supportedMimeTypes() const | - |
| 208 | { | - |
| 209 | return isValid() ? d->supportedMimeTypes() : QList<QMimeType>(); | - |
| 210 | } | - |
| 211 | | - |
| 212 | | - |
| 213 | | - |
| 214 | void QPrintDevice::format(QDebug debug) const | - |
| 215 | { | - |
| 216 | QDebugStateSaver saver(debug); | - |
| 217 | debug.noquote(); | - |
| 218 | debug.nospace(); | - |
| 219 | if (isValid()| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 220 | const QString deviceId = id(); | - |
| 221 | const QString deviceName = name(); | - |
| 222 | debug << "id=\"" << deviceId << "\", state=" << state(); | - |
| 223 | if (!deviceName.isEmpty()| TRUE | never evaluated | | FALSE | never evaluated |
&& deviceName != deviceId| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 224 | debug << ", name=\"" << deviceName << '"'; never executed: debug << ", name=\"" << deviceName << '"'; | 0 |
| 225 | if (!location().isEmpty()| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 226 | debug << ", location=\"" << location() << '"'; never executed: debug << ", location=\"" << location() << '"'; | 0 |
| 227 | debug << ", makeAndModel=\"" << makeAndModel() << '"'; | - |
| 228 | if (isDefault()| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 229 | debug << ", default"; never executed: debug << ", default"; | 0 |
| 230 | if (isRemote()| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 231 | debug << ", remote"; never executed: debug << ", remote"; | 0 |
| 232 | debug << ", defaultPageSize=" << defaultPageSize(); | - |
| 233 | if (supportsCustomPageSizes()| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 234 | debug << ", supportsCustomPageSizes"; never executed: debug << ", supportsCustomPageSizes"; | 0 |
| 235 | debug << ", physicalPageSize=("; | - |
| 236 | QtDebugUtils::formatQSize(debug, minimumPhysicalPageSize()); | - |
| 237 | debug << ")..("; | - |
| 238 | QtDebugUtils::formatQSize(debug, maximumPhysicalPageSize()); | - |
| 239 | debug << "), defaultResolution=" << defaultResolution() | - |
| 240 | << ", defaultDuplexMode=" << defaultDuplexMode() | - |
| 241 | << ", defaultColorMode="<< defaultColorMode(); | - |
| 242 | | - |
| 243 | const QList<QMimeType> mimeTypes = supportedMimeTypes(); | - |
| 244 | if (const int mimeTypeCount = (!| TRUE | never evaluated | | FALSE | never evaluated |
mimeTypes.sizeisEmpty()| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 245 | debug << ", supportedMimeTypes=("; | - |
| 246 | for (int i = 0;const iauto <&mimeType mimeTypeCount;: ++imimeTypes) | - |
| 247 | debug << " \"" << mimeTypesmimeType.at(i).name() << '"'; never executed: debug << " \"" << mimeType.name() << '"'; | 0 |
| 248 | debug << ')'; | - |
| 249 | } never executed: end of block | 0 |
| 250 | | - |
| 251 | } never executed: end of block else { | 0 |
| 252 | debug << "null"; | - |
| 253 | } never executed: end of block | 0 |
| 254 | } | - |
| 255 | | - |
| 256 | QDebug operator<<(QDebug debug, const QPrintDevice &p) | - |
| 257 | { | - |
| 258 | QDebugStateSaver saver(debug); | - |
| 259 | debug.nospace(); | - |
| 260 | debug << "QPrintDevice("; | - |
| 261 | p.format(debug); | - |
| 262 | debug << ')'; | - |
| 263 | return debug; | - |
| 264 | } | - |
| 265 | | - |
| 266 | | - |
| 267 | | - |
| 268 | | - |
| | |