]>
Commit | Line | Data |
---|---|---|
4e4152e4 JS |
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 | ||
ab7ce33c | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
4e4152e4 | 16 | #pragma interface "help.cpp" |
877c86a2 | 17 | #endif |
4e4152e4 | 18 | |
2b5f62a0 VZ |
19 | #define hvVERSION 1.02 |
20 | ||
21 | // If 1, start a server to allow this to be used | |
22 | // as an external help viewer. | |
23 | #define hvUSE_IPC 1 | |
24 | ||
25 | #if hvUSE_IPC | |
26 | #include <wx/ipc.h> | |
27 | ||
28 | class hvConnection; | |
29 | class hvServer; | |
30 | #endif | |
31 | ||
32 | /*! | |
33 | * The helpview application class. | |
34 | */ | |
35 | ||
4e4152e4 JS |
36 | class hvApp : public wxApp |
37 | { | |
2b5f62a0 VZ |
38 | public: |
39 | hvApp(); | |
40 | ||
41 | /// Initialise the application. | |
42 | virtual bool OnInit(); | |
43 | ||
44 | /// Clean up the application's data. | |
45 | virtual int OnExit(); | |
46 | ||
47 | /// Prompt the user for a book to open | |
48 | bool OpenBook(wxHtmlHelpController* controller); | |
49 | ||
50 | /// Returns the help controller. | |
51 | wxHtmlHelpController* GetHelpController() { return m_helpController; } | |
52 | ||
53 | #if hvUSE_IPC | |
54 | /// Returns the list of connections. | |
55 | wxList& GetConnections() { return m_connections; } | |
56 | #endif | |
4e4152e4 | 57 | |
2b5f62a0 VZ |
58 | private: |
59 | wxHtmlHelpController* m_helpController; | |
60 | ||
61 | #if hvUSE_IPC | |
62 | wxList m_connections; | |
63 | hvServer* m_server; | |
64 | #endif | |
65 | ||
66 | }; | |
67 | ||
68 | #if hvUSE_IPC | |
69 | class hvConnection : public wxConnection | |
70 | { | |
71 | public: | |
72 | hvConnection(); | |
73 | ~hvConnection(); | |
4e4152e4 | 74 | |
2b5f62a0 VZ |
75 | bool OnExecute(const wxString& topic, wxChar*data, int size, wxIPCFormat format); |
76 | wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format); | |
77 | bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format); | |
78 | bool OnStartAdvise(const wxString& topic, const wxString& item); | |
4e4152e4 | 79 | |
2b5f62a0 VZ |
80 | private: |
81 | }; | |
4e4152e4 | 82 | |
2b5f62a0 VZ |
83 | class hvServer: public wxServer |
84 | { | |
85 | public: | |
86 | wxConnectionBase *OnAcceptConnection(const wxString& topic); | |
4e4152e4 JS |
87 | }; |
88 | ||
2b5f62a0 VZ |
89 | |
90 | #endif | |
91 | ||
4e4152e4 JS |
92 | #endif |
93 | // _WX_HELPVIEW_H_ | |
94 |