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"
31 #ifndef MAX_NAME_LENGTH
32 #define MAX_NAME_LENGTH 128
40 //class DirComm : public QObject
41 class DirComm : public QObject
46 DirComm(Console *parent, int conn);
50 bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons,
51 char *buf, int buflen);
52 bool is_connected() { return m_sock != NULL; };
53 bool is_ready() { return is_connected() && m_at_prompt && m_at_main_prompt; };
55 bool notify(bool enable); // enables/disables socket notification - returns the previous state
56 bool is_notify_enabled() const;
57 bool is_in_command() const { return m_in_command > 0; };
61 int write(const char *msg);
62 int write(QString msg);
65 void notify_read_dir(int fd);
70 bool m_at_main_prompt;
74 QSocketNotifier *m_notifier;
80 #endif /* _DIRCOMM_H_ */