1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QPRINTENGINE_H |
5 | #define QPRINTENGINE_H |
6 | |
7 | #include <QtPrintSupport/qtprintsupportglobal.h> |
8 | #include <QtCore/qvariant.h> |
9 | #include <QtPrintSupport/qprinter.h> |
10 | |
11 | // ### move to qmargins.h |
12 | Q_DECLARE_METATYPE(QMarginsF) |
13 | |
14 | QT_BEGIN_NAMESPACE |
15 | |
16 | |
17 | #ifndef QT_NO_PRINTER |
18 | |
19 | class Q_PRINTSUPPORT_EXPORT QPrintEngine |
20 | { |
21 | public: |
22 | virtual ~QPrintEngine(); |
23 | |
24 | enum PrintEnginePropertyKey { |
25 | PPK_CollateCopies, |
26 | PPK_ColorMode, |
27 | PPK_Creator, |
28 | PPK_DocumentName, |
29 | PPK_FullPage, |
30 | PPK_NumberOfCopies, |
31 | PPK_Orientation, |
32 | PPK_OutputFileName, |
33 | PPK_PageOrder, |
34 | PPK_PageRect, |
35 | PPK_PageSize, |
36 | PPK_PaperRect, |
37 | PPK_PaperSource, |
38 | PPK_PrinterName, |
39 | PPK_PrinterProgram, |
40 | PPK_Resolution, |
41 | PPK_SelectionOption, |
42 | PPK_SupportedResolutions, |
43 | |
44 | PPK_WindowsPageSize, |
45 | PPK_FontEmbedding, |
46 | |
47 | PPK_Duplex, |
48 | |
49 | PPK_PaperSources, |
50 | PPK_CustomPaperSize, |
51 | PPK_PageMargins, |
52 | PPK_CopyCount, |
53 | PPK_SupportsMultipleCopies, |
54 | PPK_PaperName, |
55 | PPK_QPageSize, |
56 | PPK_QPageMargins, |
57 | PPK_QPageLayout, |
58 | PPK_PaperSize = PPK_PageSize, |
59 | |
60 | PPK_CustomBase = 0xff00 |
61 | }; |
62 | |
63 | virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) = 0; |
64 | virtual QVariant property(PrintEnginePropertyKey key) const = 0; |
65 | |
66 | virtual bool newPage() = 0; |
67 | virtual bool abort() = 0; |
68 | |
69 | virtual int metric(QPaintDevice::PaintDeviceMetric) const = 0; |
70 | |
71 | virtual QPrinter::PrinterState printerState() const = 0; |
72 | }; |
73 | |
74 | #endif // QT_NO_PRINTER |
75 | |
76 | QT_END_NAMESPACE |
77 | |
78 | #endif // QPRINTENGINE_H |
79 |