4 Bacula(R) - The Network Backup Solution
6 Copyright (C) 2000-2015 Kern Sibbald
7 Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
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.
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.
17 This notice must be preserved when any source code is
18 conveyed and/or propagated.
20 Bacula(R) is a registered trademark of Kern Sibbald.
23 * Kern Sibbald, January 2007
28 #include "ui_console.h"
29 #include "bcomm/dircomm.h"
31 #ifndef MAX_NAME_LENGTH
32 #define MAX_NAME_LENGTH 128
36 * Structure for obtaining the defaults for a job
41 QString messages_name;
57 class Console : public Pages, public Ui::ConsoleForm
63 Console(QTabWidget *parent);
67 void discardToPrompt(int conn);
68 int write(int conn, const char *msg);
69 int write(int conn, QString msg);
70 int notifyOff(); // enables/disables socket notification - returns the previous state
71 bool notify(int conn, bool enable); // enables/disables socket notification - returns the previous state
72 bool is_notify_enabled(int conn) const;
73 bool getDirComm(int &conn);
74 bool findDirComm(int &conn);
75 void displayToPrompt(int conn);
76 QString returnFromPrompt(int conn);
78 bool dir_cmd(int conn, const char *cmd, QStringList &results);
79 bool dir_cmd(const char *cmd, QStringList &results);
80 bool dir_cmd(QString &cmd, QStringList &results);
81 bool sql_cmd(const char *cmd, QStringList &results);
82 bool sql_cmd(QString &cmd, QStringList &results);
83 bool sql_cmd(int &conn, QString &cmd, QStringList &results);
84 bool sql_cmd(int &conn, const char *cmd, QStringList &results, bool donotify);
85 int write_dir(const char *buf);
86 int write_dir(const char *buf, bool dowait);
87 void write_dir(int conn, const char *buf);
88 void write_dir(int conn, const char *buf, bool dowait);
89 void getDirResName(QString &);
90 void setDirRes(DIRRES *dir);
93 void setDirectorTreeItem(QTreeWidgetItem *);
95 bool is_messagesPending() { return m_messages_pending; };
97 bool is_connected(int conn);
98 QTreeWidgetItem *directorTreeItem() { return m_directorTreeItem; };
100 void display_text(const char *buf);
101 void display_text(const QString buf);
102 void display_textf(const char *fmt, ...);
103 void display_html(const QString buf);
104 bool get_job_defaults(struct job_defaults &);
105 bool get_job_defaults(int &conn, struct job_defaults &);
106 const QFont get_font();
107 void beginNewCommand(int conn);
108 void populateLists(bool forcenew);
111 bool get_job_defaults(int &conn, struct job_defaults &, bool donotify);
112 void update_cursor(void);
114 bool is_connectedGui();
115 bool newDirComm(int &conn);
116 void populateLists(int conn);
119 QStringList job_list;
120 QStringList restore_list;
121 QStringList client_list;
122 QStringList fileset_list;
123 QStringList messages_list;
124 QStringList pool_list;
125 QStringList storage_list;
126 QStringList type_list;
127 QStringList level_list;
128 QStringList volstatus_list;
129 QStringList mediatype_list;
130 QStringList location_list;
134 void status_dir(void);
137 void poll_messages(void);
139 void consoleReload();
142 DIRRES *m_dir; /* so various pages can reference it */
143 bool m_warningPrevent;
146 QTextEdit *m_textEdit;
147 QTextCursor *m_cursor;
148 QTreeWidgetItem *m_directorTreeItem;
149 bool m_messages_pending;
151 bool messagesPending(bool pend);
153 QHash<int, DirComm*> m_dircommHash;
154 int m_dircommCounter;
157 #endif /* _CONSOLE_H_ */