Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
62
63 // Note: Keep in sync with QPrinter::DuplexMode
70
71 // Note: Keep in sync with QPrinter::ColorMode
72 enum ColorMode {
74 Color
75 };
76
77 // Note: Keep in sync with QPrinter::PaperSource for now
78 // If/when made public, rearrange and rename
98
105
114
120
121}
122
128
131 const char *key;
132};
133
134// Print utilities shared by print plugins
135
136namespace QPrintUtils {
137
138Q_PRINTSUPPORT_EXPORT QPrint::InputSlotId inputSlotKeyToInputSlotId(const QByteArray &key);
140Q_PRINTSUPPORT_EXPORT int inputSlotIdToWindowsId(QPrint::InputSlotId id);
141Q_PRINTSUPPORT_EXPORT QPrint::OutputBinId outputBinKeyToOutputBinId(const QByteArray &key);
143Q_PRINTSUPPORT_EXPORT QPrint::InputSlot paperBinToInputSlot(int windowsId, const QString &name);
144
145# if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
146// PPD utilities shared by CUPS and Mac plugins requiring CUPS headers
147// May turn into a proper internal QPpd class if enough shared between Mac and CUPS,
148// but where would it live? Not in base module as don't want to link to CUPS.
149// May have to have two copies in plugins to keep in sync.
150Q_PRINTSUPPORT_EXPORT QPrint::InputSlot ppdChoiceToInputSlot(const ppd_choice_t &choice);
151Q_PRINTSUPPORT_EXPORT QPrint::OutputBin ppdChoiceToOutputBin(const ppd_choice_t &choice);
152Q_PRINTSUPPORT_EXPORT int parsePpdResolution(const QByteArray &value);
153Q_PRINTSUPPORT_EXPORT QPrint::DuplexMode ppdChoiceToDuplexMode(const QByteArray &choice);
154# endif // Mac and CUPS PPD Utilities
155};
156
157#endif // QT_NO_PRINTER
158
160
161#endif // QPRINT_P_H
\inmodule QtCore
Definition qbytearray.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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:72
@ GrayScale
Definition qprint_p.h:73
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:79
@ CustomInputSlot
Definition qprint_p.h:94
@ FormSource
Definition qprint_p.h:92
@ OnlyOne
Definition qprint_p.h:96
@ Envelope
Definition qprint_p.h:84
@ EnvelopeManual
Definition qprint_p.h:85
@ LargeCapacity
Definition qprint_p.h:90
@ LargeFormat
Definition qprint_p.h:89
@ Cassette
Definition qprint_p.h:91
@ Lower
Definition qprint_p.h:81
@ Upper
Definition qprint_p.h:80
@ Middle
Definition qprint_p.h:82
@ SmallFormat
Definition qprint_p.h:88
@ Tractor
Definition qprint_p.h:87
@ Auto
Definition qprint_p.h:86
@ LastInputSlot
Definition qprint_p.h:95
@ MaxPageSource
Definition qprint_p.h:93
@ Manual
Definition qprint_p.h:83
OutputBinId
Definition qprint_p.h:106
@ LowerBin
Definition qprint_p.h:109
@ LastOutputBin
Definition qprint_p.h:112
@ RearBin
Definition qprint_p.h:110
@ UpperBin
Definition qprint_p.h:108
@ CustomOutputBin
Definition qprint_p.h:111
@ AutoOutputBin
Definition qprint_p.h:107
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:1525
GLuint64 key
GLuint name
QPrint::InputSlotId id
Definition qprint_p.h:124
const char * key
Definition qprint_p.h:126
QPrint::OutputBinId id
Definition qprint_p.h:130
const char * key
Definition qprint_p.h:131
QPrint::InputSlotId id
Definition qprint_p.h:102
QByteArray key
Definition qprint_p.h:100
QPrint::OutputBinId id
Definition qprint_p.h:118
QByteArray key
Definition qprint_p.h:116