Qt
6.x
The Qt SDK
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
25
QT_BEGIN_NAMESPACE
26
27
class
Q_PRINTSUPPORT_EXPORT
QWindowsPrinterInfo
28
{
29
public
:
30
bool
operator==
(
const
QWindowsPrinterInfo
&
other
)
const
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
}
38
QString
m_id
;
39
QString
m_name
;
40
QString
m_location
;
41
QString
m_makeAndModel
;
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
;
48
QSize
m_minimumPhysicalPageSize
;
49
QSize
m_maximumPhysicalPageSize
;
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
64
class
Q_PRINTSUPPORT_EXPORT
QWindowsPrintDevice
:
public
QPlatformPrintDevice
65
{
66
public
:
67
QWindowsPrintDevice
();
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
98
protected
:
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
108
private
:
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
117
QT_END_NAMESPACE
118
119
#endif
// QWINDOWSPRINTDEVICE_H
QList
Definition
qlist.h:74
QMarginsF
\inmodule QtCore
Definition
qmargins.h:274
QPageLayout::Orientation
Orientation
This enum type defines the page orientation.
Definition
qpagelayout.h:33
QPageSize
\inmodule QtGui
Definition
qpagesize.h:22
QPlatformPrintDevice
Definition
qplatformprintdevice.h:36
QSize
\inmodule QtCore
Definition
qsize.h:25
QStringList
\inmodule QtCore
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QWindowsPrintDevice
Definition
qwindowsprintdevice_p.h:65
QWindowsPrinterInfo
Definition
qwindowsprintdevice_p.h:28
QWindowsPrinterInfo::m_name
QString m_name
Definition
qwindowsprintdevice_p.h:39
QWindowsPrinterInfo::m_outputBins
QList< QPrint::OutputBin > m_outputBins
Definition
qwindowsprintdevice_p.h:45
QWindowsPrinterInfo::m_resolutions
QList< int > m_resolutions
Definition
qwindowsprintdevice_p.h:43
QWindowsPrinterInfo::m_duplexModes
QList< QPrint::DuplexMode > m_duplexModes
Definition
qwindowsprintdevice_p.h:46
QWindowsPrinterInfo::m_inputSlots
QList< QPrint::InputSlot > m_inputSlots
Definition
qwindowsprintdevice_p.h:44
QWindowsPrinterInfo::m_minimumPhysicalPageSize
QSize m_minimumPhysicalPageSize
Definition
qwindowsprintdevice_p.h:48
QWindowsPrinterInfo::m_makeAndModel
QString m_makeAndModel
Definition
qwindowsprintdevice_p.h:41
QWindowsPrinterInfo::m_colorModes
QList< QPrint::ColorMode > m_colorModes
Definition
qwindowsprintdevice_p.h:47
QWindowsPrinterInfo::m_pageSizes
QList< QPageSize > m_pageSizes
Definition
qwindowsprintdevice_p.h:42
QWindowsPrinterInfo::m_maximumPhysicalPageSize
QSize m_maximumPhysicalPageSize
Definition
qwindowsprintdevice_p.h:49
QWindowsPrinterInfo::m_location
QString m_location
Definition
qwindowsprintdevice_p.h:40
QWindowsPrinterInfo::operator==
bool operator==(const QWindowsPrinterInfo &other) const
Definition
qwindowsprintdevice_p.h:30
QWindowsPrinterInfo::m_id
QString m_id
Definition
qwindowsprintdevice_p.h:38
state
else opt state
[0]
Definition
doc_src_styles.cpp:11
QPrint::ColorMode
ColorMode
Definition
qprint_p.h:71
QPrint::DuplexMode
DuplexMode
Definition
qprint_p.h:64
QPrint::DeviceState
DeviceState
Definition
qprint_p.h:56
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
other
QSharedPointer< T > other(t)
[5]
QPrint::InputSlot
Definition
qprint_p.h:98
qtbase
src
printsupport
platform
windows
qwindowsprintdevice_p.h
Generated by
1.9.7