]> git.saurik.com Git - wxWidgets.git/blob - utils/helpview/src/helpview.h
Added missing fldef.h to makefile
[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.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
36 class hvApp : public wxApp
37 {
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
57
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();
74
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);
79
80 private:
81 };
82
83 class hvServer: public wxServer
84 {
85 public:
86 wxConnectionBase *OnAcceptConnection(const wxString& topic);
87 };
88
89
90 #endif
91
92 #endif
93 // _WX_HELPVIEW_H_
94