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 <QtGui/qpagelayout.h>
24
25QT_BEGIN_NAMESPACE
26
27#ifndef QT_NO_PRINTER
28
29class QPlatformPrintDevice;
30class QMarginsF;
31class QMimeType;
32class QDebug;
33
34class Q_PRINTSUPPORT_EXPORT QPrintDevice
35{
36public:
37
38 QPrintDevice();
39 QPrintDevice(const QString & id);
40 QPrintDevice(const QPrintDevice &other);
41 ~QPrintDevice();
42
43 QPrintDevice &operator=(const QPrintDevice &other);
44 QPrintDevice &operator=(QPrintDevice &&other) { swap(other); return *this; }
45
46 void swap(QPrintDevice &other) { d.swap(other.d); }
47
48 bool operator==(const QPrintDevice &other) const;
49
50 QString id() const;
51 QString name() const;
52 QString location() const;
53 QString makeAndModel() const;
54
55 bool isValid() const;
56 bool isDefault() const;
57 bool isRemote() const;
58
59 QPrint::DeviceState state() const;
60
61 bool isValidPageLayout(const QPageLayout &layout, int resolution) const;
62
63 bool supportsMultipleCopies() const;
64 bool supportsCollateCopies() const;
65
66 QPageSize defaultPageSize() const;
67 QList<QPageSize> supportedPageSizes() const;
68
69 QPageSize supportedPageSize(const QPageSize &pageSize) const;
70 QPageSize supportedPageSize(QPageSize::PageSizeId pageSizeId) const;
71 QPageSize supportedPageSize(const QString &pageName) const;
72 QPageSize supportedPageSize(const QSize &pointSize) const;
73 QPageSize supportedPageSize(const QSizeF &size, QPageSize::Unit units = QPageSize::Point) const;
74
75 bool supportsCustomPageSizes() const;
76
77 QSize minimumPhysicalPageSize() const;
78 QSize maximumPhysicalPageSize() const;
79
80 QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation, int resolution) const;
81
82 int defaultResolution() const;
83 QList<int> supportedResolutions() const;
84
85 QPrint::InputSlot defaultInputSlot() const;
86 QList<QPrint::InputSlot> supportedInputSlots() const;
87
88 QPrint::OutputBin defaultOutputBin() const;
89 QList<QPrint::OutputBin> supportedOutputBins() const;
90
91 QPrint::DuplexMode defaultDuplexMode() const;
92 QList<QPrint::DuplexMode> supportedDuplexModes() const;
93
94 QPrint::ColorMode defaultColorMode() const;
95 QList<QPrint::ColorMode> supportedColorModes() const;
96
97 enum PrintDevicePropertyKey {
98 PDPK_CustomBase = 0xff00
99 };
100
101 QVariant property(PrintDevicePropertyKey key) const;
102 bool setProperty(PrintDevicePropertyKey key, const QVariant &value);
103 bool isFeatureAvailable(PrintDevicePropertyKey key, const QVariant &params) const;
104
105#if QT_CONFIG(mimetype)
106 QList<QMimeType> supportedMimeTypes() const;
107#endif
108
109# ifndef QT_NO_DEBUG_STREAM
110 void format(QDebug debug) const;
111# endif
112
113private:
114 friend class QPlatformPrinterSupport;
115 friend class QPlatformPrintDevice;
116 QPrintDevice(QPlatformPrintDevice *dd);
117 QSharedPointer<QPlatformPrintDevice> d;
118};
119
121
122# ifndef QT_NO_DEBUG_STREAM
123Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrintDevice &);
124# endif
125#endif // QT_NO_PRINTER
126
127QT_END_NAMESPACE
128
129#endif // QPLATFORMPRINTDEVICE_H
\inmodule QtCore
Definition qmargins.h:303
static QCUPSSupport::BannerPage stringToBannerPage(const QString &bannerPage)
Definition qcups.cpp:181
static QString bannerPageToString(const QCUPSSupport::BannerPage bannerPage)
Definition qcups.cpp:167
static QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold, QTime holdUntilTime)
Definition qcups.cpp:62
#define PDPK_PpdFile
Definition qcups_p.h:37
QT_REQUIRE_CONFIG(cups)
#define PPK_CupsOptions
Definition qcups_p.h:35
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568