]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/console_thread.h
Updates for debugging disk seek
[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 #include <wx/wxprec.h>
41
42 #include <wx/string.h>
43 #include <wx/thread.h> // inheriting class's header file
44 #include <wx/intl.h> /* We need to have _ and N_ defined by wxWidgets before Bacula tries to redefine them */
45 #include "bacula.h"
46 #include "jcr.h"
47
48 /**
49  * Console thread, does interaction between bacula routines and the GUI
50  */
51 class console_thread : public wxThread
52 {
53    public:
54       // class constructor
55       console_thread();
56       // class destructor
57       ~console_thread();
58
59       void* Entry();
60       void Write(const char* str);
61       virtual void Delete();
62
63       static void InitLib();
64       static void FreeLib();
65       static wxString LoadConfig(wxString configfile);
66       static void SetWorkingDirectory(wxString w_dir);
67    private:
68       static bool inited;
69       static bool configloaded;
70
71       bool choosingdirector;
72
73       static wxString working_dir;
74
75       int directorchoosen;
76
77       BSOCK* UA_sock;
78       JCR jcr;
79 };
80
81 int pm_cst_strcpy(POOLMEM **pm, const char *str);
82
83 #endif // CONSOLE_THREAD_H