1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Help system base classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_HELPBASEH__
13 #define _WX_HELPBASEH__
16 #pragma interface "helpbase.h"
20 #include "wx/object.h"
21 #include "wx/string.h"
22 #include "wx/gdicmn.h"
27 // Flags for SetViewer
28 #define wxHELP_NETSCAPE 1
30 // Defines the API for help controllers
31 class WXDLLEXPORT wxHelpControllerBase
: public wxObject
33 DECLARE_CLASS(wxHelpControllerBase
)
36 inline wxHelpControllerBase() {}
37 inline ~wxHelpControllerBase() {};
39 // Must call this to set the filename and server name.
40 // server is only required when implementing TCP/IP-based
42 virtual bool Initialize(const wxString
& WXUNUSED(file
), int WXUNUSED(server
) ) { return FALSE
; };
43 virtual bool Initialize(const wxString
& file
) = 0;
45 // Set viewer: only relevant to some kinds of controller
46 virtual void SetViewer(const wxString
& WXUNUSED(viewer
), long WXUNUSED(flags
) = 0) {}
48 // If file is "", reloads file given in Initialize
49 virtual bool LoadFile(const wxString
& file
= "") = 0;
50 virtual bool DisplayContents(void) = 0;
51 virtual bool DisplaySection(int sectionNo
) = 0;
52 virtual bool DisplayBlock(long blockNo
) = 0;
53 virtual bool KeywordSearch(const wxString
& k
) = 0;
54 /// Allows one to override the default settings for the help frame.
55 virtual void SetFrameParameters(const wxString
&title
,
57 const wxPoint
&pos
= wxDefaultPosition
,
58 bool newFrameEachTime
= FALSE
)
60 // does nothing by default
62 /// Obtains the latest settings used by the help frame and the help
64 virtual wxFrame
*GetFrameParameters(wxSize
*size
= NULL
,
66 bool *newFrameEachTime
= NULL
)
68 return (wxFrame
*) NULL
;// does nothing by default
71 virtual bool Quit(void) = 0;
72 virtual void OnQuit(void) {};
76 /* By default, if wxHTML is compiled in, use the
77 wxHelpControllerHtml. If not, use the external help controller.
78 (of course, we shouldn't do it for wxMSW)
82 # include "wx/generic/helpwxht.h"
83 # define wxHelpController wxHelpControllerHtml
84 # define sm_classwxHelpController sm_classwxHelpControllerHtml
86 # include "wx/generic/helpext.h"
87 # define wxHelpController wxExtHelpController
88 # define sm_classwxHelpController sm_classwxExtHelpController