00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __CHMAPP_H_
00024 #define __CHMAPP_H_
00025
00026 #include <config.h>
00027 #include <wx/wx.h>
00028 #include <wx/intl.h>
00029 #include <wx/cmdline.h>
00030
00031 #ifdef WITH_LIBXMLRPC
00032 # define TIMER_ID wxID_HIGHEST + 1
00033 # include <XmlRpc.h>
00034 using namespace XmlRpc;
00035 #endif
00036
00037
00038
00039 class CHMFrame;
00040
00041
00047
00048 #ifdef WITH_LIBXMLRPC
00049 class CHMApp : public wxApp, public XmlRpcServerMethod {
00050 #else
00051 class CHMApp : public wxApp {
00052 #endif
00053
00054 #ifdef WITH_LIBXMLRPC
00055 public:
00057 CHMApp();
00058 #endif
00060 virtual bool OnInit();
00061
00062 #ifdef __WXMAC__
00064 virtual void MacOpenFile(const wxString& filename);
00065 #endif
00066
00067 protected:
00068
00069 #ifdef WITH_LIBXMLRPC
00071 void execute(XmlRpcValue& params, XmlRpcValue& result);
00072
00074 void WatchForXMLRPC( wxTimerEvent& event );
00075 #endif
00076
00077 private:
00078
00079 wxString getAppPath(const wxString& argv0, const wxString& cwd);
00080
00081 private:
00082 CHMFrame* _frame;
00083 wxLocale _loc;
00084
00085 #ifdef WITH_LIBXMLRPC
00086 wxTimer _timer;
00087 #endif
00088 wxCmdLineParser _cmdLP;
00089 #ifdef WITH_LIBXMLRPC
00090 DECLARE_EVENT_TABLE()
00091 #endif
00092 };
00093
00094 #endif // __CHMAPP_H_
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109