Version: 0.6.0
tskmngrapp.h
1 /******************************************************************************
2  * Project: wxGIS (Task Manager)
3  * Purpose: Task manager application class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2010-2012,2014 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 
22 #pragma once
23 
24 #include "wxgis/base.h"
25 #include "wxgis/core/config.h"
26 #include "wxgis/core/init.h"
27 #include "wxgis/tskmngr_app/tskmngr.h"
28 #include "wxgis/version.h"
29 
30 #include <wx/app.h>
31 #include <wx/snglinst.h>
32 #include <wx/cmdline.h>
33 
41  public wxAppConsole,
42  public wxThreadHelper,
43  public wxGISInitializer,
44  public wxGISService
45 {
46 public:
47  wxGISTaskManagerApp(void);
48  virtual ~wxGISTaskManagerApp(void);
49  // wxAppConsole
50  virtual bool OnInit();
51  virtual int OnExit();
52  void OnInitCmdLine(wxCmdLineParser& pParser);
53  bool OnCmdLineParsed(wxCmdLineParser& pParser);
54  // wxGISInitializer
55  virtual bool Initialize(const wxString &sAppName, const wxString &sLogFilePrefix);//, wxCmdLineParser& parser
56  // wxGISService
57 #ifdef _WIN32
58  virtual void Run();
59  virtual bool Initialize();
60  virtual void OnStop();
61  virtual void OnPause();
62  virtual void OnContinue();
63  virtual void OnInterrogate();
64  virtual void OnShutdown();
65 #endif // _WIN32
66  // IApplication
67  virtual bool SetupSys(const wxString &sSysPath);
68  virtual wxString GetAppName(void) const {return m_appName;};
69  virtual wxString GetAppDisplayName(void) const{return m_appDisplayName;};
70  virtual wxString GetAppDisplayNameShort(void) const {return wxString(_("Task Manager"));};
71  virtual wxString GetAppVersionString(void) const {return wxString(wxGIS_VERSION_NUM_DOT_STRING_T);};
72  virtual void OnAppAbout(void);
73  virtual void OnAppOptions(void);
74 protected:
75  virtual wxThread::ExitCode Entry();
76  bool CreateAndRunExitThread(void);
77  void DestroyExitThread(void);
78 protected:
79  wxGISAppConfig m_oConfig;
80 #ifdef wxUSE_SNGLINST_CHECKER
81  wxSingleInstanceChecker *m_pChecker;
82 #endif
83  wxCriticalSection m_ExitLock;
84  wxGISTaskManager* m_pTaskManager;
85  bool m_bService;
86 };
87 
88 DECLARE_APP(wxGISTaskManagerApp)
89 
90 
Task Manager Server communicate class.
Definition: tskmngr.h:89
Definition: config.h:123
Definition: tskmngrapp.h:40