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