]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/pages.h
a7eacf7422a41d1a5dce28ed6a5875f676267457
[bacula/bacula] / bacula / src / qt-console / pages.h
1 #ifndef _PAGES_H_
2 #define _PAGES_H_
3 /*
4    Bacula(R) - The Network Backup Solution
5
6    Copyright (C) 2000-2017 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 #if QT_VERSION >= 0x050000
26 #include <QtWidgets>
27 #else
28 #include <QtGui>
29 #endif
30 #include <QList>
31
32 /*
33  *  The Pages Class
34  *
35  *  This class is inherited by all widget windows which are on the stack
36  *  It is for the purpose of having a consistent set of functions and properties
37  *  in all of the subclasses to accomplish tasks such as pulling a window out
38  *  of or into the stack.  It also provides virtual functions called
39  *  from in mainwin so that subclasses can contain functions to allow them
40  *  to populate the screens at the time of first viewing, (when selected) as
41  *  opposed to  the first creation of the console connection.  The 
42  *  console is not connected until after the page selector tree has been
43  *  populated.
44  */
45
46 class Console;
47
48 class Pages : public QWidget
49 {
50    Q_OBJECT
51
52 public:
53    /* methods */
54    Pages();
55    void dockPage();
56    void undockPage();
57    void hidePage();
58    void togglePageDocking();
59    bool isDocked();
60    bool isOnceDocked();
61    bool isCloseable();
62    virtual void PgSeltreeWidgetClicked();
63    virtual void currentStackItem();
64    void closeStackPage();
65    Console *console() { return m_console; };
66    void setCurrent();
67    void setContextMenuDockText();
68    void setTreeWidgetItemDockColor();
69    void consoleCommand(QString &);
70    void consoleCommand(QString &, bool setCurrent);
71    void consoleCommand(QString &, int conn, bool setCurrent=true, bool notify=true);
72    QString &name() { return m_name; };
73    void getVolumeList(QStringList &);
74    void getStatusList(QStringList &);
75    void firstUseDock();
76
77    /* members */
78    QTabWidget *m_parent;
79    QList<QAction*> m_contextActions;
80
81
82 public slots:
83    /* closeEvent is a virtual function inherited from QWidget */
84    virtual void closeEvent(QCloseEvent* event);
85
86 protected:
87    /* methods */
88    void pgInitialize();
89    void pgInitialize(const QString &);
90    void pgInitialize(const QString &, QTreeWidgetItem *);
91    virtual void treeWidgetName(QString &);
92    virtual void changeEvent(QEvent *event);
93    void setConsoleCurrent();
94    void setTitle();
95
96    /* members */
97    bool m_closeable;
98    bool m_docked;
99    bool m_onceDocked;
100    bool m_dockOnFirstUse;
101    Console *m_console;
102    QString m_name;
103 };
104
105 #endif /* _PAGES_H_ */