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
qprintdevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2014 John Layt <jlayt@kde.org>
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 QPRINTDEVICE_H
6#define QPRINTDEVICE_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 for the convenience
13// of internal files. This header file may change from version to version
14// without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
20#include "private/qprint_p.h"
21
22#include <QtCore/qsharedpointer.h>
23#include <QtCore/qvariant.h>
24#include <QtGui/qpagelayout.h>
25
26QT_BEGIN_NAMESPACE
27
28#ifndef QT_NO_PRINTER
29
30class QPlatformPrintDevice;
31class QMarginsF;
32class QMimeType;
33class QDebug;
34
35class Q_PRINTSUPPORT_EXPORT QPrintDevice
36{
37public:
38
39 QPrintDevice();
40 QPrintDevice(const QString & id);
41 QPrintDevice(const QPrintDevice &other);
42 ~QPrintDevice();
43
44 QPrintDevice &operator=(const QPrintDevice &other);
45 QPrintDevice &operator=(QPrintDevice &&other) { swap(other); return *this; }
46
47 void swap(QPrintDevice &other) { d.swap(other.d); }
48
49 bool operator==(const QPrintDevice &other) const;
50
51 QString id() const;
52 QString name() const;
53 QString location() const;
54 QString makeAndModel() const;
55
56 bool isValid() const;
57 bool isDefault() const;
58 bool isRemote() const;
59
60 QPrint::DeviceState state() const;
61
62 bool isValidPageLayout(const QPageLayout &layout, int resolution) const;
63
64 bool supportsMultipleCopies() const;
65 bool supportsCollateCopies() const;
66
67 QPageSize defaultPageSize() const;
68 QList<QPageSize> supportedPageSizes() const;
69
70 QPageSize supportedPageSize(const QPageSize &pageSize) const;
71 QPageSize supportedPageSize(QPageSize::PageSizeId pageSizeId) const;
72 QPageSize supportedPageSize(const QString &pageName) const;
73 QPageSize supportedPageSize(const QSize &pointSize) const;
74 QPageSize supportedPageSize(const QSizeF &size, QPageSize::Unit units = QPageSize::Point) const;
75
76 bool supportsCustomPageSizes() const;
77
78 QSize minimumPhysicalPageSize() const;
79 QSize maximumPhysicalPageSize() const;
80
81 QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation, int resolution) const;
82
83 int defaultResolution() const;
84 QList<int> supportedResolutions() const;
85
86 QPrint::InputSlot defaultInputSlot() const;
87 QList<QPrint::InputSlot> supportedInputSlots() const;
88
89 QPrint::OutputBin defaultOutputBin() const;
90 QList<QPrint::OutputBin> supportedOutputBins() const;
91
92 QPrint::DuplexMode defaultDuplexMode() const;
93 QList<QPrint::DuplexMode> supportedDuplexModes() const;
94
95 QPrint::ColorMode defaultColorMode() const;
96 QList<QPrint::ColorMode> supportedColorModes() const;
97
98 enum PrintDevicePropertyKey {
99 PDPK_CustomBase = 0xff00
100 };
101
102 QVariant property(PrintDevicePropertyKey key, const QVariant &params = QVariant()) const;
103 bool setProperty(PrintDevicePropertyKey key, const QVariant &value);
104 bool isFeatureAvailable(PrintDevicePropertyKey key, const QVariant &params) const;
105
106#if QT_CONFIG(mimetype)
107 QList<QMimeType> supportedMimeTypes() const;
108#endif
109
110# ifndef QT_NO_DEBUG_STREAM
111 void format(QDebug debug) const;
112# endif
113
114private:
115 friend class QPlatformPrinterSupport;
116 friend class QPlatformPrintDevice;
117 QPrintDevice(QPlatformPrintDevice *dd);
118 QSharedPointer<QPlatformPrintDevice> d;
119};
120
122
123# ifndef QT_NO_DEBUG_STREAM
124Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrintDevice &);
125# endif
126#endif // QT_NO_PRINTER
127
128QT_END_NAMESPACE
129
130#endif // QPLATFORMPRINTDEVICE_H
\inmodule QtCore
Definition qmargins.h:304
Combined button and popup list for selecting options.
static QCUPSSupport::BannerPage stringToBannerPage(const QString &bannerPage)
Definition qcups.cpp:182
static QString bannerPageToString(const QCUPSSupport::BannerPage bannerPage)
Definition qcups.cpp:168
static QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold, QTime holdUntilTime)
Definition qcups.cpp:63
#define PDPK_PpdFile
Definition qcups_p.h:38
QT_REQUIRE_CONFIG(cups)
#define PPK_CupsOptions
Definition qcups_p.h:36
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2618