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