Line | Source Code | Coverage |
---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | - |
4 | ** Contact: http://www.qt-project.org/legal | - |
5 | ** | - |
6 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and Digia. For licensing terms and | - |
14 | ** conditions see http://qt.digia.com/licensing. For further information | - |
15 | ** use the contact form at http://qt.digia.com/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 2.1 as published by the Free Software | - |
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | - |
21 | ** packaging of this file. Please review the following information to | - |
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | - |
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
24 | ** | - |
25 | ** In addition, as a special exception, Digia gives you certain additional | - |
26 | ** rights. These rights are described in the Digia Qt LGPL Exception | - |
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
28 | ** | - |
29 | ** GNU General Public License Usage | - |
30 | ** Alternatively, this file may be used under the terms of the GNU | - |
31 | ** General Public License version 3.0 as published by the Free Software | - |
32 | ** Foundation and appearing in the file LICENSE.GPL included in the | - |
33 | ** packaging of this file. Please review the following information to | - |
34 | ** ensure the GNU General Public License version 3.0 requirements will be | - |
35 | ** met: http://www.gnu.org/copyleft/gpl.html. | - |
36 | ** | - |
37 | ** | - |
38 | ** $QT_END_LICENSE$ | - |
39 | ** | - |
40 | ****************************************************************************/ | - |
41 | | - |
42 | #include "qplatformprintersupport.h" | - |
43 | | - |
44 | #include <QtPrintSupport/qprinterinfo.h> | - |
45 | | - |
46 | #include <private/qprinterinfo_p.h> | - |
47 | | - |
48 | #ifndef QT_NO_PRINTER | - |
49 | | - |
50 | QT_BEGIN_NAMESPACE | - |
51 | | - |
52 | /*! | - |
53 | \class QPlatformPrinterSupport | - |
54 | \since 5.0 | - |
55 | \internal | - |
56 | \preliminary | - |
57 | \ingroup qpa | - |
58 | | - |
59 | \brief The QPlatformPrinterSupport class provides an abstraction for print support. | - |
60 | */ | - |
61 | | - |
62 | QPlatformPrinterSupport::QPlatformPrinterSupport() | - |
63 | { | - |
64 | } | - |
65 | | - |
66 | QPlatformPrinterSupport::~QPlatformPrinterSupport() | - |
67 | { | - |
68 | } | - |
69 | | - |
70 | QPrintEngine *QPlatformPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode) | - |
71 | { | - |
72 | return 0; never executed: return 0; | 0 |
73 | } | - |
74 | | - |
75 | QPaintEngine *QPlatformPrinterSupport::createPaintEngine(QPrintEngine *, QPrinter::PrinterMode) | - |
76 | { | - |
77 | return 0; never executed: return 0; | 0 |
78 | } | - |
79 | | - |
80 | QList<QPrinter::PaperSize> QPlatformPrinterSupport::supportedPaperSizes(const QPrinterInfo &) const | - |
81 | { | - |
82 | return QList<QPrinter::PaperSize>(); never executed: return QList<QPrinter::PaperSize>(); | 0 |
83 | } | - |
84 | | - |
85 | QList<QPrinterInfo> QPlatformPrinterSupport::availablePrinters() | - |
86 | { | - |
87 | return m_printers; executed: return m_printers; Execution Count:189 | 189 |
88 | } | - |
89 | | - |
90 | QPrinterInfo QPlatformPrinterSupport::defaultPrinter() | - |
91 | { | - |
92 | const QList<QPrinterInfo> printers = availablePrinters(); executed (the execution status of this line is deduced): const QList<QPrinterInfo> printers = availablePrinters(); | - |
93 | foreach (const QPrinterInfo &printerInfo, printers) { never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(printers)> _container_(printers); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QPrinterInfo &printerInfo = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
94 | if (printerInfo.isDefault()) never evaluated: printerInfo.isDefault() | 0 |
95 | return printerInfo; never executed: return printerInfo; | 0 |
96 | } | 0 |
97 | return QPrinterInfo(); executed: return QPrinterInfo(); Execution Count:85 | 85 |
98 | } | - |
99 | | - |
100 | QPrinterInfo QPlatformPrinterSupport::printerInfo(const QString &printerName) | - |
101 | { | - |
102 | const QList<QPrinterInfo> printers = availablePrinters(); executed (the execution status of this line is deduced): const QList<QPrinterInfo> printers = availablePrinters(); | - |
103 | foreach (const QPrinterInfo &printerInfo, printers) { never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(printers)> _container_(printers); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QPrinterInfo &printerInfo = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
104 | if (printerInfo.printerName() == printerName) never evaluated: printerInfo.printerName() == printerName | 0 |
105 | return printerInfo; never executed: return printerInfo; | 0 |
106 | } | 0 |
107 | return QPrinterInfo(); executed: return QPrinterInfo(); Execution Count:4 | 4 |
108 | } | - |
109 | | - |
110 | QString QPlatformPrinterSupport::printerOption(const QPrinterInfo &printer, const QString &key) const | - |
111 | { | - |
112 | Q_UNUSED(printer) never executed (the execution status of this line is deduced): (void)printer; | - |
113 | Q_UNUSED(key) never executed (the execution status of this line is deduced): (void)key; | - |
114 | return QString(); never executed: return QString(); | 0 |
115 | } | - |
116 | | - |
117 | PrinterOptions QPlatformPrinterSupport::printerOptions(const QPrinterInfo &printer) const | - |
118 | { | - |
119 | Q_UNUSED(printer) never executed (the execution status of this line is deduced): (void)printer; | - |
120 | return PrinterOptions(); never executed: return PrinterOptions(); | 0 |
121 | } | - |
122 | | - |
123 | int QPlatformPrinterSupport::printerIndex(const QPrinterInfo &printer) | - |
124 | { | - |
125 | return printer.d_func()->index; never executed: return printer.d_func()->index; | 0 |
126 | } | - |
127 | | - |
128 | QPrinterInfo QPlatformPrinterSupport::createPrinterInfo(const QString &name, const QString &description, | - |
129 | const QString &location, const QString &makeAndModel, | - |
130 | bool isDefault, int index) | - |
131 | { | - |
132 | QPrinterInfo printer(name); never executed (the execution status of this line is deduced): QPrinterInfo printer(name); | - |
133 | printer.d_func()->description = description; never executed (the execution status of this line is deduced): printer.d_func()->description = description; | - |
134 | printer.d_func()->location = location; never executed (the execution status of this line is deduced): printer.d_func()->location = location; | - |
135 | printer.d_func()->makeAndModel = makeAndModel; never executed (the execution status of this line is deduced): printer.d_func()->makeAndModel = makeAndModel; | - |
136 | printer.d_func()->isDefault = isDefault; never executed (the execution status of this line is deduced): printer.d_func()->isDefault = isDefault; | - |
137 | printer.d_func()->index = index; never executed (the execution status of this line is deduced): printer.d_func()->index = index; | - |
138 | return printer; never executed: return printer; | 0 |
139 | } | - |
140 | | - |
141 | /* | - |
142 | Converts QSizeF in millimeters to a predefined PaperSize (returns Custom if | - |
143 | the size isn't a standard size) | - |
144 | */ | - |
145 | extern QPrinter::PaperSize qSizeFTopaperSize(const QSizeF &); | - |
146 | QPrinter::PaperSize QPlatformPrinterSupport::convertQSizeFToPaperSize(const QSizeF &sizef) | - |
147 | { | - |
148 | return qSizeFTopaperSize(sizef); never executed: return qSizeFTopaperSize(sizef); | 0 |
149 | } | - |
150 | | - |
151 | /* | - |
152 | Converts a predefined PaperSize to a QSizeF in millimeters (returns | - |
153 | QSizeF(0.0, 0.0) if PaperSize is Custom) | - |
154 | */ | - |
155 | extern QSizeF qt_paperSizeToQSizeF(QPrinter::PaperSize size); | - |
156 | QSizeF QPlatformPrinterSupport::convertPaperSizeToQSizeF(QPrinter::PaperSize paperSize) | - |
157 | { | - |
158 | return qt_paperSizeToQSizeF(paperSize); never executed: return qt_paperSizeToQSizeF(paperSize); | 0 |
159 | } | - |
160 | | - |
161 | QT_END_NAMESPACE | - |
162 | | - |
163 | #endif // QT_NO_PRINTER | - |
164 | | - |
| | |