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
qcups_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
4#ifndef QCUPS_P_H
5#define QCUPS_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/private/qtprintsupportglobal_p.h>
19#include <QtPrintSupport/private/qprint_p.h>
20#include "QtCore/qstring.h"
21#include "QtCore/qstringlist.h"
22#include "QtPrintSupport/qprinter.h"
23#include "QtCore/qdatetime.h"
24
26
28
29class QPrintDevice;
30
31// HACK! Define these here temporarily so they can be used in the dialogs
32// without a circular reference to QCupsPrintEngine in the plugin.
33// Move back to qcupsprintengine_p.h in the plugin once all usage
34// removed from the dialogs.
35#define PPK_CupsOptions QPrintEngine::PrintEnginePropertyKey(0xfe00)
36
37#define PDPK_PpdFile QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase)
38#define PDPK_PpdOption QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 1)
39#define PDPK_CupsJobPriority QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 2)
40#define PDPK_CupsJobSheets QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 3)
41#define PDPK_CupsJobBilling QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 4)
42#define PDPK_CupsJobHoldUntil QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 5)
43#define PDPK_PpdChoiceIsInstallableConflict QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 6)
44
45class Q_PRINTSUPPORT_EXPORT QCUPSSupport
46{
47public:
48 // Enum for values of job-hold-until option
50 NoHold = 0, //CUPS Default
57 SpecificTime
58 };
59
60 // Enum for valid banner pages
62 NoBanner = 0, //CUPS Default 'none'
68 TopSecret
69 };
70
71 // Enum for valid page set
72 enum PageSet {
73 AllPages = 0, //CUPS Default
75 EvenPages
76 };
77
78 // Enum for valid number of pages per sheet
87
88 // Enum for valid layouts of pages per sheet
99
100 static void setCupsOption(QPrinter *printer, const QString &option, const QString &value);
101 static void clearCupsOption(QPrinter *printer, const QString &option);
102 static void clearCupsOptions(QPrinter *printer);
103
104 static void setJobHold(QPrinter *printer, const JobHoldUntil jobHold = NoHold, QTime holdUntilTime = QTime());
105 static void setJobBilling(QPrinter *printer, const QString &jobBilling = QString());
106 static void setJobPriority(QPrinter *printer, int priority = 50);
107 static void setBannerPages(QPrinter *printer, const BannerPage startBannerPage, const BannerPage endBannerPage);
108 static void setPageSet(QPrinter *printer, const PageSet pageSet);
109 static void setPagesPerSheetLayout(QPrinter *printer, const PagesPerSheet pagesPerSheet,
110 const PagesPerSheetLayout pagesPerSheetLayout);
111 static void setPageRange(QPrinter *printer, int pageFrom, int pageTo);
112 static void setPageRange(QPrinter *printer, const QString &pageRange);
113
115 {
116 JobSheets(BannerPage s = NoBanner, BannerPage e = NoBanner)
117 : startBannerPage(s), endBannerPage(e) {}
118
121 };
122 static JobSheets parseJobSheets(const QString &jobSheets);
123
125 {
127 : jobHold(jh), time(t) {}
128
131 };
132 static JobHoldUntilWithTime parseJobHoldUntil(const QString &jobHoldUntil);
133
134 static ppd_option_t *findPpdOption(const char *optionName, QPrintDevice *printDevice);
135};
141
143
145 QCUPSSupport__JobHoldUntil, Q_PRINTSUPPORT_EXPORT)
147 QCUPSSupport__BannerPage, Q_PRINTSUPPORT_EXPORT)
148QT_DECL_METATYPE_EXTERN_TAGGED(QCUPSSupport::PageSet, QCUPSSupport__PageSet, Q_PRINTSUPPORT_EXPORT)
150 QCUPSSupport__PagesPerSheetLayout, Q_PRINTSUPPORT_EXPORT)
152 QCUPSSupport__PagesPerSheet, Q_PRINTSUPPORT_EXPORT)
153
154#endif
@ NinePagesPerSheet
Definition qcups_p.h:84
@ FourPagesPerSheet
Definition qcups_p.h:82
@ TwoPagesPerSheet
Definition qcups_p.h:81
@ SixPagesPerSheet
Definition qcups_p.h:83
PagesPerSheetLayout
Definition qcups_p.h:89
@ BottomToTopLeftToRight
Definition qcups_p.h:94
@ LeftToRightBottomToTop
Definition qcups_p.h:91
@ BottomToTopRightToLeft
Definition qcups_p.h:95
@ TopToBottomLeftToRight
Definition qcups_p.h:96
@ RightToLeftTopToBottom
Definition qcups_p.h:92
@ RightToLeftBottomToTop
Definition qcups_p.h:93
static void setCupsOption(QPrinter *printer, const QString &option, const QString &value)
\reentrant
Definition qprinter.h:28
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore \reentrant
Definition qdatetime.h:215
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT)
Definition qmetatype.h:1376
GLdouble s
[6]
Definition qopenglext.h:235
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint GLenum option
#define QT_REQUIRE_CONFIG(feature)
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
JobHoldUntilWithTime(JobHoldUntil jh=NoHold, QTime t=QTime())
Definition qcups_p.h:126
BannerPage startBannerPage
Definition qcups_p.h:119
BannerPage endBannerPage
Definition qcups_p.h:120
JobSheets(BannerPage s=NoBanner, BannerPage e=NoBanner)
Definition qcups_p.h:116