4 Bacula® - The Network Backup Solution
6 Copyright (C) 2007-2008 Free Software Foundation Europe e.V.
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
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.
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
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.
33 * Kern Sibbald, January 2007
38 #include "ui_console.h"
39 #include "bcomm/dircomm.h"
41 #ifndef MAX_NAME_LENGTH
42 #define MAX_NAME_LENGTH 128
46 * Structure for obtaining the defaults for a job
51 QString messages_name;
67 class Console : public Pages, public Ui::ConsoleForm
73 Console(QStackedWidget *parent);
77 void discardToPrompt(int conn);
78 int write(int conn, const char *msg);
79 int write(int conn, QString msg);
80 int notifyOff(); // enables/disables socket notification - returns the previous state
81 bool notify(int conn, bool enable); // enables/disables socket notification - returns the previous state
82 bool is_notify_enabled(int conn) const;
83 bool availableDirComm(int &conn);
84 void displayToPrompt(int conn);
86 bool dir_cmd(int conn, const char *cmd, QStringList &results);
87 bool dir_cmd(const char *cmd, QStringList &results);
88 bool dir_cmd(QString &cmd, QStringList &results);
89 bool sql_cmd(const char *cmd, QStringList &results);
90 bool sql_cmd(QString &cmd, QStringList &results);
91 int write_dir(const char *buf);
92 void write_dir(int conn, const char *buf);
93 void getDirResName(QString &);
94 void setDirRes(DIRRES *dir);
97 void setDirectorTreeItem(QTreeWidgetItem *);
99 bool is_messagesPending() { return m_messages_pending; };
101 bool is_connected(int conn);
102 QTreeWidgetItem *directorTreeItem() { return m_directorTreeItem; };
104 void display_text(const char *buf);
105 void display_text(const QString buf);
106 void display_textf(const char *fmt, ...);
107 void display_html(const QString buf);
108 bool get_job_defaults(struct job_defaults &);
109 const QFont get_font();
110 void beginNewCommand(int conn);
111 void getVolumeList(QStringList &);
112 void getStatusList(QStringList &);
115 void update_cursor(void);
117 bool is_connectedGui();
118 bool newDirComm(int &conn);
121 QStringList job_list;
122 QStringList client_list;
123 QStringList fileset_list;
124 QStringList messages_list;
125 QStringList pool_list;
126 QStringList storage_list;
127 QStringList type_list;
128 QStringList level_list;
132 void status_dir(void);
135 void poll_messages(void);
137 void consoleReload();
140 DIRRES *m_dir; /* so various pages can reference it */
143 QTextEdit *m_textEdit;
144 QTextCursor *m_cursor;
145 QTreeWidgetItem *m_directorTreeItem;
146 bool m_messages_pending;
148 bool messagesPending(bool pend);
150 QHash<int, DirComm*> m_dircommHash;
151 int m_dircommCounter;
154 #endif /* _CONSOLE_H_ */