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