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