1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtmlHelpController
4 // Notes: Based on htmlhelp.cpp, implementing a monolithic
5 // HTML Help controller class, by Vaclav Slavik
6 // Author: Harm van der Heijden and Vaclav Slavik
9 // Copyright: (c) Harm van der Heijden and Vaclav Slavik
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_HELPCTRL_H_
14 #define _WX_HELPCTRL_H_
19 #pragma interface "helpctrl.h"
26 class WXDLLEXPORT wxHtmlHelpController
: public wxEvtHandler
29 wxHtmlHelpController();
30 virtual ~wxHtmlHelpController();
32 void SetTitleFormat(const wxString
& format
);
33 void SetTempDir(const wxString
& path
) { m_helpData
.SetTempDir(path
); }
34 bool AddBook(const wxString
& book
, bool show_wait_msg
= FALSE
);
35 bool Display(const wxString
& x
) {
36 CreateHelpWindow(); return m_helpFrame
->Display(x
);
38 bool Display(int id
) {
39 CreateHelpWindow(); return m_helpFrame
->Display(id
);
41 bool DisplayContents() {
42 CreateHelpWindow(); return m_helpFrame
->DisplayContents();
45 CreateHelpWindow(); return m_helpFrame
->DisplayIndex();
47 bool KeywordSearch(const wxString
& keyword
) {
48 CreateHelpWindow(); return KeywordSearch(keyword
);
50 wxHtmlHelpFrame
* GetFrame() { return m_helpFrame
; }
51 void UseConfig(wxConfigBase
*config
, const wxString
& rootpath
= wxEmptyString
) {
52 m_Config
= config
; m_ConfigRoot
= rootpath
;
53 ReadCustomization(config
, rootpath
);
55 // Assigns config object to the Ctrl. This config is then
56 // used in subsequent calls to Read/WriteCustomization of both help
57 // Ctrl and it's wxHtmlWindow
58 virtual void ReadCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
59 virtual void WriteCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
60 virtual void CreateHelpWindow(bool show_progress
= FALSE
);
61 virtual void DestroyHelpWindow() {
62 //if (m_Config) WriteCustomization(m_Config, m_ConfigRoot);
63 if (m_helpFrame
) m_helpFrame
->Destroy();
66 void OnCloseFrame(wxCloseEvent
& evt
) { m_helpFrame
= NULL
; evt
.Skip(); }
67 wxHtmlHelpData m_helpData
;
68 wxHtmlHelpFrame
* m_helpFrame
;
69 wxConfigBase
*m_Config
;
70 wxString m_ConfigRoot
;
71 wxString m_titleFormat
;
77 #endif // _WX_HELPCTRL_H_