4 Bacula® - The Network Backup Solution
6 Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
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.
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 Bacula® is a registered trademark of Kern Sibbald.
21 * Kern Sibbald, January 2007
26 #include "ui_console.h"
27 #include "bcomm/dircomm.h"
29 #ifndef MAX_NAME_LENGTH
30 #define MAX_NAME_LENGTH 128
34 * Structure for obtaining the defaults for a job
39 QString messages_name;
55 class Console : public Pages, public Ui::ConsoleForm
61 Console(QTabWidget *parent);
65 void discardToPrompt(int conn);
66 int write(int conn, const char *msg);
67 int write(int conn, QString msg);
68 int notifyOff(); // enables/disables socket notification - returns the previous state
69 bool notify(int conn, bool enable); // enables/disables socket notification - returns the previous state
70 bool is_notify_enabled(int conn) const;
71 bool getDirComm(int &conn);
72 bool findDirComm(int &conn);
73 void displayToPrompt(int conn);
74 QString returnFromPrompt(int conn);
76 bool dir_cmd(int conn, const char *cmd, QStringList &results);
77 bool dir_cmd(const char *cmd, QStringList &results);
78 bool dir_cmd(QString &cmd, QStringList &results);
79 bool sql_cmd(const char *cmd, QStringList &results);
80 bool sql_cmd(QString &cmd, QStringList &results);
81 bool sql_cmd(int &conn, QString &cmd, QStringList &results);
82 bool sql_cmd(int &conn, const char *cmd, QStringList &results, bool donotify);
83 int write_dir(const char *buf);
84 int write_dir(const char *buf, bool dowait);
85 void write_dir(int conn, const char *buf);
86 void write_dir(int conn, const char *buf, bool dowait);
87 void getDirResName(QString &);
88 void setDirRes(DIRRES *dir);
91 void setDirectorTreeItem(QTreeWidgetItem *);
93 bool is_messagesPending() { return m_messages_pending; };
95 bool is_connected(int conn);
96 QTreeWidgetItem *directorTreeItem() { return m_directorTreeItem; };
98 void display_text(const char *buf);
99 void display_text(const QString buf);
100 void display_textf(const char *fmt, ...);
101 void display_html(const QString buf);
102 bool get_job_defaults(struct job_defaults &);
103 bool get_job_defaults(int &conn, struct job_defaults &);
104 const QFont get_font();
105 void beginNewCommand(int conn);
106 void populateLists(bool forcenew);
109 bool get_job_defaults(int &conn, struct job_defaults &, bool donotify);
110 void update_cursor(void);
112 bool is_connectedGui();
113 bool newDirComm(int &conn);
114 void populateLists(int conn);
117 QStringList job_list;
118 QStringList restore_list;
119 QStringList client_list;
120 QStringList fileset_list;
121 QStringList messages_list;
122 QStringList pool_list;
123 QStringList storage_list;
124 QStringList type_list;
125 QStringList level_list;
126 QStringList volstatus_list;
127 QStringList mediatype_list;
128 QStringList location_list;
132 void status_dir(void);
135 void poll_messages(void);
137 void consoleReload();
140 DIRRES *m_dir; /* so various pages can reference it */
141 bool m_warningPrevent;
144 QTextEdit *m_textEdit;
145 QTextCursor *m_cursor;
146 QTreeWidgetItem *m_directorTreeItem;
147 bool m_messages_pending;
149 bool messagesPending(bool pend);
151 QHash<int, DirComm*> m_dircommHash;
152 int m_dircommCounter;
155 #endif /* _CONSOLE_H_ */