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

source code of qtbase/src/printsupport/kernel/qprinterinfo.h