xCHM  1.23
chmapp.h
1 /*
2 
3  Copyright (C) 2003 - 2013 Razvan Cojocaru <rzvncj@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  MA 02110-1301, USA.
19 
20 */
21 
22 
23 #ifndef __CHMAPP_H_
24 #define __CHMAPP_H_
25 
26 #ifdef HAVE_CONFIG_H
27 # include <config.h>
28 #endif
29 
30 #include <wx/wx.h>
31 #include <wx/intl.h>
32 #include <wx/cmdline.h>
33 
34 #ifdef WITH_LIBXMLRPC
35 # define TIMER_ID wxID_HIGHEST + 1
36 # include <XmlRpc.h>
37 using namespace XmlRpc;
38 #endif
39 
40 
41 // Forward declaration.
42 class CHMFrame;
43 
44 
50 #ifdef WITH_LIBXMLRPC
52 class CHMApp : public wxApp, public XmlRpcServerMethod {
53 #else
54 class CHMApp : public wxApp {
55 #endif
56 
57 #ifdef WITH_LIBXMLRPC
58 public:
60  CHMApp();
61 #endif
62  virtual bool OnInit();
64 
65 #ifdef __WXMAC__
66  virtual void MacOpenFile(const wxString& filename);
68 #endif
69 
70 protected:
71 
72 #ifdef WITH_LIBXMLRPC
73  void execute(XmlRpcValue& params, XmlRpcValue& result);
75 
77  void WatchForXMLRPC( wxTimerEvent& event );
78 #endif
79 
80 private:
81  // Try to figure out the absolute file path of the executable.
82  wxString getAppPath(const wxString& argv0, const wxString& cwd);
83 
84 private:
85  CHMFrame* _frame;
86  wxLocale _loc;
87 
88 #ifdef WITH_LIBXMLRPC
89  wxTimer _timer;
90 #endif
91  wxCmdLineParser _cmdLP;
92 #ifdef WITH_LIBXMLRPC
93  DECLARE_EVENT_TABLE()
94 #endif
95 };
96 
97 #endif // __CHMAPP_H_
98 
99 
100 /*
101  Local Variables:
102  mode: c++
103  c-basic-offset: 8
104  tab-width: 8
105  c-indent-comments-syntactically-p: t
106  c-tab-always-indent: t
107  indent-tabs-mode: t
108  End:
109 */
110 
111 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
112 
This is the application class.
Definition: chmapp.h:54
wxWidgets application class.
Definition: chmapp.h:42
The frame, owner of the wxHtmlWindow, contents tree control and all the other nifty stuff...
Definition: chmframe.h:97