]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
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$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
5d3e7b52 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_HELPBASEH__ |
13 | #define _WX_HELPBASEH__ | |
c801d85f | 14 | |
e179bd65 | 15 | #include "wx/defs.h" |
3379ed37 VZ |
16 | |
17 | #if wxUSE_HELP | |
18 | ||
e179bd65 RR |
19 | #include "wx/object.h" |
20 | #include "wx/string.h" | |
21 | #include "wx/gdicmn.h" | |
5f1ea0ee | 22 | #include "wx/frame.h" |
c801d85f | 23 | |
33b64e6f JS |
24 | // Flags for SetViewer |
25 | #define wxHELP_NETSCAPE 1 | |
26 | ||
69b5cec2 VS |
27 | // Search modes: |
28 | enum wxHelpSearchMode | |
29 | { | |
30 | wxHELP_SEARCH_INDEX, | |
31 | wxHELP_SEARCH_ALL | |
32 | }; | |
33 | ||
c801d85f KB |
34 | // Defines the API for help controllers |
35 | class WXDLLEXPORT wxHelpControllerBase: public wxObject | |
36 | { | |
f6bcfd97 BP |
37 | public: |
38 | inline wxHelpControllerBase() {} | |
2b5f62a0 | 39 | inline ~wxHelpControllerBase() {} |
3379ed37 | 40 | |
f6bcfd97 BP |
41 | // Must call this to set the filename and server name. |
42 | // server is only required when implementing TCP/IP-based | |
43 | // help controllers. | |
5d3e7b52 WS |
44 | virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return false; } |
45 | virtual bool Initialize(const wxString& WXUNUSED(file)) { return false; } | |
3379ed37 | 46 | |
f6bcfd97 BP |
47 | // Set viewer: only relevant to some kinds of controller |
48 | virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} | |
3379ed37 | 49 | |
f6bcfd97 | 50 | // If file is "", reloads file given in Initialize |
fda7962d | 51 | virtual bool LoadFile(const wxString& file = wxEmptyString) = 0; |
5100cabf JS |
52 | |
53 | // Displays the contents | |
f6bcfd97 | 54 | virtual bool DisplayContents(void) = 0; |
5100cabf JS |
55 | |
56 | // Display the given section | |
f6bcfd97 | 57 | virtual bool DisplaySection(int sectionNo) = 0; |
c801d85f | 58 | |
5100cabf | 59 | // Display the section using a context id |
5d3e7b52 | 60 | virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return false; }; |
5100cabf JS |
61 | |
62 | // Display the text in a popup, if possible | |
5d3e7b52 | 63 | virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return false; } |
5100cabf | 64 | |
f6bcfd97 BP |
65 | // By default, uses KeywordSection to display a topic. Implementations |
66 | // may override this for more specific behaviour. | |
2b5f62a0 | 67 | virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); } |
f6bcfd97 | 68 | virtual bool DisplayBlock(long blockNo) = 0; |
69b5cec2 VS |
69 | virtual bool KeywordSearch(const wxString& k, |
70 | wxHelpSearchMode mode = wxHELP_SEARCH_ALL) = 0; | |
f6bcfd97 BP |
71 | /// Allows one to override the default settings for the help frame. |
72 | virtual void SetFrameParameters(const wxString& WXUNUSED(title), | |
73 | const wxSize& WXUNUSED(size), | |
74 | const wxPoint& WXUNUSED(pos) = wxDefaultPosition, | |
5d3e7b52 | 75 | bool WXUNUSED(newFrameEachTime) = false) |
f6bcfd97 BP |
76 | { |
77 | // does nothing by default | |
78 | } | |
3379ed37 | 79 | /// Obtains the latest settings used by the help frame and the help |
f6bcfd97 BP |
80 | /// frame. |
81 | virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL, | |
82 | wxPoint *WXUNUSED(pos) = NULL, | |
83 | bool *WXUNUSED(newFrameEachTime) = NULL) | |
84 | { | |
2b5f62a0 | 85 | return (wxFrame*) NULL; // does nothing by default |
f6bcfd97 | 86 | } |
3379ed37 | 87 | |
2b5f62a0 VZ |
88 | virtual bool Quit() = 0; |
89 | virtual void OnQuit() {} | |
5d3e7b52 | 90 | |
2b5f62a0 VZ |
91 | private: |
92 | DECLARE_CLASS(wxHelpControllerBase) | |
c801d85f KB |
93 | }; |
94 | ||
47d67540 | 95 | #endif // wxUSE_HELP |
3379ed37 | 96 | |
c801d85f | 97 | #endif |
f6bcfd97 | 98 | // _WX_HELPBASEH__ |