1 #ifndef _PAGES_H_ 2 #define _PAGES_H_ 3 /* 4 Bacula(R) - The Network Backup Solution 5 6 Copyright (C) 2000-2020 Kern Sibbald 7 8 The original author of Bacula is Kern Sibbald, with contributions 9 from many others, a complete list can be found in the file AUTHORS. 10 11 You may use this file and others of this release according to the 12 license defined in the LICENSE file, which includes the Affero General 13 Public License, v3.0 ("AGPLv3") and some additional permissions and 14 terms pursuant to its AGPLv3 Section 7. 15 16 This notice must be preserved when any source code is 17 conveyed and/or propagated. 18 19 Bacula(R) is a registered trademark of Kern Sibbald. 20 */ 21 /* 22 * Dirk Bartley, March 2007 23 */ 24 25 #include <QtGlobal> 26 #if QT_VERSION >= 0x050000 27 #include <QtWidgets> 28 #else 29 #include <QtGui> 30 #endif 31 #include <QList> 32 33 /* 34 * The Pages Class 35 * 36 * This class is inherited by all widget windows which are on the stack 37 * It is for the purpose of having a consistent set of functions and properties 38 * in all of the subclasses to accomplish tasks such as pulling a window out 39 * of or into the stack. It also provides virtual functions called 40 * from in mainwin so that subclasses can contain functions to allow them 41 * to populate the screens at the time of first viewing, (when selected) as 42 * opposed to the first creation of the console connection. The 43 * console is not connected until after the page selector tree has been 44 * populated. 45 */ 46 47 class Console; 48 49 class Pages : public QWidget 50 { 51 Q_OBJECT 52 53 public: 54 /* methods */ 55 Pages(); 56 void dockPage(); 57 void undockPage(); 58 void hidePage(); 59 void togglePageDocking(); 60 bool isDocked(); 61 bool isOnceDocked(); 62 bool isCloseable(); 63 virtual void PgSeltreeWidgetClicked(); 64 virtual void currentStackItem(); 65 void closeStackPage(); console()66 Console *console() { return m_console; }; 67 void setCurrent(); 68 void setContextMenuDockText(); 69 void setTreeWidgetItemDockColor(); 70 void consoleCommand(QString &); 71 void consoleCommand(QString &, bool setCurrent); 72 void consoleCommand(QString &, int conn, bool setCurrent=true, bool notify=true); name()73 QString &name() { return m_name; }; 74 void getVolumeList(QStringList &); 75 void getStatusList(QStringList &); 76 void firstUseDock(); 77 78 /* members */ 79 QTabWidget *m_parent; 80 QList<QAction*> m_contextActions; 81 82 83 public slots: 84 /* closeEvent is a virtual function inherited from QWidget */ 85 virtual void closeEvent(QCloseEvent* event); 86 87 protected: 88 /* methods */ 89 void pgInitialize(); 90 void pgInitialize(const QString &); 91 void pgInitialize(const QString &, QTreeWidgetItem *); 92 virtual void treeWidgetName(QString &); 93 virtual void changeEvent(QEvent *event); 94 void setConsoleCurrent(); 95 void setTitle(); 96 97 /* members */ 98 bool m_closeable; 99 bool m_docked; 100 bool m_onceDocked; 101 bool m_dockOnFirstUse; 102 Console *m_console; 103 QString m_name; 104 }; 105 106 #endif /* _PAGES_H_ */ 107