File indexing completed on 2025-01-19 05:06:24

0001 /*
0002     SPDX-FileCopyrightText: 2010-2018 Daniel Nicoletti <dantti12@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef NEW_PRINTER_NOTIFICATION_H
0008 #define NEW_PRINTER_NOTIFICATION_H
0009 
0010 #include <QDBusContext>
0011 #include <QObject>
0012 
0013 class KNotification;
0014 class NewPrinterNotification : public QObject, protected QDBusContext
0015 {
0016     Q_OBJECT
0017     Q_CLASSINFO("D-Bus Interface", "com.redhat.NewPrinterNotification")
0018 public:
0019     explicit NewPrinterNotification(QObject *parent);
0020     ~NewPrinterNotification() override;
0021 
0022 public:
0023     void GetReady();
0024     void NewPrinter(int status, const QString &name, const QString &make, const QString &model, const QString &des, const QString &cmd);
0025 
0026 private:
0027     bool registerService();
0028     void configurePrinter();
0029     void printTestPage();
0030     void findDriver();
0031 
0032     void setupPrinterNotification(KNotification *notify, const QString &make, const QString &model, const QString &description, const QString &arg);
0033     void getMissingExecutables(KNotification *notify, int status, const QString &name, const QString &ppdFileName);
0034     void checkPrinterCurrentDriver(KNotification *notify, const QString &name);
0035     void printerReadyNotification(KNotification *notify, const QString &name);
0036 };
0037 
0038 #endif // NEW_PRINTER_NOTIFICATION_H