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"
34 #ifndef MAX_NAME_LENGTH
35 #define MAX_NAME_LENGTH 128
43 //class DirComm : public QObject
44 class DirComm : public QObject
49 DirComm(Console *parent, int conn);
53 bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons,
54 char *buf, int buflen);
55 bool is_connected() { return m_sock != NULL; }
56 bool is_ready() { return is_connected() && m_at_prompt && m_at_main_prompt; }
58 bool notify(bool enable); // enables/disables socket notification - returns the previous state
59 bool is_notify_enabled() const;
60 bool is_in_command() const { return m_in_command > 0; }
64 int write(const char *msg);
65 int write(QString msg);
68 void notify_read_dir(int fd);
73 bool m_at_main_prompt;
77 QSocketNotifier *m_notifier;
83 #endif /* _DIRCOMM_H_ */