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"
21 class WXDLLEXPORT wxExtHelpMapList
;
25 This class is the base class for all html help implementations.
26 It requires the name of a directory containing the documentation
27 and a file mapping numerical Section numbers to relative URLS.
29 The map file contains two or three fields per line:
30 numeric_id relative_URL [; comment/documentation]
32 The numeric_id is the id used to look up the entry in
33 DisplaySection()/DisplayBlock(). The relative_URL is a filename of
34 an html file, relative to the help directory. The optional
35 comment/documentation field (after a ';') is used for keyword
36 searches, so some meaningful text here does not hurt.
37 If the documentation itself contains a ';', only the part before
38 that will be displayed in the listbox, but all of it used for search.
40 Lines starting with ';' will be ignored.
43 class WXDLLEXPORT wxHTMLHelpControllerBase
: public wxHelpControllerBase
45 DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase
)
47 wxHTMLHelpControllerBase(void);
48 virtual ~wxHTMLHelpControllerBase(void);
50 /** This must be called to tell the controller where to find the
52 If a locale is set, look in file/localename, i.e.
53 If passed "/usr/local/myapp/help" and the current wxLocale is
54 set to be "de", then look in "/usr/local/myapp/help/de/"
55 first and fall back to "/usr/local/myapp/help" if that
58 @param file - NOT a filename, but a directory name.
59 @return true on success
61 virtual bool Initialize(const wxString
& dir
, int WXUNUSED(server
))
62 { return Initialize(dir
); }
64 /** This must be called to tell the controller where to find the
66 If a locale is set, look in file/localename, i.e.
67 If passed "/usr/local/myapp/help" and the current wxLocale is
68 set to be "de", then look in "/usr/local/myapp/help/de/"
69 first and fall back to "/usr/local/myapp/help" if that
71 @param dir - directory name where to fine the help files
72 @return true on success
74 virtual bool Initialize(const wxString
& dir
);
76 /** If file is "", reloads file given in Initialize.
77 @file Name of help directory.
78 @return true on success
80 virtual bool LoadFile(const wxString
& file
= "");
82 /** Display list of all help entries.
83 @return true on success
85 virtual bool DisplayContents(void);
86 /** Display help for id sectionNo.
87 @return true on success
89 virtual bool DisplaySection(int sectionNo
);
90 /** Display help for id sectionNo -- identical with DisplaySection().
91 @return true on success
93 virtual bool DisplaySection(const wxString
& section
);
94 /** Display help for URL (using DisplayHelp) or keyword (using KeywordSearch)
95 @return true on success
97 virtual bool DisplayBlock(long blockNo
);
98 /** Search comment/documentation fields in map file and present a
100 @key k string to search for, empty string will list all entries
101 @return true on success
103 virtual bool KeywordSearch(const wxString
& k
);
106 virtual bool Quit(void);
108 virtual void OnQuit(void);
110 /// Call the browser using a relative URL.
111 virtual bool DisplayHelp(const wxString
&) = 0;
113 /// Allows one to override the default settings for the help frame.
114 virtual void SetFrameParameters(const wxString
& WXUNUSED(title
),
115 const wxSize
& WXUNUSED(size
),
116 const wxPoint
& WXUNUSED(pos
) = wxDefaultPosition
,
117 bool WXUNUSED(newFrameEachTime
) = FALSE
)
119 // does nothing by default
121 /// Obtains the latest settings used by the help frame and the help
123 virtual wxFrame
*GetFrameParameters(wxSize
*WXUNUSED(size
) = NULL
,
124 wxPoint
*WXUNUSED(pos
) = NULL
,
125 bool *WXUNUSED(newFrameEachTime
) = NULL
)
127 return (wxFrame
*) NULL
;// does nothing by default
131 /// Filename of currently active map file.
133 /// How many entries do we have in the map file?
135 /// A list containing all id,url,documentation triples.
137 /// Deletes the list and all objects.
138 void DeleteList(void);
143 #endif // __WX_HELPHTML_H_