]> git.saurik.com Git - wxWidgets.git/blame - include/wx/helpbase.h
#ifdefed wxPopupComboWindow to be used only in wxUniv
[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$
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 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
32class WXDLLEXPORT wxHelpControllerBase: public wxObject
33{
f6bcfd97 34 DECLARE_CLASS(wxHelpControllerBase)
3379ed37 35
f6bcfd97
BP
36public:
37 inline wxHelpControllerBase() {}
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.
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
BP
49 // If file is "", reloads file given in Initialize
50 virtual bool LoadFile(const wxString& file = "") = 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
JS
58 // Display the section using a context id
59 virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return FALSE; };
60
61 // Display the text in a popup, if possible
62 virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return FALSE; };
63
f6bcfd97
BP
64 // By default, uses KeywordSection to display a topic. Implementations
65 // may override this for more specific behaviour.
66 virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); };
67 virtual bool DisplayBlock(long blockNo) = 0;
68 virtual bool KeywordSearch(const wxString& k) = 0;
69 /// Allows one to override the default settings for the help frame.
70 virtual void SetFrameParameters(const wxString& WXUNUSED(title),
71 const wxSize& WXUNUSED(size),
72 const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
73 bool WXUNUSED(newFrameEachTime) = FALSE)
74 {
75 // does nothing by default
76 }
3379ed37 77 /// Obtains the latest settings used by the help frame and the help
f6bcfd97
BP
78 /// frame.
79 virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
80 wxPoint *WXUNUSED(pos) = NULL,
81 bool *WXUNUSED(newFrameEachTime) = NULL)
82 {
83 return (wxFrame*) NULL;// does nothing by default
84 }
3379ed37 85
f6bcfd97
BP
86 virtual bool Quit(void) = 0;
87 virtual void OnQuit(void) {};
c801d85f
KB
88};
89
47d67540 90#endif // wxUSE_HELP
3379ed37 91
c801d85f 92#endif
f6bcfd97 93// _WX_HELPBASEH__