1 /*-*- c++ -*-********************************************************
2 * exthlp.h - an external help controller for wxWindows *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
14 # pragma interface "wxexthlp.h"
17 #include "wx/generic/helphtml.h"
19 #ifndef WXEXTHELP_DEFAULTBROWSER
20 /// Default browser name.
21 # define WXEXTHELP_DEFAULTBROWSER "netscape"
22 /// Is default browse a variant of netscape?
23 # define WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE TRUE
25 /// Name of environment variable to set help browser.
26 #define WXEXTHELP_ENVVAR_BROWSER "WX_HELPBROWSER"
27 /// Is browser a netscape browser?
28 #define WXEXTHELP_ENVVAR_BROWSERISNETSCAPE "WX_HELPBROWSER_NS"
31 This class implements help via an external browser.
32 It requires the name of a directory containing the documentation
33 and a file mapping numerical Section numbers to relative URLS.
35 The map file contains two or three fields per line:
36 numeric_id relative_URL [; comment/documentation]
38 The numeric_id is the id used to look up the entry in
39 DisplaySection()/DisplayBlock(). The relative_URL is a filename of
40 an html file, relative to the help directory. The optional
41 comment/documentation field (after a ';') is used for keyword
42 searches, so some meaningful text here does not hurt.
43 If the documentation itself contains a ';', only the part before
44 that will be displayed in the listbox, but all of it used for search.
46 Lines starting with ';' will be ignored.
49 class wxExtHelpController
: public wxHTMLHelpControllerBase
51 DECLARE_CLASS(wxExtHelpController
)
53 wxExtHelpController(void);
55 /** Tell it which browser to use.
56 The Netscape support will check whether Netscape is already
57 running (by looking at the .netscape/lock file in the user's
58 home directory) and tell it to load the page into the existing
60 @param browsername The command to call a browser/html viewer.
61 @param isNetscape Set this to TRUE if the browser is some variant of Netscape.
64 void SetBrowser(wxString
const & browsername
= WXEXTHELP_DEFAULTBROWSER
,
65 bool isNetscape
= WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE
);
67 // Set viewer: new name for SetBrowser
68 virtual void SetViewer(const wxString
& viewer
= WXEXTHELP_DEFAULTBROWSER
, long flags
= wxHELP_NETSCAPE
);
71 /// How to call the html viewer.
72 wxString m_BrowserName
;
73 /// Is the viewer a variant of netscape?
74 bool m_BrowserIsNetscape
;
75 /// Call the browser using a relative URL.
76 bool DisplayHelp(wxString
const &);