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