qprintdevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/printsupport/kernel/qprintdevice.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7QPrintDevice::QPrintDevice()-
8 : d(new QPlatformPrintDevice())-
9{-
10}-
11-
12QPrintDevice::QPrintDevice(const QString &id)-
13 : d(new QPlatformPrintDevice(id))-
14{-
15}-
16-
17QPrintDevice::QPrintDevice(QPlatformPrintDevice *dd)-
18 : d(dd)-
19{-
20}-
21-
22QPrintDevice::QPrintDevice(const QPrintDevice &other)-
23 : d(other.d)-
24{-
25}-
26-
27QPrintDevice::~QPrintDevice()-
28{-
29}-
30-
31QPrintDevice &QPrintDevice::operator=(const QPrintDevice &other)-
32{-
33 d = other.d;-
34 return *this;-
35}-
36-
37bool 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-
44QString QPrintDevice::id() const-
45{-
46 return isValid() ? d->id() : QString();-
47}-
48-
49QString QPrintDevice::name() const-
50{-
51 return isValid() ? d->name() : QString();-
52}-
53-
54QString QPrintDevice::location() const-
55{-
56 return isValid() ? d->location() : QString();-
57}-
58-
59QString QPrintDevice::makeAndModel() const-
60{-
61 return isValid() ? d->makeAndModel() : QString();-
62}-
63-
64bool QPrintDevice::isValid() const-
65{-
66 return d && d->isValid();-
67}-
68-
69bool QPrintDevice::isDefault() const-
70{-
71 return isValid() && d->isDefault();-
72}-
73-
74bool QPrintDevice::isRemote() const-
75{-
76 return isValid() && d->isRemote();-
77}-
78-
79QPrint::DeviceState QPrintDevice::state() const-
80{-
81 return isValid() ? d->state() : QPrint::Error;-
82}-
83-
84bool QPrintDevice::isValidPageLayout(const QPageLayout &layout, int resolution) const-
85{-
86 return isValid() && d->isValidPageLayout(layout, resolution);-
87}-
88-
89bool QPrintDevice::supportsMultipleCopies() const-
90{-
91 return isValid() && d->supportsMultipleCopies();-
92}-
93-
94bool QPrintDevice::supportsCollateCopies() const-
95{-
96 return isValid() && d->supportsCollateCopies();-
97}-
98-
99QPageSize QPrintDevice::defaultPageSize() const-
100{-
101 return isValid() ? d->defaultPageSize() : QPageSize();-
102}-
103-
104QList<QPageSize> QPrintDevice::supportedPageSizes() const-
105{-
106 return isValid() ? d->supportedPageSizes() : QList<QPageSize>();-
107}-
108-
109QPageSize QPrintDevice::supportedPageSize(const QPageSize &pageSize) const-
110{-
111 return isValid() ? d->supportedPageSize(pageSize) : QPageSize();-
112}-
113-
114QPageSize QPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSizeId) const-
115{-
116 return isValid() ? d->supportedPageSize(pageSizeId) : QPageSize();-
117}-
118-
119QPageSize QPrintDevice::supportedPageSize(const QString &pageName) const-
120{-
121 return isValid() ? d->supportedPageSize(pageName) : QPageSize();-
122}-
123-
124QPageSize QPrintDevice::supportedPageSize(const QSize &pointSize) const-
125{-
126 return isValid() ? d->supportedPageSize(pointSize) : QPageSize();-
127}-
128-
129QPageSize QPrintDevice::supportedPageSize(const QSizeF &size, QPageSize::Unit units) const-
130{-
131 return isValid() ? d->supportedPageSize(size, units) : QPageSize();-
132}-
133-
134bool QPrintDevice::supportsCustomPageSizes() const-
135{-
136 return isValid() && d->supportsCustomPageSizes();-
137}-
138-
139QSize QPrintDevice::minimumPhysicalPageSize() const-
140{-
141 return isValid() ? d->minimumPhysicalPageSize() : QSize();-
142}-
143-
144QSize QPrintDevice::maximumPhysicalPageSize() const-
145{-
146 return isValid() ? d->maximumPhysicalPageSize() : QSize();-
147}-
148-
149QMarginsF 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-
156int QPrintDevice::defaultResolution() const-
157{-
158 return isValid() ? d->defaultResolution() : 0;-
159}-
160-
161QList<int> QPrintDevice::supportedResolutions() const-
162{-
163 return isValid() ? d->supportedResolutions() : QList<int>();-
164}-
165-
166QPrint::InputSlot QPrintDevice::defaultInputSlot() const-
167{-
168 return isValid() ? d->defaultInputSlot() : QPrint::InputSlot();-
169}-
170-
171QList<QPrint::InputSlot> QPrintDevice::supportedInputSlots() const-
172{-
173 return isValid() ? d->supportedInputSlots() : QList<QPrint::InputSlot>();-
174}-
175-
176QPrint::OutputBin QPrintDevice::defaultOutputBin() const-
177{-
178 return isValid() ? d->defaultOutputBin() : QPrint::OutputBin();-
179}-
180-
181QList<QPrint::OutputBin> QPrintDevice::supportedOutputBins() const-
182{-
183 return isValid() ? d->supportedOutputBins() : QList<QPrint::OutputBin>();-
184}-
185-
186QPrint::DuplexMode QPrintDevice::defaultDuplexMode() const-
187{-
188 return isValid() ? d->defaultDuplexMode() : QPrint::DuplexNone;-
189}-
190-
191QList<QPrint::DuplexMode> QPrintDevice::supportedDuplexModes() const-
192{-
193 return isValid() ? d->supportedDuplexModes() : QList<QPrint::DuplexMode>();-
194}-
195-
196QPrint::ColorMode QPrintDevice::defaultColorMode() const-
197{-
198 return isValid() ? d->defaultColorMode() : QPrint::GrayScale;-
199}-
200-
201QList<QPrint::ColorMode> QPrintDevice::supportedColorModes() const-
202{-
203 return isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>();-
204}-
205-
206-
207QList<QMimeType> QPrintDevice::supportedMimeTypes() const-
208{-
209 return isValid() ? d->supportedMimeTypes() : QList<QMimeType>();-
210}-
211-
212-
213-
214void QPrintDevice::format(QDebug debug) const-
215{-
216 QDebugStateSaver saver(debug);-
217 debug.noquote();-
218 debug.nospace();-
219 if (isValid()
isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
220 const QString deviceId = id();-
221 const QString deviceName = name();-
222 debug << "id=\"" << deviceId << "\", state=" << state();-
223 if (!deviceName.isEmpty()
!deviceName.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& deviceName != deviceId
deviceName != deviceIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
224 debug << ", name=\"" << deviceName << '"';
never executed: debug << ", name=\"" << deviceName << '"';
0
225 if (!location().isEmpty()
!location().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
226 debug << ", location=\"" << location() << '"';
never executed: debug << ", location=\"" << location() << '"';
0
227 debug << ", makeAndModel=\"" << makeAndModel() << '"';-
228 if (isDefault()
isDefault()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
229 debug << ", default";
never executed: debug << ", default";
0
230 if (isRemote()
isRemote()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
231 debug << ", remote";
never executed: debug << ", remote";
0
232 debug << ", defaultPageSize=" << defaultPageSize();-
233 if (supportsCustomPageSizes()
supportsCustomPageSizes()Description
TRUEnever evaluated
FALSEnever 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 = (!
!mimeTypes.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
mimeTypes.sizeisEmpty()
!mimeTypes.isEmpty()Description
TRUEnever evaluated
FALSEnever 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-
256QDebug 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-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9