]>
Commit | Line | Data |
---|---|---|
8ec2b484 HH |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: helpctrl.h | |
3 | // Purpose: wxHtmlHelpController | |
f42b1601 | 4 | // Notes: Based on htmlhelp.cpp, implementing a monolithic |
8ec2b484 HH |
5 | // HTML Help controller class, by Vaclav Slavik |
6 | // Author: Harm van der Heijden and Vaclav Slavik | |
69941f05 | 7 | // RCS-ID: $Id$ |
8ec2b484 | 8 | // Copyright: (c) Harm van der Heijden and Vaclav Slavik |
65571936 | 9 | // Licence: wxWindows licence |
8ec2b484 HH |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_HELPCTRL_H_ | |
13 | #define _WX_HELPCTRL_H_ | |
14 | ||
15 | #include "wx/defs.h" | |
16 | ||
3abf2c72 | 17 | #if wxUSE_WXHTML_HELP |
8ec2b484 | 18 | |
b4414c1f | 19 | #include "wx/helpbase.h" |
69b5cec2 | 20 | #include "wx/html/helpfrm.h" |
8ec2b484 | 21 | |
576507e2 VS |
22 | #define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1) |
23 | ||
6acba9a7 | 24 | class WXDLLIMPEXP_HTML wxHtmlHelpController : public wxHelpControllerBase // wxEvtHandler |
8ec2b484 | 25 | { |
97494971 VS |
26 | DECLARE_DYNAMIC_CLASS(wxHtmlHelpController) |
27 | ||
28 | public: | |
576507e2 | 29 | wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE); |
97494971 VS |
30 | virtual ~wxHtmlHelpController(); |
31 | ||
32 | void SetTitleFormat(const wxString& format); | |
33 | void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); } | |
6953da00 WS |
34 | bool AddBook(const wxString& book_url, bool show_wait_msg = false); |
35 | bool AddBook(const wxFileName& book_file, bool show_wait_msg = false); | |
5152b0e5 JS |
36 | |
37 | bool Display(const wxString& x); | |
38 | bool Display(int id); | |
39 | bool DisplayContents(); | |
40 | bool DisplayIndex(); | |
69b5cec2 VS |
41 | bool KeywordSearch(const wxString& keyword, |
42 | wxHelpSearchMode mode = wxHELP_SEARCH_ALL); | |
5152b0e5 | 43 | |
97494971 VS |
44 | wxHtmlHelpFrame* GetFrame() { return m_helpFrame; } |
45 | void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); | |
46 | ||
47 | // Assigns config object to the Ctrl. This config is then | |
48 | // used in subsequent calls to Read/WriteCustomization of both help | |
49 | // Ctrl and it's wxHtmlWindow | |
50 | virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); | |
51 | virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); | |
52 | ||
53 | //// Backward compatibility with wxHelpController API | |
54 | ||
55 | virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); } | |
56 | virtual bool Initialize(const wxString& file); | |
57 | virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} | |
2b5f62a0 | 58 | virtual bool LoadFile(const wxString& file = wxT("")); |
97494971 VS |
59 | virtual bool DisplaySection(int sectionNo); |
60 | virtual bool DisplaySection(const wxString& section) { return Display(section); } | |
61 | virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); } | |
62 | virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos); | |
63 | ||
64 | virtual void SetFrameParameters(const wxString& title, | |
65 | const wxSize& size, | |
66 | const wxPoint& pos = wxDefaultPosition, | |
6953da00 | 67 | bool newFrameEachTime = false); |
97494971 VS |
68 | /// Obtains the latest settings used by the help frame and the help |
69 | /// frame. | |
70 | virtual wxFrame *GetFrameParameters(wxSize *size = NULL, | |
71 | wxPoint *pos = NULL, | |
72 | bool *newFrameEachTime = NULL); | |
73 | ||
219a5f10 VS |
74 | // Get direct access to help data: |
75 | wxHtmlHelpData *GetHelpData() { return &m_helpData; } | |
97494971 VS |
76 | |
77 | virtual bool Quit() ; | |
6fb99eb3 | 78 | virtual void OnQuit() {} |
97494971 VS |
79 | |
80 | void OnCloseFrame(wxCloseEvent& evt); | |
81 | ||
5152b0e5 JS |
82 | // Make the help controller's frame 'modal' if |
83 | // needed | |
84 | void AddGrabIfNeeded(); | |
85 | ||
97494971 VS |
86 | protected: |
87 | virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data); | |
88 | ||
89 | virtual void CreateHelpWindow(); | |
90 | virtual void DestroyHelpWindow(); | |
91 | ||
92 | wxHtmlHelpData m_helpData; | |
93 | wxHtmlHelpFrame* m_helpFrame; | |
94 | wxConfigBase * m_Config; | |
95 | wxString m_ConfigRoot; | |
96 | wxString m_titleFormat; | |
97 | int m_FrameStyle; | |
98 | // DECLARE_EVENT_TABLE() | |
22f3361e VZ |
99 | |
100 | DECLARE_NO_COPY_CLASS(wxHtmlHelpController) | |
8ec2b484 HH |
101 | }; |
102 | ||
3abf2c72 | 103 | #endif // wxUSE_WXHTML_HELP |
8ec2b484 HH |
104 | |
105 | #endif // _WX_HELPCTRL_H_ |