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
28 DECLARE_DYNAMIC_CLASS(wxHtmlHelpController
)
31 wxHtmlHelpController();
32 virtual ~wxHtmlHelpController();
34 void SetTitleFormat(const wxString
& format
);
35 void SetTempDir(const wxString
& path
) { m_helpData
.SetTempDir(path
); }
36 bool AddBook(const wxString
& book
, bool show_wait_msg
= FALSE
);
37 bool Display(const wxString
& x
) {
38 CreateHelpWindow(); return m_helpFrame
->Display(x
);
40 bool Display(int id
) {
41 CreateHelpWindow(); return m_helpFrame
->Display(id
);
43 bool DisplayContents() {
44 CreateHelpWindow(); return m_helpFrame
->DisplayContents();
47 CreateHelpWindow(); return m_helpFrame
->DisplayIndex();
49 bool KeywordSearch(const wxString
& keyword
) {
50 CreateHelpWindow(); return KeywordSearch(keyword
);
52 wxHtmlHelpFrame
* GetFrame() { return m_helpFrame
; }
53 void UseConfig(wxConfigBase
*config
, const wxString
& rootpath
= wxEmptyString
) {
54 m_Config
= config
; m_ConfigRoot
= rootpath
;
55 ReadCustomization(config
, rootpath
);
57 // Assigns config object to the Ctrl. This config is then
58 // used in subsequent calls to Read/WriteCustomization of both help
59 // Ctrl and it's wxHtmlWindow
60 virtual void ReadCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
61 virtual void WriteCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
62 virtual void CreateHelpWindow(bool show_progress
= FALSE
);
63 virtual void DestroyHelpWindow() {
64 //if (m_Config) WriteCustomization(m_Config, m_ConfigRoot);
65 if (m_helpFrame
) m_helpFrame
->Destroy();
68 void OnCloseFrame(wxCloseEvent
& evt
) { m_helpFrame
= NULL
; evt
.Skip(); }
69 wxHtmlHelpData m_helpData
;
70 wxHtmlHelpFrame
* m_helpFrame
;
71 wxConfigBase
*m_Config
;
72 wxString m_ConfigRoot
;
73 wxString m_titleFormat
;
79 #endif // _WX_HELPCTRL_H_