File indexing completed on 2025-01-05 05:09:30

0001 /*
0002     SPDX-FileCopyrightText: 2010-2012 Daniel Nicoletti <dantti12@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KCUPSPRINTER_H
0008 #define KCUPSPRINTER_H
0009 
0010 #include <QIcon>
0011 #include <QString>
0012 
0013 #include <KCupsConnection.h>
0014 #include <kcupslib_export.h>
0015 
0016 class KCUPSLIB_EXPORT KCupsPrinter
0017 {
0018     Q_ENUMS(Attribute)
0019 public:
0020     typedef enum { Idle = 3, Printing, Stopped } Status;
0021     KCupsPrinter();
0022     explicit KCupsPrinter(const QString &printer, bool isClass = false);
0023 
0024     QString name() const;
0025     bool isClass() const;
0026     bool isDefault() const;
0027     bool isShared() const;
0028     bool isAcceptingJobs() const;
0029     cups_ptype_e type() const;
0030     QString location() const;
0031     QString info() const;
0032     QString makeAndModel() const;
0033     QStringList commands() const;
0034     QStringList memberNames() const;
0035     QString deviceUri() const;
0036     QStringList errorPolicy() const;
0037     QStringList errorPolicySupported() const;
0038     QStringList opPolicy() const;
0039     QStringList opPolicySupported() const;
0040     QStringList jobSheetsDefault() const;
0041     QStringList jobSheetsSupported() const;
0042     QStringList requestingUserNameAllowed() const;
0043     QStringList requestingUserNameDenied() const;
0044     QStringList authInfoRequired() const;
0045     QString uriSupported() const;
0046 
0047     Status state() const;
0048     QString stateMsg() const;
0049     int markerChangeTime() const;
0050     QVariant argument(const QString &name) const;
0051 
0052     /**
0053      * Requires enum PrinterType to work properly
0054      *
0055      */
0056     QIcon icon() const;
0057     static QIcon icon(cups_ptype_e type);
0058     QString iconName() const;
0059     static QString iconName(cups_ptype_e type);
0060 
0061 protected:
0062     KCupsPrinter(const QVariantMap &arguments);
0063 
0064 private:
0065     friend class KCupsRequest;
0066 
0067     QString m_printer;
0068     bool m_isClass;
0069     QVariantMap m_arguments;
0070 };
0071 
0072 typedef QList<KCupsPrinter> KCupsPrinters;
0073 Q_DECLARE_METATYPE(KCupsPrinters)
0074 Q_DECLARE_METATYPE(KCupsPrinter)
0075 
0076 #endif // KCUPSPRINTER_H