| 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_PDF_P_H |
| 5 | #define QPRINTENGINE_PDF_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 | #ifndef QT_NO_PRINTER |
| 21 | #include "QtCore/qdatastream.h" |
| 22 | #include "QtCore/qmap.h" |
| 23 | #include "QtCore/qstring.h" |
| 24 | #include "QtGui/qpaintengine.h" |
| 25 | #include "QtGui/qpainterpath.h" |
| 26 | |
| 27 | #include "private/qfontengine_p.h" |
| 28 | #include "private/qpdf_p.h" |
| 29 | #include "private/qpaintengine_p.h" |
| 30 | #include "qprintengine.h" |
| 31 | #include "qprint_p.h" |
| 32 | |
| 33 | QT_BEGIN_NAMESPACE |
| 34 | |
| 35 | class QImage; |
| 36 | class QDataStream; |
| 37 | class QPen; |
| 38 | class QPointF; |
| 39 | class QRegion; |
| 40 | class QFile; |
| 41 | |
| 42 | class QPdfPrintEnginePrivate; |
| 43 | |
| 44 | class Q_PRINTSUPPORT_EXPORT QPdfPrintEngine : public QPdfEngine, public QPrintEngine |
| 45 | { |
| 46 | Q_DECLARE_PRIVATE(QPdfPrintEngine) |
| 47 | public: |
| 48 | QPdfPrintEngine(QPrinter::PrinterMode m, QPdfEngine::PdfVersion version = QPdfEngine::Version_1_4); |
| 49 | virtual ~QPdfPrintEngine(); |
| 50 | |
| 51 | // reimplementations QPaintEngine |
| 52 | bool begin(QPaintDevice *pdev) override; |
| 53 | bool end() override; |
| 54 | // end reimplementations QPaintEngine |
| 55 | |
| 56 | // reimplementations QPrintEngine |
| 57 | bool abort() override {return false;} |
| 58 | QPrinter::PrinterState printerState() const override {return state;} |
| 59 | |
| 60 | bool newPage() override; |
| 61 | int metric(QPaintDevice::PaintDeviceMetric) const override; |
| 62 | virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) override; |
| 63 | virtual QVariant property(PrintEnginePropertyKey key) const override; |
| 64 | // end reimplementations QPrintEngine |
| 65 | |
| 66 | QPrinter::PrinterState state; |
| 67 | |
| 68 | protected: |
| 69 | QPdfPrintEngine(QPdfPrintEnginePrivate &p); |
| 70 | |
| 71 | private: |
| 72 | Q_DISABLE_COPY(QPdfPrintEngine) |
| 73 | }; |
| 74 | |
| 75 | class Q_PRINTSUPPORT_EXPORT QPdfPrintEnginePrivate : public QPdfEnginePrivate |
| 76 | { |
| 77 | Q_DECLARE_PUBLIC(QPdfPrintEngine) |
| 78 | public: |
| 79 | QPdfPrintEnginePrivate(QPrinter::PrinterMode m); |
| 80 | ~QPdfPrintEnginePrivate(); |
| 81 | |
| 82 | QPrinter::ColorMode printerColorMode() const; |
| 83 | |
| 84 | virtual bool openPrintDevice(); |
| 85 | virtual void closePrintDevice(); |
| 86 | |
| 87 | private: |
| 88 | Q_DISABLE_COPY(QPdfPrintEnginePrivate) |
| 89 | |
| 90 | friend class QCupsPrintEngine; |
| 91 | friend class QCupsPrintEnginePrivate; |
| 92 | |
| 93 | QString printerName; |
| 94 | QString printProgram; |
| 95 | QString selectionOption; |
| 96 | |
| 97 | bool collate; |
| 98 | int copies; |
| 99 | QPrinter::PageOrder pageOrder; |
| 100 | QPrinter::PaperSource paperSource; |
| 101 | |
| 102 | int fd; |
| 103 | }; |
| 104 | |
| 105 | QT_END_NAMESPACE |
| 106 | |
| 107 | #endif // QT_NO_PRINTER |
| 108 | |
| 109 | #endif // QPRINTENGINE_PDF_P_H |
| 110 |
