]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/helphtml.h
1 /*-*- c++ -*-********************************************************
2 * helphtml.h - base class for html based help controllers *
4 * (C) 1999 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
14 # pragma interface "helphtml.h"
17 #include "wx/helpbase.h"
19 /// Name for map file.
20 #define WXEXTHELP_MAPFILE "wxhelp.map"
22 #define WXEXTHELP_SEPARATOR '/'
23 /// Maximum line length in map file.
24 #define WXEXTHELP_BUFLEN 512
25 /// Character introducing comments/documentation field in map file.
26 #define WXEXTHELP_COMMENTCHAR ';'
28 class wxExtHelpMapList
;
32 This class is the base class for all html help implementations.
33 It requires the name of a directory containing the documentation
34 and a file mapping numerical Section numbers to relative URLS.
36 The map file contains two or three fields per line:
37 numeric_id relative_URL [; comment/documentation]
39 The numeric_id is the id used to look up the entry in
40 DisplaySection()/DisplayBlock(). The relative_URL is a filename of
41 an html file, relative to the help directory. The optional
42 comment/documentation field (after a ';') is used for keyword
43 searches, so some meaningful text here does not hurt.
44 If the documentation itself contains a ';', only the part before
45 that will be displayed in the listbox, but all of it used for search.
47 Lines starting with ';' will be ignored.
50 class wxHTMLHelpControllerBase
: public wxHelpControllerBase
52 DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase
)
54 wxHTMLHelpControllerBase(void);
55 virtual ~wxHTMLHelpControllerBase(void);
57 /** This must be called to tell the controller where to find the
59 If a locale is set, look in file/localename, i.e.
60 If passed "/usr/local/myapp/help" and the current wxLocale is
61 set to be "de", then look in "/usr/local/myapp/help/de/"
62 first and fall back to "/usr/local/myapp/help" if that
65 @param file - NOT a filename, but a directory name.
66 @return true on success
68 virtual bool Initialize(const wxString
& dir
, int WXUNUSED(server
))
69 { return Initialize(dir
); }
71 /** This must be called to tell the controller where to find the
73 If a locale is set, look in file/localename, i.e.
74 If passed "/usr/local/myapp/help" and the current wxLocale is
75 set to be "de", then look in "/usr/local/myapp/help/de/"
76 first and fall back to "/usr/local/myapp/help" if that
78 @param dir - directory name where to fine the help files
79 @return true on success
81 virtual bool Initialize(const wxString
& dir
);
83 /** If file is "", reloads file given in Initialize.
84 @file Name of help directory.
85 @return true on success
87 virtual bool LoadFile(const wxString
& file
= "");
89 /** Display list of all help entries.
90 @return true on success
92 virtual bool DisplayContents(void);
93 /** Display help for id sectionNo.
94 @return true on success
96 virtual bool DisplaySection(int sectionNo
);
97 /** Display help for id sectionNo -- identical with DisplaySection().
98 @return true on success
100 virtual bool DisplayBlock(long blockNo
);
101 /** Search comment/documentation fields in map file and present a
103 @key k string to search for, empty string will list all entries
104 @return true on success
106 virtual bool KeywordSearch(const wxString
& k
);
109 virtual bool Quit(void);
111 virtual void OnQuit(void);
113 /// Call the browser using a relative URL.
114 virtual bool DisplayHelp(wxString
const &) = 0;
117 /// Filename of currently active map file.
119 /// How many entries do we have in the map file?
121 /// A list containing all id,url,documentation triples.
123 /// Deletes the list and all objects.
124 void DeleteList(void);