Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qprint_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// Copyright (C) 2014 John Layt <jlayt@kde.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QPRINT_P_H
6#define QPRINT_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/private/qtprintsupportglobal_p.h>
20#include <QtPrintSupport/qprinter.h>
21
22#include <QtCore/qstring.h>
23#include <QtCore/qlist.h>
24
25#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
26#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
27// ### QT_DECL_METATYPE_EXTERN_TAGGED once there's a qprint.cpp TU
28Q_DECLARE_METATYPE(ppd_file_t *)
29#endif
30
32
33#ifndef QT_NO_PRINTER
34
35// From windgdi.h
36#define DMBIN_UPPER 1
37#define DMBIN_ONLYONE 1
38#define DMBIN_LOWER 2
39#define DMBIN_MIDDLE 3
40#define DMBIN_MANUAL 4
41#define DMBIN_ENVELOPE 5
42#define DMBIN_ENVMANUAL 6
43#define DMBIN_AUTO 7
44#define DMBIN_TRACTOR 8
45#define DMBIN_SMALLFMT 9
46#define DMBIN_LARGEFMT 10
47#define DMBIN_LARGECAPACITY 11
48#define DMBIN_CASSETTE 14
49#define DMBIN_FORMSOURCE 15
50#define DMBIN_USER 256
51
52namespace QPrint {
53
54 // Note: Keep in sync with QPrinter::PrinterState for now
55 // Replace later with more detailed status reporting
60 Error
61 };
62
63 // Note: Keep in sync with QPrinter::DuplexMode
69 };
70
71 enum ColorMode {
73 Color
74 };
75
76 // Note: Keep in sync with QPrinter::PaperSource for now
77 // If/when made public, rearrange and rename
92 MaxPageSource, // Deprecated, kept for compatibility to QPrinter
96 };
97
98 struct InputSlot {
103 };
104
112 };
113
114 struct OutputBin {
118 };
119
120}
121
125 const char *key;
126};
127
130 const char *key;
131};
132
133// Print utilities shared by print plugins
134
135namespace QPrintUtils {
136
137Q_PRINTSUPPORT_EXPORT QPrint::InputSlotId inputSlotKeyToInputSlotId(const QByteArray &key);
139Q_PRINTSUPPORT_EXPORT int inputSlotIdToWindowsId(QPrint::InputSlotId id);
140Q_PRINTSUPPORT_EXPORT QPrint::OutputBinId outputBinKeyToOutputBinId(const QByteArray &key);
142Q_PRINTSUPPORT_EXPORT QPrint::InputSlot paperBinToInputSlot(int windowsId, const QString &name);
143
144# if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
145// PPD utilities shared by CUPS and Mac plugins requiring CUPS headers
146// May turn into a proper internal QPpd class if enough shared between Mac and CUPS,
147// but where would it live? Not in base module as don't want to link to CUPS.
148// May have to have two copies in plugins to keep in sync.
149Q_PRINTSUPPORT_EXPORT QPrint::InputSlot ppdChoiceToInputSlot(const ppd_choice_t &choice);
150Q_PRINTSUPPORT_EXPORT QPrint::OutputBin ppdChoiceToOutputBin(const ppd_choice_t &choice);
151Q_PRINTSUPPORT_EXPORT int parsePpdResolution(const QByteArray &value);
152Q_PRINTSUPPORT_EXPORT QPrint::DuplexMode ppdChoiceToDuplexMode(const QByteArray &choice);
153# endif // Mac and CUPS PPD Utilities
154};
155
156#endif // QT_NO_PRINTER
157
159
160#endif // QPRINT_P_H
\inmodule QtCore
Definition qbytearray.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
int inputSlotIdToWindowsId(QPrint::InputSlotId id)
Definition qprint.cpp:60
QPrint::InputSlotId inputSlotKeyToInputSlotId(const QByteArray &key)
Definition qprint.cpp:42
QByteArray inputSlotIdToInputSlotKey(QPrint::InputSlotId id)
Definition qprint.cpp:51
QByteArray outputBinIdToOutputBinKey(QPrint::OutputBinId id)
Definition qprint.cpp:78
QPrint::OutputBinId outputBinKeyToOutputBinId(const QByteArray &key)
Definition qprint.cpp:69
QPrint::InputSlot paperBinToInputSlot(int windowsId, const QString &name)
Definition qprint.cpp:87
ColorMode
Definition qprint_p.h:71
@ Color
Definition qprint_p.h:73
@ GrayScale
Definition qprint_p.h:72
DuplexMode
Definition qprint_p.h:64
@ DuplexLongSide
Definition qprint_p.h:67
@ DuplexShortSide
Definition qprint_p.h:68
@ DuplexNone
Definition qprint_p.h:65
@ DuplexAuto
Definition qprint_p.h:66
InputSlotId
Definition qprint_p.h:78
@ CustomInputSlot
Definition qprint_p.h:93
@ FormSource
Definition qprint_p.h:91
@ OnlyOne
Definition qprint_p.h:95
@ Envelope
Definition qprint_p.h:83
@ EnvelopeManual
Definition qprint_p.h:84
@ LargeCapacity
Definition qprint_p.h:89
@ LargeFormat
Definition qprint_p.h:88
@ Cassette
Definition qprint_p.h:90
@ Lower
Definition qprint_p.h:80
@ Upper
Definition qprint_p.h:79
@ Middle
Definition qprint_p.h:81
@ SmallFormat
Definition qprint_p.h:87
@ Tractor
Definition qprint_p.h:86
@ Auto
Definition qprint_p.h:85
@ LastInputSlot
Definition qprint_p.h:94
@ MaxPageSource
Definition qprint_p.h:92
@ Manual
Definition qprint_p.h:82
OutputBinId
Definition qprint_p.h:105
@ LowerBin
Definition qprint_p.h:108
@ LastOutputBin
Definition qprint_p.h:111
@ RearBin
Definition qprint_p.h:109
@ UpperBin
Definition qprint_p.h:107
@ CustomOutputBin
Definition qprint_p.h:110
@ AutoOutputBin
Definition qprint_p.h:106
DeviceState
Definition qprint_p.h:56
@ Idle
Definition qprint_p.h:57
@ Error
Definition qprint_p.h:60
@ Aborted
Definition qprint_p.h:59
@ Active
Definition qprint_p.h:58
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1504
GLuint64 key
GLuint name
QPrint::InputSlotId id
Definition qprint_p.h:123
const char * key
Definition qprint_p.h:125
QPrint::OutputBinId id
Definition qprint_p.h:129
const char * key
Definition qprint_p.h:130
QPrint::InputSlotId id
Definition qprint_p.h:101
QByteArray key
Definition qprint_p.h:99
QPrint::OutputBinId id
Definition qprint_p.h:117
QByteArray key
Definition qprint_p.h:115