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
8 // Copyright: (c) Harm van der Heijden and Vaclav Slavik
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_HELPCTRL_H_
13 #define _WX_HELPCTRL_H_
23 #include "wx/html/helpfrm.h"
25 class WXDLLEXPORT wxHtmlHelpController
: public wxEvtHandler
27 DECLARE_DYNAMIC_CLASS(wxHtmlHelpController
)
30 wxHtmlHelpController(int style
= wxHF_DEFAULTSTYLE
);
31 virtual ~wxHtmlHelpController();
33 void SetTitleFormat(const wxString
& format
);
34 void SetTempDir(const wxString
& path
) { m_helpData
.SetTempDir(path
); }
35 bool AddBook(const wxString
& book
, bool show_wait_msg
= FALSE
);
36 bool Display(const wxString
& x
)
38 CreateHelpWindow(); return m_helpFrame
->Display(x
);
42 CreateHelpWindow(); return m_helpFrame
->Display(id
);
44 bool DisplayContents()
46 CreateHelpWindow(); return m_helpFrame
->DisplayContents();
50 CreateHelpWindow(); return m_helpFrame
->DisplayIndex();
52 bool KeywordSearch(const wxString
& keyword
)
54 CreateHelpWindow(); return m_helpFrame
->KeywordSearch(keyword
);
56 wxHtmlHelpFrame
* GetFrame() { return m_helpFrame
; }
57 void UseConfig(wxConfigBase
*config
, const wxString
& rootpath
= wxEmptyString
);
59 // Assigns config object to the Ctrl. This config is then
60 // used in subsequent calls to Read/WriteCustomization of both help
61 // Ctrl and it's wxHtmlWindow
62 virtual void ReadCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
63 virtual void WriteCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
66 virtual wxHtmlHelpFrame
* CreateHelpFrame(wxHtmlHelpData
*data
);
68 virtual void CreateHelpWindow();
69 virtual void DestroyHelpWindow();
71 void OnCloseFrame(wxCloseEvent
& evt
);
72 wxHtmlHelpData m_helpData
;
73 wxHtmlHelpFrame
* m_helpFrame
;
74 wxConfigBase
*m_Config
;
75 wxString m_ConfigRoot
;
76 wxString m_titleFormat
;
83 #endif // _WX_HELPCTRL_H_