1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Help system base classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_HELPBASEH__
13 #define _WX_HELPBASEH__
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "helpbase.h"
23 #include "wx/object.h"
24 #include "wx/string.h"
25 #include "wx/gdicmn.h"
28 // Flags for SetViewer
29 #define wxHELP_NETSCAPE 1
31 // Defines the API for help controllers
32 class WXDLLEXPORT wxHelpControllerBase
: public wxObject
35 inline wxHelpControllerBase() {}
36 inline ~wxHelpControllerBase() {}
38 // Must call this to set the filename and server name.
39 // server is only required when implementing TCP/IP-based
41 virtual bool Initialize(const wxString
& WXUNUSED(file
), int WXUNUSED(server
) ) { return FALSE
; }
42 virtual bool Initialize(const wxString
& WXUNUSED(file
)) { return FALSE
; }
44 // Set viewer: only relevant to some kinds of controller
45 virtual void SetViewer(const wxString
& WXUNUSED(viewer
), long WXUNUSED(flags
) = 0) {}
47 // If file is "", reloads file given in Initialize
48 virtual bool LoadFile(const wxString
& file
= wxEmptyString
) = 0;
50 // Displays the contents
51 virtual bool DisplayContents(void) = 0;
53 // Display the given section
54 virtual bool DisplaySection(int sectionNo
) = 0;
56 // Display the section using a context id
57 virtual bool DisplayContextPopup(int WXUNUSED(contextId
)) { return FALSE
; };
59 // Display the text in a popup, if possible
60 virtual bool DisplayTextPopup(const wxString
& WXUNUSED(text
), const wxPoint
& WXUNUSED(pos
)) { return FALSE
; }
62 // By default, uses KeywordSection to display a topic. Implementations
63 // may override this for more specific behaviour.
64 virtual bool DisplaySection(const wxString
& section
) { return KeywordSearch(section
); }
65 virtual bool DisplayBlock(long blockNo
) = 0;
66 virtual bool KeywordSearch(const wxString
& k
) = 0;
67 /// Allows one to override the default settings for the help frame.
68 virtual void SetFrameParameters(const wxString
& WXUNUSED(title
),
69 const wxSize
& WXUNUSED(size
),
70 const wxPoint
& WXUNUSED(pos
) = wxDefaultPosition
,
71 bool WXUNUSED(newFrameEachTime
) = FALSE
)
73 // does nothing by default
75 /// Obtains the latest settings used by the help frame and the help
77 virtual wxFrame
*GetFrameParameters(wxSize
*WXUNUSED(size
) = NULL
,
78 wxPoint
*WXUNUSED(pos
) = NULL
,
79 bool *WXUNUSED(newFrameEachTime
) = NULL
)
81 return (wxFrame
*) NULL
; // does nothing by default
84 virtual bool Quit() = 0;
85 virtual void OnQuit() {}
88 DECLARE_CLASS(wxHelpControllerBase
)