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
27QT_BEGIN_NAMESPACE
28
29class QCupsPrintEnginePrivate;
30
31class QCupsPrintEngine : public QPdfPrintEngine
32{
33 Q_DECLARE_PRIVATE(QCupsPrintEngine)
34public:
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
43private:
44 Q_DISABLE_COPY_MOVE(QCupsPrintEngine)
45};
46
47class QCupsPrintEnginePrivate : public QPdfPrintEnginePrivate
48{
49 Q_DECLARE_PUBLIC(QCupsPrintEngine)
50public:
51 QCupsPrintEnginePrivate(QPrinter::PrinterMode m);
52 ~QCupsPrintEnginePrivate();
53
54 bool openPrintDevice() override;
55 void closePrintDevice() override;
56
57private:
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
70QT_END_NAMESPACE
71
72#endif // QCUPSPRINTENGINE_P_H
73

source code of qtbase/src/plugins/printsupport/cups/qcupsprintengine_p.h