4 Bacula® - The Network Backup Solution
6 Copyright (C) 2007-2007 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 John Walker.
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 * This is an attempt to move the higher level read/write type
34 * functionality to the Director out of the Console class into
35 * a Bacula Communications class. This class builds on the
39 * Kern Sibbald, May 2007
49 class DirComm : public Pages
54 DirComm(Console *console);
56 void display_text(const char *buf);
57 void display_text(const QString buf);
58 void display_textf(const char *fmt, ...);
59 void display_html(const QString buf);
60 void update_cursor(void);
61 void write_dir(const char *buf);
62 bool dir_cmd(const char *cmd, QStringList &results);
63 bool dir_cmd(QString &cmd, QStringList &results);
64 bool sql_cmd(const char *cmd, QStringList &results);
65 bool sql_cmd(QString &cmd, QStringList &results);
66 bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons,
67 char *buf, int buflen);
68 bool is_connected() { return m_sock != NULL; };
69 bool is_connectedGui();
71 void notify(bool enable);
73 void beginNewCommand();
74 void displayToPrompt();
75 void discardToPrompt();
76 void setDirectorTreeItem(QTreeWidgetItem *);
77 void setDirRes(DIRRES *dir);
78 void getDirResName(QString &);
83 void connect_dir(DIRRES *dir, CONRES *cons);
84 void read_dir(int fd);
86 int write(const char *msg);
87 int write(QString msg);
88 void poll_messages(void);
96 bool m_at_main_prompt;
97 QSocketNotifier *m_notifier;
100 bool m_messages_pending;
104 #endif /* _DIRCOMM_H_ */