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