File indexing completed on 2022-09-27 16:37:10

0001 /*
0002     SPDX-FileCopyrightText: 2010 Daniel Nicoletti <dantti12@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef GENERIC_PAGE_H
0008 #define GENERIC_PAGE_H
0009 
0010 #include <QWidget>
0011 #include <QHash>
0012 #include <QVariant>
0013 
0014 #define ADDING_PRINTER         QLatin1String("add-new-printer")
0015 #define PPD_NAME               QLatin1String("ppd-name")
0016 #define FILENAME               QLatin1String("filename")
0017 
0018 class GenericPage : public QWidget
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit GenericPage(QWidget *parent = nullptr);
0023     virtual bool canProceed() const { return true; }
0024     virtual bool isValid() const { return true; }
0025     virtual bool isWorking() const { return m_working; }
0026     virtual void setValues(const QVariantHash &args);
0027     virtual QVariantHash values() const;
0028 
0029     virtual bool finishClicked() { return false; }
0030 
0031 signals:
0032     void allowProceed(bool allow);
0033     void proceed();
0034     void startWorking();
0035     void stopWorking();
0036 
0037 protected slots:
0038     void working();
0039     void notWorking();
0040 
0041 protected:
0042     QVariantHash m_args;
0043     int m_working;
0044 };
0045 
0046 #endif