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 QCUPSPRINTENGINE_P_H |
5 | #define QCUPSPRINTENGINE_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include "QtPrintSupport/qprintengine.h" |
19 | |
20 | #include <QtCore/qstring.h> |
21 | #include <QtGui/qpaintengine.h> |
22 | |
23 | #include <private/qpaintengine_p.h> |
24 | #include <private/qprintdevice_p.h> |
25 | #include <private/qprintengine_pdf_p.h> |
26 | |
27 | QT_BEGIN_NAMESPACE |
28 | |
29 | class QCupsPrintEnginePrivate; |
30 | |
31 | class QCupsPrintEngine : public QPdfPrintEngine |
32 | { |
33 | Q_DECLARE_PRIVATE(QCupsPrintEngine) |
34 | public: |
35 | QCupsPrintEngine(QPrinter::PrinterMode m, const QString &deviceId); |
36 | virtual ~QCupsPrintEngine(); |
37 | |
38 | // reimplementations QPdfPrintEngine |
39 | void setProperty(PrintEnginePropertyKey key, const QVariant &value) override; |
40 | QVariant property(PrintEnginePropertyKey key) const override; |
41 | // end reimplementations QPdfPrintEngine |
42 | |
43 | private: |
44 | Q_DISABLE_COPY_MOVE(QCupsPrintEngine) |
45 | }; |
46 | |
47 | class QCupsPrintEnginePrivate : public QPdfPrintEnginePrivate |
48 | { |
49 | Q_DECLARE_PUBLIC(QCupsPrintEngine) |
50 | public: |
51 | QCupsPrintEnginePrivate(QPrinter::PrinterMode m); |
52 | ~QCupsPrintEnginePrivate(); |
53 | |
54 | bool openPrintDevice() override; |
55 | void closePrintDevice() override; |
56 | |
57 | private: |
58 | Q_DISABLE_COPY_MOVE(QCupsPrintEnginePrivate) |
59 | |
60 | void changePrinter(const QString &newPrinter); |
61 | void setPageSize(const QPageSize &pageSize); |
62 | |
63 | QPrintDevice m_printDevice; |
64 | QStringList cupsOptions; |
65 | QString cupsTempFile; |
66 | QPrint::DuplexMode duplex; |
67 | bool duplexRequestedExplicitly = false; |
68 | }; |
69 | |
70 | QT_END_NAMESPACE |
71 | |
72 | #endif // QCUPSPRINTENGINE_P_H |
73 |