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