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(NO_GCC_PRAGMA)
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
38 // Defines the API for help controllers
39 class WXDLLEXPORT wxHelpControllerBase
: public wxObject
42 inline wxHelpControllerBase() {}
43 inline ~wxHelpControllerBase() {}
45 // Must call this to set the filename and server name.
46 // server is only required when implementing TCP/IP-based
48 virtual bool Initialize(const wxString
& WXUNUSED(file
), int WXUNUSED(server
) ) { return FALSE
; }
49 virtual bool Initialize(const wxString
& WXUNUSED(file
)) { return FALSE
; }
51 // Set viewer: only relevant to some kinds of controller
52 virtual void SetViewer(const wxString
& WXUNUSED(viewer
), long WXUNUSED(flags
) = 0) {}
54 // If file is "", reloads file given in Initialize
55 virtual bool LoadFile(const wxString
& file
= wxEmptyString
) = 0;
57 // Displays the contents
58 virtual bool DisplayContents(void) = 0;
60 // Display the given section
61 virtual bool DisplaySection(int sectionNo
) = 0;
63 // Display the section using a context id
64 virtual bool DisplayContextPopup(int WXUNUSED(contextId
)) { return FALSE
; };
66 // Display the text in a popup, if possible
67 virtual bool DisplayTextPopup(const wxString
& WXUNUSED(text
), const wxPoint
& WXUNUSED(pos
)) { return FALSE
; }
69 // By default, uses KeywordSection to display a topic. Implementations
70 // may override this for more specific behaviour.
71 virtual bool DisplaySection(const wxString
& section
) { return KeywordSearch(section
); }
72 virtual bool DisplayBlock(long blockNo
) = 0;
73 virtual bool KeywordSearch(const wxString
& k
,
74 wxHelpSearchMode mode
= wxHELP_SEARCH_ALL
) = 0;
75 /// Allows one to override the default settings for the help frame.
76 virtual void SetFrameParameters(const wxString
& WXUNUSED(title
),
77 const wxSize
& WXUNUSED(size
),
78 const wxPoint
& WXUNUSED(pos
) = wxDefaultPosition
,
79 bool WXUNUSED(newFrameEachTime
) = FALSE
)
81 // does nothing by default
83 /// Obtains the latest settings used by the help frame and the help
85 virtual wxFrame
*GetFrameParameters(wxSize
*WXUNUSED(size
) = NULL
,
86 wxPoint
*WXUNUSED(pos
) = NULL
,
87 bool *WXUNUSED(newFrameEachTime
) = NULL
)
89 return (wxFrame
*) NULL
; // does nothing by default
92 virtual bool Quit() = 0;
93 virtual void OnQuit() {}
96 DECLARE_CLASS(wxHelpControllerBase
)