1 /*
2     SPDX-FileCopyrightText: 2010 Daniel Nicoletti <dantti12@gmail.com>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef GENERIC_PAGE_H
8 #define GENERIC_PAGE_H
9 
10 #include <QWidget>
11 #include <QHash>
12 #include <QVariant>
13 
14 #define ADDING_PRINTER         QLatin1String("add-new-printer")
15 #define PPD_NAME               QLatin1String("ppd-name")
16 #define FILENAME               QLatin1String("filename")
17 
18 class GenericPage : public QWidget
19 {
20     Q_OBJECT
21 public:
22     explicit GenericPage(QWidget *parent = nullptr);
canProceed()23     virtual bool canProceed() const { return true; }
isValid()24     virtual bool isValid() const { return true; }
isWorking()25     virtual bool isWorking() const { return m_working; }
26     virtual void setValues(const QVariantHash &args);
27     virtual QVariantHash values() const;
28 
finishClicked()29     virtual bool finishClicked() { return false; }
30 
31 signals:
32     void allowProceed(bool allow);
33     void proceed();
34     void startWorking();
35     void stopWorking();
36 
37 protected slots:
38     void working();
39     void notWorking();
40 
41 protected:
42     QVariantHash m_args;
43     int m_working;
44 };
45 
46 #endif
47