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"
24 #include "wx/helpbase.h"
26 class WXDLLEXPORT wxHtmlHelpController
: public wxHelpControllerBase
// wxEvtHandler
28 DECLARE_DYNAMIC_CLASS(wxHtmlHelpController
)
31 wxHtmlHelpController(int style
= wxHF_DEFAULTSTYLE
);
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
)
39 CreateHelpWindow(); return m_helpFrame
->Display(x
);
43 CreateHelpWindow(); return m_helpFrame
->Display(id
);
45 bool DisplayContents()
47 CreateHelpWindow(); return m_helpFrame
->DisplayContents();
51 CreateHelpWindow(); return m_helpFrame
->DisplayIndex();
53 bool KeywordSearch(const wxString
& keyword
)
55 CreateHelpWindow(); return m_helpFrame
->KeywordSearch(keyword
);
57 wxHtmlHelpFrame
* GetFrame() { return m_helpFrame
; }
58 void UseConfig(wxConfigBase
*config
, const wxString
& rootpath
= wxEmptyString
);
60 // Assigns config object to the Ctrl. This config is then
61 // used in subsequent calls to Read/WriteCustomization of both help
62 // Ctrl and it's wxHtmlWindow
63 virtual void ReadCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
64 virtual void WriteCustomization(wxConfigBase
*cfg
, const wxString
& path
= wxEmptyString
);
66 //// Backward compatibility with wxHelpController API
68 virtual bool Initialize(const wxString
& file
, int WXUNUSED(server
) ) { return Initialize(file
); }
69 virtual bool Initialize(const wxString
& file
);
70 virtual void SetViewer(const wxString
& WXUNUSED(viewer
), long WXUNUSED(flags
) = 0) {}
71 virtual bool LoadFile(const wxString
& file
= "");
72 virtual bool DisplaySection(int sectionNo
);
73 virtual bool DisplaySection(const wxString
& section
) { return Display(section
); }
74 virtual bool DisplayBlock(long blockNo
) { return DisplaySection(blockNo
); }
75 virtual bool DisplayTextPopup(const wxString
& text
, const wxPoint
& pos
);
77 virtual void SetFrameParameters(const wxString
& title
,
79 const wxPoint
& pos
= wxDefaultPosition
,
80 bool newFrameEachTime
= FALSE
);
81 /// Obtains the latest settings used by the help frame and the help
83 virtual wxFrame
*GetFrameParameters(wxSize
*size
= NULL
,
85 bool *newFrameEachTime
= NULL
);
87 virtual void OnQuit() {};
89 void OnCloseFrame(wxCloseEvent
& evt
);
91 virtual wxHtmlHelpFrame
* CreateHelpFrame(wxHtmlHelpData
*data
);
93 virtual void CreateHelpWindow();
94 virtual void DestroyHelpWindow();
96 wxHtmlHelpData m_helpData
;
97 wxHtmlHelpFrame
* m_helpFrame
;
98 wxConfigBase
* m_Config
;
99 wxString m_ConfigRoot
;
100 wxString m_titleFormat
;
102 // DECLARE_EVENT_TABLE()
107 #endif // _WX_HELPCTRL_H_