1 /*-*- c++ -*-********************************************************
2 * helphtml.h - base class for html based help controllers *
4 * (C) 1999 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
9 #ifndef __WX_HELPHTML_H_
10 #define __WX_HELPHTML_H_
15 # pragma interface "helphtml.h"
18 #include "wx/helpbase.h"
20 /// Name for map file.
21 #define WXEXTHELP_MAPFILE "wxhelp.map"
24 #define WXEXTHELP_SEPARATOR '\\'
26 #define WXEXTHELP_SEPARATOR '/'
28 /// Maximum line length in map file.
29 #define WXEXTHELP_BUFLEN 512
30 /// Character introducing comments/documentation field in map file.
31 #define WXEXTHELP_COMMENTCHAR ';'
33 class WXDLLEXPORT wxExtHelpMapList
;
37 This class is the base class for all html help implementations.
38 It requires the name of a directory containing the documentation
39 and a file mapping numerical Section numbers to relative URLS.
41 The map file contains two or three fields per line:
42 numeric_id relative_URL [; comment/documentation]
44 The numeric_id is the id used to look up the entry in
45 DisplaySection()/DisplayBlock(). The relative_URL is a filename of
46 an html file, relative to the help directory. The optional
47 comment/documentation field (after a ';') is used for keyword
48 searches, so some meaningful text here does not hurt.
49 If the documentation itself contains a ';', only the part before
50 that will be displayed in the listbox, but all of it used for search.
52 Lines starting with ';' will be ignored.
55 class WXDLLEXPORT wxHTMLHelpControllerBase
: public wxHelpControllerBase
57 DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase
)
59 wxHTMLHelpControllerBase(void);
60 virtual ~wxHTMLHelpControllerBase(void);
62 /** This must be called to tell the controller where to find the
64 If a locale is set, look in file/localename, i.e.
65 If passed "/usr/local/myapp/help" and the current wxLocale is
66 set to be "de", then look in "/usr/local/myapp/help/de/"
67 first and fall back to "/usr/local/myapp/help" if that
70 @param file - NOT a filename, but a directory name.
71 @return true on success
73 virtual bool Initialize(const wxString
& dir
, int WXUNUSED(server
))
74 { return Initialize(dir
); }
76 /** This must be called to tell the controller where to find the
78 If a locale is set, look in file/localename, i.e.
79 If passed "/usr/local/myapp/help" and the current wxLocale is
80 set to be "de", then look in "/usr/local/myapp/help/de/"
81 first and fall back to "/usr/local/myapp/help" if that
83 @param dir - directory name where to fine the help files
84 @return true on success
86 virtual bool Initialize(const wxString
& dir
);
88 /** If file is "", reloads file given in Initialize.
89 @file Name of help directory.
90 @return true on success
92 virtual bool LoadFile(const wxString
& file
= "");
94 /** Display list of all help entries.
95 @return true on success
97 virtual bool DisplayContents(void);
98 /** Display help for id sectionNo.
99 @return true on success
101 virtual bool DisplaySection(int sectionNo
);
102 /** Display help for id sectionNo -- identical with DisplaySection().
103 @return true on success
105 virtual bool DisplayBlock(long blockNo
);
106 /** Search comment/documentation fields in map file and present a
108 @key k string to search for, empty string will list all entries
109 @return true on success
111 virtual bool KeywordSearch(const wxString
& k
);
114 virtual bool Quit(void);
116 virtual void OnQuit(void);
118 /// Call the browser using a relative URL.
119 virtual bool DisplayHelp(wxString
const &) = 0;
122 /// Filename of currently active map file.
124 /// How many entries do we have in the map file?
126 /// A list containing all id,url,documentation triples.
128 /// Deletes the list and all objects.
129 void DeleteList(void);
134 #endif // __WX_HELPHTML_H_