]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/console_thread.h
689bfc80883c2dc23c38d4a908494896567b1c16
[bacula/bacula] / bacula / src / wx-console / console_thread.h
1 /*
2  *
3  *    Interaction thread between director and the GUI
4  *
5  *    Nicolas Boichat, April-May 2004
6  *
7  *    Version $Id$
8  */
9 /*
10    Bacula® - The Network Backup Solution
11
12    Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
13
14    The main author of Bacula is Kern Sibbald, with contributions from
15    many others, a complete list can be found in the file AUTHORS.
16    This program is Free Software; you can redistribute it and/or
17    modify it under the terms of version two of the GNU General Public
18    License as published by the Free Software Foundation plus additions
19    that are listed in the file LICENSE.
20
21    This program is distributed in the hope that it will be useful, but
22    WITHOUT ANY WARRANTY; without even the implied warranty of
23    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24    General Public License for more details.
25
26    You should have received a copy of the GNU General Public License
27    along with this program; if not, write to the Free Software
28    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29    02110-1301, USA.
30
31    Bacula® is a registered trademark of John Walker.
32    The licensor of Bacula is the Free Software Foundation Europe
33    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
34    Switzerland, email:ftf@fsfeurope.org.
35 */
36
37 #ifndef CONSOLE_THREAD_H
38 #define CONSOLE_THREAD_H
39
40 #ifndef ENABLE_NLS
41 #undef setlocale
42 #undef textdomain
43 #undef bindtextdomain
44 #endif
45
46
47 #include <wx/wxprec.h>
48
49 #include <wx/string.h>
50 #include <wx/thread.h> // inheriting class's header file
51 #include <wx/intl.h> /* We need to have _ and N_ defined by wxWidgets before Bacula tries to redefine them */
52 #include "bacula.h"
53 #include "jcr.h"
54
55 /**
56  * Console thread, does interaction between bacula routines and the GUI
57  */
58 class console_thread : public wxThread
59 {
60    public:
61       // class constructor
62       console_thread();
63       // class destructor
64       ~console_thread();
65
66       void* Entry();
67       void Write(const char* str);
68       virtual void Delete();
69
70       static void InitLib();
71       static void FreeLib();
72       static wxString LoadConfig(wxString configfile);
73       static void SetWorkingDirectory(wxString w_dir);
74    private:
75       static bool inited;
76       static bool configloaded;
77
78       bool choosingdirector;
79
80       static wxString working_dir;
81
82       int directorchoosen;
83
84       BSOCK* UA_sock;
85       JCR jcr;
86 };
87
88 int pm_cst_strcpy(POOLMEM **pm, const char *str);
89
90 #endif // CONSOLE_THREAD_H