]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/console_thread.h
This commit was manufactured by cvs2svn to create tag
[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    Copyright (C) 2004-2006 Kern Sibbald
11
12    This program is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public License
14    version 2 as amended with additional clauses defined in the
15    file LICENSE in the main source directory.
16
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
20    the file LICENSE for additional details.
21
22  */
23
24 #ifndef CONSOLE_THREAD_H
25 #define CONSOLE_THREAD_H
26
27 #include <wx/wxprec.h>
28
29 #include <wx/string.h>
30 #include <wx/thread.h> // inheriting class's header file
31 #include <wx/intl.h> /* We need to have _ and N_ defined by wxWidgets before Bacula tries to redefine them */
32 #include "bacula.h"
33 #include "jcr.h"
34
35 /**
36  * Console thread, does interaction between bacula routines and the GUI
37  */
38 class console_thread : public wxThread
39 {
40    public:
41       // class constructor
42       console_thread();
43       // class destructor
44       ~console_thread();
45
46       void* Entry();
47       void Write(const char* str);
48       virtual void Delete();
49
50       static void InitLib();
51       static void FreeLib();
52       static wxString LoadConfig(wxString configfile);
53       static void SetWorkingDirectory(wxString w_dir);
54    private:
55       static bool inited;
56       static bool configloaded;
57
58       bool choosingdirector;
59
60       static wxString working_dir;
61
62       int directorchoosen;
63
64       BSOCK* UA_sock;
65       JCR jcr;
66 };
67
68 int pm_cst_strcpy(POOLMEM **pm, const char *str);
69
70 #endif // CONSOLE_THREAD_H