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
qwindowsprintdevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2014 John Layt <jlayt@kde.org>
2// Copyright (C) 2020 The Qt Company Ltd.
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 QWINDOWSPRINTDEVICE_H
6#define QWINDOWSPRINTDEVICE_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 <qpa/qplatformprintdevice.h>
20
21#include <QtPrintSupport/qtprintsupportglobal.h>
22#include <QtCore/qt_windows.h>
23#include <QtCore/private/qglobal_p.h>
24
26
27class Q_PRINTSUPPORT_EXPORT QWindowsPrinterInfo
28{
29public:
31 {
32 // We only need to check if these are the same for matching up
33 return m_id == other.m_id && m_name == other.m_name &&
34 m_location == other.m_location &&
35 m_makeAndModel == other.m_makeAndModel &&
36 m_isRemote == other.m_isRemote;
37 }
42 QList<QPageSize> m_pageSizes;
43 QList<int> m_resolutions;
44 QList<QPrint::InputSlot> m_inputSlots;
45 QList<QPrint::OutputBin> m_outputBins;
46 QList<QPrint::DuplexMode> m_duplexModes;
47 QList<QPrint::ColorMode> m_colorModes;
50 bool m_isRemote = false;
51 bool m_havePageSizes = false;
52 bool m_haveResolutions = false;
53 bool m_haveCopies = false;
54 bool m_supportsMultipleCopies = false;
55 bool m_supportsCollateCopies = false;
56 bool m_haveMinMaxPageSizes = false;
57 bool m_supportsCustomPageSizes = false;
58 bool m_haveInputSlots = false;
59 bool m_haveOutputBins = false;
60 bool m_haveDuplexModes = false;
61 bool m_haveColorModes = false;
62};
63
64class Q_PRINTSUPPORT_EXPORT QWindowsPrintDevice : public QPlatformPrintDevice
65{
66public:
68 explicit QWindowsPrintDevice(const QString &id);
69 virtual ~QWindowsPrintDevice();
70
71 bool isValid() const override;
72 bool isDefault() const override;
73
74 QPrint::DeviceState state() const override;
75
76 QPageSize defaultPageSize() const override;
77
78 QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation,
79 int resolution) const override;
80
81 int defaultResolution() const override;
82
83 QPrint::InputSlot defaultInputSlot() const override;
84
85 QPrint::DuplexMode defaultDuplexMode() const override;
86
87 QPrint::ColorMode defaultColorMode() const override;
88
89 static QStringList availablePrintDeviceIds();
90 static QString defaultPrintDeviceId();
91
92 bool supportsCollateCopies() const override;
93 bool supportsMultipleCopies() const override;
94 bool supportsCustomPageSizes() const override;
95 QSize minimumPhysicalPageSize() const override;
96 QSize maximumPhysicalPageSize() const override;
97
98protected:
99 void loadPageSizes() const override;
100 void loadResolutions() const override;
101 void loadInputSlots() const override;
102 void loadOutputBins() const override;
103 void loadDuplexModes() const override;
104 void loadColorModes() const override;
105 void loadCopiesSupport() const;
106 void loadMinMaxPageSizes() const;
107
108private:
109 LPCWSTR wcharId() const { return reinterpret_cast<LPCWSTR>(m_id.utf16()); }
110
111 HANDLE m_hPrinter;
112 mutable bool m_haveCopies;
113 mutable bool m_haveMinMaxPageSizes;
114 int m_infoIndex;
115};
116
118
119#endif // QWINDOWSPRINTDEVICE_H
\inmodule QtCore
Definition qmargins.h:270
Orientation
This enum type defines the page orientation.
Definition qpagelayout.h:33
\inmodule QtGui
Definition qpagesize.h:22
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QList< QPrint::OutputBin > m_outputBins
QList< QPrint::DuplexMode > m_duplexModes
QList< QPrint::InputSlot > m_inputSlots
QList< QPrint::ColorMode > m_colorModes
QList< QPageSize > m_pageSizes
bool operator==(const QWindowsPrinterInfo &other) const
else opt state
[0]
ColorMode
Definition qprint_p.h:72
DuplexMode
Definition qprint_p.h:64
DeviceState
Definition qprint_p.h:56
Combined button and popup list for selecting options.
QSharedPointer< T > other(t)
[5]