1 /*-*- c++ -*-********************************************************
2 * helpext.h - an external help controller for wxWindows *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
9 #ifndef __WX_HELPEXT_H_
10 #define __WX_HELPEXT_H_
15 # pragma interface "wxexthlp.h"
18 #include "wx/generic/helphtml.h"
20 #ifndef WXEXTHELP_DEFAULTBROWSER
21 /// Default browser name.
22 # define WXEXTHELP_DEFAULTBROWSER "netscape"
23 /// Is default browse a variant of netscape?
24 # define WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE TRUE
26 /// Name of environment variable to set help browser.
27 #define WXEXTHELP_ENVVAR_BROWSER "WX_HELPBROWSER"
28 /// Is browser a netscape browser?
29 #define WXEXTHELP_ENVVAR_BROWSERISNETSCAPE "WX_HELPBROWSER_NS"
32 This class implements help via an external browser.
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 WXDLLEXPORT wxExtHelpController
: public wxHTMLHelpControllerBase
52 DECLARE_CLASS(wxExtHelpController
)
54 wxExtHelpController(void);
56 /** Tell it which browser to use.
57 The Netscape support will check whether Netscape is already
58 running (by looking at the .netscape/lock file in the user's
59 home directory) and tell it to load the page into the existing
61 @param browsername The command to call a browser/html viewer.
62 @param isNetscape Set this to TRUE if the browser is some variant of Netscape.
65 void SetBrowser(wxString
const & browsername
= WXEXTHELP_DEFAULTBROWSER
,
66 bool isNetscape
= WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE
);
68 // Set viewer: new name for SetBrowser
69 virtual void SetViewer(const wxString
& viewer
= WXEXTHELP_DEFAULTBROWSER
, long flags
= wxHELP_NETSCAPE
);
72 /// How to call the html viewer.
73 wxString m_BrowserName
;
74 /// Is the viewer a variant of netscape?
75 bool m_BrowserIsNetscape
;
76 /// Call the browser using a relative URL.
77 virtual bool DisplayHelp(wxString
const &);
82 #endif // __WX_HELPEXT_H_