]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/helpchm.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / msw / helpchm.h
CommitLineData
f6bcfd97 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/msw/helpchm.h
f6bcfd97
BP
3// Purpose: Help system: MS HTML Help implementation
4// Author: Julian Smart
5// Modified by:
6// Created: 16/04/2000
f6bcfd97 7// Copyright: (c) Julian Smart
59af881e 8// Licence: wxWindows licence
f6bcfd97
BP
9/////////////////////////////////////////////////////////////////////////////
10
0016bb3b
VZ
11#ifndef _WX_MSW_HELPCHM_H_
12#define _WX_MSW_HELPCHM_H_
f6bcfd97 13
3295e238 14#if wxUSE_MS_HTML_HELP
f6bcfd97
BP
15
16#include "wx/helpbase.h"
17
53a2db12 18class WXDLLIMPEXP_CORE wxCHMHelpController : public wxHelpControllerBase
f6bcfd97 19{
f6bcfd97 20public:
3db52265 21 wxCHMHelpController(wxWindow* parentWindow = NULL): wxHelpControllerBase(parentWindow) { }
3295e238 22
f6bcfd97
BP
23 // Must call this to set the filename
24 virtual bool Initialize(const wxString& file);
0e4acbd4 25 virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); }
3295e238 26
f6bcfd97
BP
27 // If file is "", reloads file given in Initialize
28 virtual bool LoadFile(const wxString& file = wxEmptyString);
29 virtual bool DisplayContents();
30 virtual bool DisplaySection(int sectionNo);
31 virtual bool DisplaySection(const wxString& section);
32 virtual bool DisplayBlock(long blockNo);
5100cabf
JS
33 virtual bool DisplayContextPopup(int contextId);
34 virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
69b5cec2
VS
35 virtual bool KeywordSearch(const wxString& k,
36 wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
f6bcfd97
BP
37 virtual bool Quit();
38
3295e238
VZ
39 wxString GetHelpFile() const { return m_helpFile; }
40
392c5133
VZ
41 // helper of DisplayTextPopup(), also used in wxSimpleHelpProvider::ShowHelp
42 static bool ShowContextHelpPopup(const wxString& text,
43 const wxPoint& pos,
44 wxWindow *window);
45
f6bcfd97 46protected:
0016bb3b
VZ
47 // get the name of the CHM file we use from our m_helpFile
48 wxString GetValidFilename() const;
49
50 // Call HtmlHelp() with the provided parameters (both overloads do the same
51 // thing but allow to avoid casts in the calling code) and return false
52 // (but don't crash) if HTML help is unavailable
53 static bool CallHtmlHelp(wxWindow *win, const wxChar *str,
54 unsigned cmd, WXWPARAM param);
55 static bool CallHtmlHelp(wxWindow *win, const wxChar *str,
56 unsigned cmd, const void *param = NULL)
57 {
5c33522f 58 return CallHtmlHelp(win, str, cmd, reinterpret_cast<WXWPARAM>(param));
0016bb3b
VZ
59 }
60
61 // even simpler wrappers using GetParentWindow() and GetValidFilename() as
62 // the first 2 HtmlHelp() parameters
63 bool CallHtmlHelp(unsigned cmd, WXWPARAM param)
64 {
017dc06b 65 return CallHtmlHelp(GetParentWindow(), GetValidFilename().t_str(),
0016bb3b
VZ
66 cmd, param);
67 }
68
69 bool CallHtmlHelp(unsigned cmd, const void *param = NULL)
70 {
5c33522f 71 return CallHtmlHelp(cmd, reinterpret_cast<WXWPARAM>(param));
0016bb3b
VZ
72 }
73
74 // wrapper around CallHtmlHelp(HH_DISPLAY_TEXT_POPUP): only one of text and
75 // contextId parameters can be non-NULL/non-zero
76 static bool DoDisplayTextPopup(const wxChar *text,
77 const wxPoint& pos,
78 int contextId,
79 wxWindow *window);
80
3295e238 81
f6bcfd97 82 wxString m_helpFile;
3295e238 83
80e2b031 84 DECLARE_DYNAMIC_CLASS(wxCHMHelpController)
f6bcfd97
BP
85};
86
3295e238
VZ
87#endif // wxUSE_MS_HTML_HELP
88
0016bb3b 89#endif // _WX_MSW_HELPCHM_H_