4 Bacula(R) - The Network Backup Solution
6 Copyright (C) 2000-2016 Kern Sibbald
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.
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.
16 This notice must be preserved when any source code is
17 conveyed and/or propagated.
19 Bacula(R) is a registered trademark of Kern Sibbald.
22 * Kern Sibbald, January 2007
25 #if QT_VERSION >= 0x050000
31 #include "ui_console.h"
32 #include "bcomm/dircomm.h"
34 #ifndef MAX_NAME_LENGTH
35 #define MAX_NAME_LENGTH 128
39 * Structure for obtaining the defaults for a job
44 QString messages_name;
60 class Console : public Pages, public Ui::ConsoleForm
66 Console(QTabWidget *parent);
70 void discardToPrompt(int conn);
71 int write(int conn, const char *msg);
72 int write(int conn, QString msg);
73 int notifyOff(); // enables/disables socket notification - returns the previous state
74 bool notify(int conn, bool enable); // enables/disables socket notification - returns the previous state
75 bool is_notify_enabled(int conn) const;
76 bool getDirComm(int &conn);
77 bool findDirComm(int &conn);
78 void displayToPrompt(int conn);
79 QString returnFromPrompt(int conn);
81 bool dir_cmd(int conn, const char *cmd, QStringList &results);
82 bool dir_cmd(const char *cmd, QStringList &results);
83 bool dir_cmd(QString &cmd, QStringList &results);
84 bool sql_cmd(const char *cmd, QStringList &results);
85 bool sql_cmd(QString &cmd, QStringList &results);
86 bool sql_cmd(int &conn, QString &cmd, QStringList &results);
87 bool sql_cmd(int &conn, const char *cmd, QStringList &results, bool donotify);
88 int write_dir(const char *buf);
89 int write_dir(const char *buf, bool dowait);
90 void write_dir(int conn, const char *buf);
91 void write_dir(int conn, const char *buf, bool dowait);
92 void getDirResName(QString &);
93 void setDirRes(DIRRES *dir);
96 void setDirectorTreeItem(QTreeWidgetItem *);
98 bool is_messagesPending() { return m_messages_pending; };
100 bool is_connected(int conn);
101 QTreeWidgetItem *directorTreeItem() { return m_directorTreeItem; };
103 void display_text(const char *buf);
104 void display_text(const QString buf);
105 void display_textf(const char *fmt, ...);
106 void display_html(const QString buf);
107 bool get_job_defaults(struct job_defaults &);
108 bool get_job_defaults(int &conn, struct job_defaults &);
109 const QFont get_font();
110 void beginNewCommand(int conn);
111 void populateLists(bool forcenew);
114 bool get_job_defaults(int &conn, struct job_defaults &, bool donotify);
115 void update_cursor(void);
117 bool is_connectedGui();
118 bool newDirComm(int &conn);
119 void populateLists(int conn);
122 QStringList job_list;
123 QStringList restore_list;
124 QStringList client_list;
125 QStringList fileset_list;
126 QStringList messages_list;
127 QStringList pool_list;
128 QStringList storage_list;
129 QStringList type_list;
130 QStringList level_list;
131 QStringList volstatus_list;
132 QStringList mediatype_list;
133 QStringList location_list;
137 void status_dir(void);
140 void poll_messages(void);
142 void consoleReload();
145 DIRRES *m_dir; /* so various pages can reference it */
146 bool m_warningPrevent;
149 QTextEdit *m_textEdit;
150 QTextCursor *m_cursor;
151 QTreeWidgetItem *m_directorTreeItem;
152 bool m_messages_pending;
154 bool messagesPending(bool pend);
156 QHash<int, DirComm*> m_dircommHash;
157 int m_dircommCounter;
160 #endif /* _CONSOLE_H_ */