]> git.saurik.com Git - wxWidgets.git/blob - include/wx/helpbase.h
Documented help API extension and fixed gsocket compilation.
[wxWidgets.git] / include / wx / helpbase.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: helpbase.h
3 // Purpose: Help system base classes
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_HELPBASEH__
13 #define _WX_HELPBASEH__
14
15 #ifdef __GNUG__
16 #pragma interface "helpbase.h"
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/object.h"
21 #include "wx/string.h"
22 #include "wx/gdicmn.h"
23
24 #if wxUSE_HELP
25
26 // Flags for SetViewer
27 #define wxHELP_NETSCAPE 1
28
29 // Defines the API for help controllers
30 class WXDLLEXPORT wxHelpControllerBase: public wxObject
31 {
32 DECLARE_CLASS(wxHelpControllerBase)
33
34 public:
35 inline wxHelpControllerBase() {}
36 inline ~wxHelpControllerBase() {};
37
38 // Must call this to set the filename and server name.
39 // server is only required when implementing TCP/IP-based
40 // help controllers.
41 virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return FALSE; };
42 virtual bool Initialize(const wxString& file) = 0;
43
44 // Set viewer: only relevant to some kinds of controller
45 virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
46
47 // If file is "", reloads file given in Initialize
48 virtual bool LoadFile(const wxString& file = "") = 0;
49 virtual bool DisplayContents(void) = 0;
50 virtual bool DisplaySection(int sectionNo) = 0;
51 virtual bool DisplayBlock(long blockNo) = 0;
52 virtual bool KeywordSearch(const wxString& k) = 0;
53 /// Allows one to override the default settings for the help frame.
54 virtual void SetFrameParameters(const wxString &title,
55 const wxSize &size,
56 const wxPoint &pos = wxDefaultPosition,
57 bool newFrameEachTime = FALSE)
58 {
59 // does nothing by default
60 }
61 /// Obtains the latest settings used by the help frame and the help
62 /// frame.
63 virtual wxFrame *GetFrameParameters(wxSize *size = NULL,
64 wxPoint *pos = NULL,
65 bool *newFrameEachTime = NULL)
66 {
67 return (wxFrame*) NULL;// does nothing by default
68 }
69
70 virtual bool Quit(void) = 0;
71 virtual void OnQuit(void) {};
72 };
73
74
75 /* By default, if wxHTML is compiled in, use the
76 wxHelpControllerHtml. If not, use the external help controller.
77 (of course, we shouldn't do it for wxMSW)
78 */
79 #ifndef __WXMSW__
80 #if wxUSE_HTML
81 # include "wx/generic/helpwxht.h"
82 # define wxHelpController wxHelpControllerHtml
83 # define sm_classwxHelpController sm_classwxHelpControllerHtml
84 #else
85 # include "wx/generic/helpext.h"
86 # define wxHelpController wxExtHelpController
87 # define sm_classwxHelpController sm_classwxExtHelpController
88 #endif
89 #endif // wxMSW
90
91 #endif // wxUSE_HELP
92 #endif
93 // _WX_HELPBASEH__