]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/helpext.h
char handling fixed again
[wxWidgets.git] / include / wx / generic / helpext.h
1 /*-*- c++ -*-********************************************************
2 * exthlp.h - an external help controller for wxWindows *
3 * *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
5 * *
6 * $Id$
7 *******************************************************************/
8 #ifndef WXXHELP_H
9 #define WXXHELP_H
10
11 #if wxUSE_HELP
12
13 #ifdef __GNUG__
14 # pragma interface "wxexthlp.h"
15 #endif
16
17 #include "wx/generic/helphtml.h"
18
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
24 #endif
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"
29
30 /**
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.
34
35 The map file contains two or three fields per line:
36 numeric_id relative_URL [; comment/documentation]
37
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.
45
46 Lines starting with ';' will be ignored.
47 */
48
49 class wxExtHelpController : public wxHTMLHelpControllerBase
50 {
51 DECLARE_CLASS(wxExtHelpController)
52 public:
53 wxExtHelpController(void);
54
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
59 window.
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.
62 */
63 // Obsolete form
64 void SetBrowser(wxString const & browsername = WXEXTHELP_DEFAULTBROWSER,
65 bool isNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE);
66
67 // Set viewer: new name for SetBrowser
68 virtual void SetViewer(const wxString& viewer = WXEXTHELP_DEFAULTBROWSER, long flags = wxHELP_NETSCAPE);
69
70 private:
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 &);
77 };
78
79 #endif
80 #endif