]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/pages.h
Add feature in pages to have a console command that does not set the console
[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-2007 Free Software Foundation Europe e.V.
7
8    The main author of Bacula is Kern Sibbald, with contributions from
9    many others, a complete list can be found in the file AUTHORS.
10    This program is Free Software; you can redistribute it and/or
11    modify it under the terms of version two of the GNU General Public
12    License as published by the Free Software Foundation and included
13    in the file LICENSE.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    Bacula® is a registered trademark of Kern Sibbald.
26    The licensor of Bacula is the Free Software Foundation Europe
27    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
28    Switzerland, email:ftf@fsfeurope.org.
29 */
30 /*
31  *   Version $Id$
32  *
33  *   Dirk Bartley, March 2007
34  */
35
36 #include <QtGui>
37 #include <QList>
38
39 /*
40  *  The Pages Class
41  *
42  *  This class is inherited by all widget windows which are on the stack
43  *  It is for the purpose of having a consistent set of functions and properties
44  *  in all of the subclasses to accomplish tasks such as pulling a window out
45  *  of or into the stack.  It also provides virtual functions called
46  *  from in mainwin so that subclasses can contain functions to allow them
47  *  to populate the screens at the time of first viewing, (when selected) as
48  *  opposed to  the first creation of the console connection.  The 
49  *  console is not connected until after the page selector tree has been
50  *  populated.
51  */
52
53 class Console;
54
55 class Pages : public QWidget
56 {
57 public:
58    void dockPage();
59    void undockPage();
60    void togglePageDocking();
61    bool isDocked();
62    bool isCloseable();
63    QStackedWidget *m_parent;
64    QList<QAction*> m_contextActions;
65    virtual void PgSeltreeWidgetClicked();
66    virtual void currentStackItem();
67    void closeStackPage();
68    Console *console() { return m_console; };
69    void setCurrent();
70    void setContextMenuDockText();
71    void setTreeWidgetItemDockColor();
72    void consoleCommand(QString &);
73    void consoleCommand(QString &, int conn);
74    void consoleCommand(QString &, bool setCurrent);
75    void consoleCommand(QString &, int conn, bool setCurrent);
76    QString &name() { return m_name; };
77    void getVolumeList(QStringList &);
78    void getStatusList(QStringList &);
79
80 public slots:
81    /* closeEvent is a virtual function inherited from QWidget */
82    virtual void closeEvent(QCloseEvent* event);
83
84 protected:
85    void pgInitialize();
86    void pgInitialize(const QString &);
87    void pgInitialize(const QString &, QTreeWidgetItem *);
88    virtual void treeWidgetName(QString &);
89    virtual void changeEvent(QEvent *event);
90    void setConsoleCurrent();
91    void setTitle();
92    bool m_closeable;
93    bool m_docked;
94    Console *m_console;
95    QString m_name;
96 };
97
98 #endif /* _PAGES_H_ */