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
27 #include "ui_console.h"
30 #ifndef MAX_NAME_LENGTH
31 #define MAX_NAME_LENGTH 128
39 //class DirComm : public QObject
40 class DirComm : public QObject
45 DirComm(Console *parent, int conn);
49 bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons,
50 char *buf, int buflen);
51 bool is_connected() { return m_sock != NULL; };
52 bool is_ready() { return is_connected() && m_at_prompt && m_at_main_prompt; };
54 bool notify(bool enable); // enables/disables socket notification - returns the previous state
55 bool is_notify_enabled() const;
56 bool is_in_command() const { return m_in_command > 0; };
60 int write(const char *msg);
61 int write(QString msg);
64 void notify_read_dir(int fd);
69 bool m_at_main_prompt;
73 QSocketNotifier *m_notifier;
79 #endif /* _DIRCOMM_H_ */