]> git.saurik.com Git - wxWidgets.git/blob - utils/helpview/src/helpview.h
92327bf462dc7ec8da5e429d64d3056a42ac286c
[wxWidgets.git] / utils / helpview / src / helpview.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: helpview.h
3 // Purpose: HelpView application class
4 // Author: Vaclav Slavik, Julian Smart
5 // Modified by:
6 // Created: 2002-07-09
7 // RCS-ID: $Id$
8 // Copyright: (c) 2002 Vaclav Slavik, Julian Smart and others
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_HELPVIEW_H_
13 #define _WX_HELPVIEW_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "help.cpp"
17 #endif
18
19 #define hvVERSION 1.03
20
21 // If 1, start a server to allow this to be used
22 // as an external help viewer.
23 <<<<<<< helpview.h
24 #define hvUSE_IPC 0
25 =======
26 #if defined(__WXMAC__) && !defined(__UNIX__)
27 #define hvUSE_IPC 0
28 #else
29 #define hvUSE_IPC 1
30 #endif
31 >>>>>>> 1.5
32
33 #if hvUSE_IPC
34 #include <wx/ipc.h>
35
36 class hvConnection;
37 class hvServer;
38 #endif
39
40 /*!
41 * The helpview application class.
42 */
43
44 class hvApp : public wxApp
45 {
46 public:
47 hvApp();
48
49 /// Initialise the application.
50 virtual bool OnInit();
51
52 /// Clean up the application's data.
53 virtual int OnExit();
54
55 #ifdef __WXMAC__
56 /// Respond to Apple Event for opening a document
57 virtual void MacOpenFile(const wxString& filename);
58 #endif
59
60 /// Prompt the user for a book to open
61 bool OpenBook(wxHtmlHelpController* controller);
62
63 /// Returns the help controller.
64 wxHtmlHelpController* GetHelpController() { return m_helpController; }
65
66 #if hvUSE_IPC
67 /// Returns the list of connections.
68 wxList& GetConnections() { return m_connections; }
69 #endif
70
71 private:
72 wxHtmlHelpController* m_helpController;
73
74 #if hvUSE_IPC
75 wxList m_connections;
76 hvServer* m_server;
77 #endif
78
79 };
80
81 #if hvUSE_IPC
82 class hvConnection : public wxConnection
83 {
84 public:
85 hvConnection();
86 ~hvConnection();
87
88 bool OnExecute(const wxString& topic, wxChar*data, int size, wxIPCFormat format);
89 wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
90 bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format);
91 bool OnStartAdvise(const wxString& topic, const wxString& item);
92
93 private:
94 };
95
96 class hvServer: public wxServer
97 {
98 public:
99 wxConnectionBase *OnAcceptConnection(const wxString& topic);
100 };
101
102
103 #endif
104
105 #endif
106 // _WX_HELPVIEW_H_
107