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