]> git.saurik.com Git - wxWidgets.git/blame - include/wx/helpbase.h
Make wxString::WorstEncodingCase take a const wxMBConv&
[wxWidgets.git] / include / wx / helpbase.h
CommitLineData
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
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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
69b5cec2
VS
31// Search modes:
32enum wxHelpSearchMode
33{
34 wxHELP_SEARCH_INDEX,
35 wxHELP_SEARCH_ALL
36};
37
c801d85f
KB
38// Defines the API for help controllers
39class WXDLLEXPORT wxHelpControllerBase: public wxObject
40{
f6bcfd97
BP
41public:
42 inline wxHelpControllerBase() {}
2b5f62a0 43 inline ~wxHelpControllerBase() {}
3379ed37 44
f6bcfd97
BP
45 // Must call this to set the filename and server name.
46 // server is only required when implementing TCP/IP-based
47 // help controllers.
5d3e7b52
WS
48 virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return false; }
49 virtual bool Initialize(const wxString& WXUNUSED(file)) { return false; }
3379ed37 50
f6bcfd97
BP
51 // Set viewer: only relevant to some kinds of controller
52 virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
3379ed37 53
f6bcfd97 54 // If file is "", reloads file given in Initialize
fda7962d 55 virtual bool LoadFile(const wxString& file = wxEmptyString) = 0;
5100cabf
JS
56
57 // Displays the contents
f6bcfd97 58 virtual bool DisplayContents(void) = 0;
5100cabf
JS
59
60 // Display the given section
f6bcfd97 61 virtual bool DisplaySection(int sectionNo) = 0;
c801d85f 62
5100cabf 63 // Display the section using a context id
5d3e7b52 64 virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return false; };
5100cabf
JS
65
66 // Display the text in a popup, if possible
5d3e7b52 67 virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return false; }
5100cabf 68
f6bcfd97
BP
69 // By default, uses KeywordSection to display a topic. Implementations
70 // may override this for more specific behaviour.
2b5f62a0 71 virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
f6bcfd97 72 virtual bool DisplayBlock(long blockNo) = 0;
69b5cec2
VS
73 virtual bool KeywordSearch(const wxString& k,
74 wxHelpSearchMode mode = wxHELP_SEARCH_ALL) = 0;
f6bcfd97
BP
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,
5d3e7b52 79 bool WXUNUSED(newFrameEachTime) = false)
f6bcfd97
BP
80 {
81 // does nothing by default
82 }
3379ed37 83 /// Obtains the latest settings used by the help frame and the help
f6bcfd97
BP
84 /// frame.
85 virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
86 wxPoint *WXUNUSED(pos) = NULL,
87 bool *WXUNUSED(newFrameEachTime) = NULL)
88 {
2b5f62a0 89 return (wxFrame*) NULL; // does nothing by default
f6bcfd97 90 }
3379ed37 91
2b5f62a0
VZ
92 virtual bool Quit() = 0;
93 virtual void OnQuit() {}
5d3e7b52 94
2b5f62a0
VZ
95private:
96 DECLARE_CLASS(wxHelpControllerBase)
c801d85f
KB
97};
98
47d67540 99#endif // wxUSE_HELP
3379ed37 100
c801d85f 101#endif
f6bcfd97 102// _WX_HELPBASEH__