File indexing completed on 2026-09-29 09:25:03
0001
0002
0003
0004
0005 #ifndef QPRINTERINFO_H
0006 #define QPRINTERINFO_H
0007
0008 #include <QtPrintSupport/qtprintsupportglobal.h>
0009 #include <QtPrintSupport/qprinter.h>
0010
0011 #include <QtCore/QList>
0012 #include <QtGui/qpagesize.h>
0013
0014 QT_BEGIN_NAMESPACE
0015
0016
0017 #ifndef QT_NO_PRINTER
0018 class QPrinterInfoPrivate;
0019 class QPrinterInfoPrivateDeleter;
0020 class QDebug;
0021 class Q_PRINTSUPPORT_EXPORT QPrinterInfo
0022 {
0023 public:
0024 QPrinterInfo();
0025 QPrinterInfo(const QPrinterInfo &other);
0026 explicit QPrinterInfo(const QPrinter &printer);
0027 ~QPrinterInfo();
0028
0029 QPrinterInfo &operator=(const QPrinterInfo &other);
0030
0031 QString printerName() const;
0032 QString description() const;
0033 QString location() const;
0034 QString makeAndModel() const;
0035
0036 bool isNull() const;
0037 bool isDefault() const;
0038 bool isRemote() const;
0039
0040 QPrinter::PrinterState state() const;
0041
0042 QList<QPageSize> supportedPageSizes() const;
0043 QPageSize defaultPageSize() const;
0044
0045 bool supportsCustomPageSizes() const;
0046
0047 QPageSize minimumPhysicalPageSize() const;
0048 QPageSize maximumPhysicalPageSize() const;
0049
0050 QList<int> supportedResolutions() const;
0051
0052 QPrinter::DuplexMode defaultDuplexMode() const;
0053 QList<QPrinter::DuplexMode> supportedDuplexModes() const;
0054
0055 QPrinter::ColorMode defaultColorMode() const;
0056 QList<QPrinter::ColorMode> supportedColorModes() const;
0057
0058 static QStringList availablePrinterNames();
0059 static QList<QPrinterInfo> availablePrinters();
0060
0061 static QString defaultPrinterName();
0062 static QPrinterInfo defaultPrinter();
0063
0064 static QPrinterInfo printerInfo(const QString &printerName);
0065
0066 private:
0067 explicit QPrinterInfo(const QString &name);
0068
0069 private:
0070 friend class QPlatformPrinterSupport;
0071 # ifndef QT_NO_DEBUG_STREAM
0072 friend Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrinterInfo &);
0073 # endif
0074 Q_DECLARE_PRIVATE(QPrinterInfo)
0075 QScopedPointer<QPrinterInfoPrivate, QPrinterInfoPrivateDeleter> d_ptr;
0076 };
0077
0078 #endif
0079
0080 QT_END_NAMESPACE
0081
0082 #endif