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 QPRINTERINFO_H |
5 | #define QPRINTERINFO_H |
6 | |
7 | #include <QtPrintSupport/qtprintsupportglobal.h> |
8 | #include <QtPrintSupport/qprinter.h> |
9 | |
10 | #include <QtCore/QList> |
11 | #include <QtGui/qpagesize.h> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | |
16 | #ifndef QT_NO_PRINTER |
17 | class QPrinterInfoPrivate; |
18 | class QPrinterInfoPrivateDeleter; |
19 | class QDebug; |
20 | class Q_PRINTSUPPORT_EXPORT QPrinterInfo |
21 | { |
22 | public: |
23 | QPrinterInfo(); |
24 | QPrinterInfo(const QPrinterInfo &other); |
25 | explicit QPrinterInfo(const QPrinter &printer); |
26 | ~QPrinterInfo(); |
27 | |
28 | QPrinterInfo &operator=(const QPrinterInfo &other); |
29 | |
30 | QString printerName() const; |
31 | QString description() const; |
32 | QString location() const; |
33 | QString makeAndModel() const; |
34 | |
35 | bool isNull() const; |
36 | bool isDefault() const; |
37 | bool isRemote() const; |
38 | |
39 | QPrinter::PrinterState state() const; |
40 | |
41 | QList<QPageSize> supportedPageSizes() const; |
42 | QPageSize defaultPageSize() const; |
43 | |
44 | bool supportsCustomPageSizes() const; |
45 | |
46 | QPageSize minimumPhysicalPageSize() const; |
47 | QPageSize maximumPhysicalPageSize() const; |
48 | |
49 | QList<int> supportedResolutions() const; |
50 | |
51 | QPrinter::DuplexMode defaultDuplexMode() const; |
52 | QList<QPrinter::DuplexMode> supportedDuplexModes() const; |
53 | |
54 | QPrinter::ColorMode defaultColorMode() const; |
55 | QList<QPrinter::ColorMode> supportedColorModes() const; |
56 | |
57 | static QStringList availablePrinterNames(); |
58 | static QList<QPrinterInfo> availablePrinters(); |
59 | |
60 | static QString defaultPrinterName(); |
61 | static QPrinterInfo defaultPrinter(); |
62 | |
63 | static QPrinterInfo printerInfo(const QString &printerName); |
64 | |
65 | private: |
66 | explicit QPrinterInfo(const QString &name); |
67 | |
68 | private: |
69 | friend class QPlatformPrinterSupport; |
70 | # ifndef QT_NO_DEBUG_STREAM |
71 | friend Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrinterInfo &); |
72 | # endif |
73 | Q_DECLARE_PRIVATE(QPrinterInfo) |
74 | QScopedPointer<QPrinterInfoPrivate, QPrinterInfoPrivateDeleter> d_ptr; |
75 | }; |
76 | |
77 | #endif // QT_NO_PRINTER |
78 | |
79 | QT_END_NAMESPACE |
80 | |
81 | #endif // QPRINTERINFO_H |
82 | |