Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qprintengine_pdf_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QPRINTENGINE_PDF_P_H
6#define QPRINTENGINE_PDF_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "QtPrintSupport/qprintengine.h"
20
21#ifndef QT_NO_PRINTER
22#include "QtCore/qdatastream.h"
23#include "QtCore/qmap.h"
24#include "QtCore/qstring.h"
25#include "QtGui/qpaintengine.h"
26#include "QtGui/qpainterpath.h"
27
28#include "private/qfontengine_p.h"
29#include "private/qpdf_p.h"
30#include "private/qpaintengine_p.h"
31#include "qprintengine.h"
32#include "qprint_p.h"
33
35
36class QImage;
37class QDataStream;
38class QPen;
39class QPointF;
40class QRegion;
41class QFile;
42
43class QPdfPrintEnginePrivate;
44
45class Q_PRINTSUPPORT_EXPORT QPdfPrintEngine : public QPdfEngine, public QPrintEngine
46{
47 Q_DECLARE_PRIVATE(QPdfPrintEngine)
48public:
49 QPdfPrintEngine(QPrinter::PrinterMode m, QPdfEngine::PdfVersion version = QPdfEngine::Version_1_4);
50 virtual ~QPdfPrintEngine();
51
52 // reimplementations QPaintEngine
53 bool begin(QPaintDevice *pdev) override;
54 bool end() override;
55 // end reimplementations QPaintEngine
56
57 // reimplementations QPrintEngine
58 bool abort() override {return false;}
59 QPrinter::PrinterState printerState() const override {return state;}
60
61 bool newPage() override;
62 int metric(QPaintDevice::PaintDeviceMetric) const override;
63 virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) override;
64 virtual QVariant property(PrintEnginePropertyKey key) const override;
65 // end reimplementations QPrintEngine
66
67 QPrinter::PrinterState state;
68
69protected:
70 QPdfPrintEngine(QPdfPrintEnginePrivate &p);
71
72private:
73 Q_DISABLE_COPY(QPdfPrintEngine)
74};
75
76class Q_PRINTSUPPORT_EXPORT QPdfPrintEnginePrivate : public QPdfEnginePrivate
77{
78 Q_DECLARE_PUBLIC(QPdfPrintEngine)
79public:
80 QPdfPrintEnginePrivate(QPrinter::PrinterMode m);
81 ~QPdfPrintEnginePrivate();
82
83 QPrinter::ColorMode printerColorMode() const;
84
85 virtual bool openPrintDevice();
86 virtual void closePrintDevice();
87
88private:
89 Q_DISABLE_COPY(QPdfPrintEnginePrivate)
90
91 friend class QCupsPrintEngine;
92 friend class QCupsPrintEnginePrivate;
93
94 QString printerName;
95 QString printProgram;
96 QString selectionOption;
97
98 bool collate;
99 int copies;
100 QPrinter::PageOrder pageOrder;
101 QPrinter::PaperSource paperSource;
102
103 int fd;
104};
105
106QT_END_NAMESPACE
107
108#endif // QT_NO_PRINTER
109
110#endif // QPRINTENGINE_PDF_P_H
bool begin(QPaintDevice *pdev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
bool end() override
Reimplement this function to finish painting on the current paint device.
QVariant property(PrintEnginePropertyKey key) const override
Returns the print engine's property specified by key.
void setProperty(PrintEnginePropertyKey key, const QVariant &value) override
Sets the print engine's property specified by key to the given value.
~QOhosPdfPrintEngine() override
\inmodule QtCore\reentrant
Definition qpoint.h:232
Combined button and popup list for selecting options.