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
qprinter_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 QPRINTER_P_H
6#define QPRINTER_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
20#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
21
22#ifndef QT_NO_PRINTER
23
24#include "QtPrintSupport/qprinter.h"
25#include "QtPrintSupport/qprinterinfo.h"
26#include "QtPrintSupport/qprintengine.h"
27#include "QtCore/qpointer.h"
28#include "QtCore/qset.h"
29
30#include <limits.h>
31
32QT_BEGIN_NAMESPACE
33
34class QPrintEngine;
36class QPicture;
37
38class Q_PRINTSUPPORT_EXPORT QPrinterPrivate
39{
40 Q_DECLARE_PUBLIC(QPrinter)
41public:
42 QPrinterPrivate(QPrinter *printer)
43 : pdfVersion(QPrinter::PdfVersion_1_4),
44 printEngine(nullptr),
45 paintEngine(nullptr),
46 realPrintEngine(nullptr),
47 realPaintEngine(nullptr),
48#if QT_CONFIG(printpreviewwidget)
49 previewEngine(nullptr),
50#endif
51 q_ptr(printer),
52 printRange(QPrinter::AllPages),
53 use_default_engine(true),
54 validPrinter(false)
55 {
56 }
57
58 ~QPrinterPrivate() {
59
60 }
61
62 static QPrinterPrivate *get(QPrinter *printer) {
63 return printer->d_ptr.get();
64 }
65
66 void init(const QPrinterInfo &printer, QPrinter::PrinterMode mode);
67
68 QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
69 void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
70 void changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
71#if QT_CONFIG(printpreviewwidget)
72 QList<const QPicture *> previewPages() const;
73 void setPreviewMode(bool);
74 bool previewMode() const;
75#endif
76
77 void setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value);
78
79 QPrinter::PrinterMode printerMode;
80 QPrinter::OutputFormat outputFormat;
81 QPrinter::PdfVersion pdfVersion;
82 QPrintEngine *printEngine;
83 QPaintEngine *paintEngine;
84
85 QPrintEngine *realPrintEngine;
86 QPaintEngine *realPaintEngine;
87#if QT_CONFIG(printpreviewwidget)
88 QPreviewPaintEngine *previewEngine;
89#endif
90
91 QPrinter *q_ptr;
92
93 QPrinter::PrintRange printRange;
94
95 uint use_default_engine : 1;
96 uint had_default_engines : 1;
97
98 uint validPrinter : 1;
99 uint hasCustomPageMargins : 1;
100
101 // Used to remember which properties have been manually set by the user.
102 QSet<QPrintEngine::PrintEnginePropertyKey> m_properties;
103};
104
105QT_END_NAMESPACE
106
107#endif // QT_NO_PRINTER
108
109#endif // QPRINTER_P_H
QWin32PrintEngine * engine
QWin32PrintEnginePrivate * ep
static bool warnIfNotNative(QPrinter *printer)
#define START_PAGE_GENERAL
static void qt_win_setup_PRINTDLGEX(PRINTDLGEX *pd, QWindow *parentWindow, QPrintDialog *pdlg, QPrintDialogPrivate *d, HGLOBAL *tempDevNames)
#define PD_RESULT_PRINT
#define PD_NOCURRENTPAGE
static void qt_win_read_back_PRINTDLGEX(PRINTDLGEX *pd, QPrintDialog *pdlg, QPrintDialogPrivate *d)
#define PD_RESULT_APPLY