4 Bacula® - The Network Backup Solution
6 Copyright (C) 2007-2009 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 Kern Sibbald.
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 * Kern Sibbald, January 2007
38 #include "ui_console.h"
41 #ifndef MAX_NAME_LENGTH
42 #define MAX_NAME_LENGTH 128
50 //class DirComm : public QObject
51 class DirComm : public QObject
56 DirComm(Console *parent, int conn);
60 bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons,
61 char *buf, int buflen);
62 bool is_connected() { return m_sock != NULL; };
63 bool is_ready() { return is_connected() && m_at_prompt && m_at_main_prompt; };
65 bool notify(bool enable); // enables/disables socket notification - returns the previous state
66 bool is_notify_enabled() const;
67 bool is_in_command() const { return m_in_command > 0; };
71 int write(const char *msg);
72 int write(QString msg);
75 void read_dir(int fd);
80 bool m_at_main_prompt;
82 QSocketNotifier *m_notifier;
88 #endif /* _DIRCOMM_H_ */