1 /* 2 SPDX-FileCopyrightText: 2010 Daniel Nicoletti <dantti12@gmail.com> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #ifndef PRINTER_DESCRIPTION_H 8 #define PRINTER_DESCRIPTION_H 9 10 #include <QWidget> 11 12 #include <KCupsRequest.h> 13 14 15 namespace Ui { 16 class PrinterDescription; 17 } 18 class PrinterDescription : public QWidget 19 { 20 Q_OBJECT 21 public: 22 explicit PrinterDescription(QWidget *parent = nullptr); 23 ~PrinterDescription() override; 24 25 void setPrinterIcon(const QIcon &icon); 26 void setDestName(const QString &name, const QString &description, bool isClass, bool singlePrinter); 27 void setDestStatus(const QString &status); 28 void setLocation(const QString &location); 29 void setKind(const QString &kind); 30 void setIsDefault(bool isDefault); 31 void setIsShared(bool isShared); 32 void setAcceptingJobs(bool accepting); 33 void setCommands(const QStringList &commands); 34 35 void setMarkers(const QVariantHash &data); 36 37 QString destName() const; 38 39 public slots: 40 void enableShareCheckBox(bool enable); 41 42 signals: 43 void updateNeeded(); 44 45 private slots: 46 void on_configurePB_clicked(); 47 void on_openQueuePB_clicked(); 48 void on_defaultCB_clicked(); 49 void on_sharedCB_clicked(); 50 void on_rejectPrintJobsCB_clicked(); 51 52 void on_actionPrintTestPage_triggered(bool checked); 53 void on_actionCleanPrintHeads_triggered(bool checked); 54 void on_actionPrintSelfTestPage_triggered(bool checked); 55 56 void requestFinished(KCupsRequest *request); 57 58 private: 59 Ui::PrinterDescription *ui; 60 QString m_destName; 61 bool m_isClass = false; 62 bool m_isShared; 63 bool m_globalShared = false; 64 QStringList m_commands; 65 QPixmap m_printerIcon; 66 int m_markerChangeTime = 0; 67 QVariantHash m_markerData; 68 int m_layoutEnd; 69 }; 70 71 #endif 72