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
12Q_DECLARE_METATYPE(QMarginsF)
13
14QT_BEGIN_NAMESPACE
15
16
17#ifndef QT_NO_PRINTER
18
19class Q_PRINTSUPPORT_EXPORT QPrintEngine
20{
21public:
22 virtual ~QPrintEngine() {}
23 enum PrintEnginePropertyKey {
24 PPK_CollateCopies,
25 PPK_ColorMode,
26 PPK_Creator,
27 PPK_DocumentName,
28 PPK_FullPage,
29 PPK_NumberOfCopies,
30 PPK_Orientation,
31 PPK_OutputFileName,
32 PPK_PageOrder,
33 PPK_PageRect,
34 PPK_PageSize,
35 PPK_PaperRect,
36 PPK_PaperSource,
37 PPK_PrinterName,
38 PPK_PrinterProgram,
39 PPK_Resolution,
40 PPK_SelectionOption,
41 PPK_SupportedResolutions,
42
43 PPK_WindowsPageSize,
44 PPK_FontEmbedding,
45
46 PPK_Duplex,
47
48 PPK_PaperSources,
49 PPK_CustomPaperSize,
50 PPK_PageMargins,
51 PPK_CopyCount,
52 PPK_SupportsMultipleCopies,
53 PPK_PaperName,
54 PPK_QPageSize,
55 PPK_QPageMargins,
56 PPK_QPageLayout,
57 PPK_PaperSize = PPK_PageSize,
58
59 PPK_CustomBase = 0xff00
60 };
61
62 virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) = 0;
63 virtual QVariant property(PrintEnginePropertyKey key) const = 0;
64
65 virtual bool newPage() = 0;
66 virtual bool abort() = 0;
67
68 virtual int metric(QPaintDevice::PaintDeviceMetric) const = 0;
69
70 virtual QPrinter::PrinterState printerState() const = 0;
71};
72
73#endif // QT_NO_PRINTER
74
75QT_END_NAMESPACE
76
77#endif // QPRINTENGINE_H
78

source code of qtbase/src/printsupport/kernel/qprintengine.h