Moved wxHtmlHelpFrame functionality to wxHtmlHelpWindow to allow
[wxWidgets.git] / include / wx / html / helpdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: helpdlg.h
3 // Purpose: wxHtmlHelpDialog
4 // Notes: Based on htmlhelp.cpp, implementing a monolithic
5 // HTML Help controller class, by Vaclav Slavik
6 // Author: Harm van der Heijden, Vaclav Slavik, Julian Smart
7 // RCS-ID: $Id$
8 // Copyright: (c) Harm van der Heijden, Vaclav Slavik, Julian Smart
9 // Licence: wxWidgets licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_HELPDLG_H_
13 #define _WX_HELPDLG_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "helpdlgex.h"
17 #endif
18
19 #include "wx/defs.h"
20
21 #if wxUSE_WXHTML_HELP
22
23 #include "wx/html/helpdata.h"
24 #include "wx/window.h"
25 #include "wx/frame.h"
26 #include "wx/config.h"
27 #include "wx/splitter.h"
28 #include "wx/notebook.h"
29 #include "wx/listbox.h"
30 #include "wx/choice.h"
31 #include "wx/combobox.h"
32 #include "wx/checkbox.h"
33 #include "wx/stattext.h"
34 #include "wx/html/htmlwin.h"
35 #include "wx/html/helpwin.h"
36 #include "wx/html/htmprint.h"
37
38 class WXDLLIMPEXP_HTML wxHtmlHelpController;
39 class WXDLLIMPEXP_HTML wxHtmlHelpWindow;
40
41 class WXDLLIMPEXP_HTML wxHtmlHelpDialog : public wxDialog
42 {
43 DECLARE_DYNAMIC_CLASS(wxHtmlHelpDialog)
44
45 public:
46 wxHtmlHelpDialog(wxHtmlHelpData* data = NULL) { Init(data); }
47 wxHtmlHelpDialog(wxWindow* parent, wxWindowID wxWindowID,
48 const wxString& title = wxEmptyString,
49 int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL);
50 ~wxHtmlHelpDialog();
51
52 bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
53 int style = wxHF_DEFAULT_STYLE);
54
55 /// Returns the data associated with this dialog.
56 wxHtmlHelpData* GetData() { return m_Data; }
57
58 /// Returns the controller that created this dialog.
59 wxHtmlHelpController* GetController() const { return m_helpController; }
60
61 /// Sets the controller associated with this dialog.
62 void SetController(wxHtmlHelpController* controller) { m_helpController = controller; }
63
64 /// Returns the help window.
65 wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
66
67 // Sets format of title of the frame. Must contain exactly one "%s"
68 // (for title of displayed HTML page)
69 void SetTitleFormat(const wxString& format);
70
71 // Override to add custom buttons to the toolbar
72 virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {};
73
74 protected:
75 void Init(wxHtmlHelpData* data = NULL);
76
77 void OnCloseWindow(wxCloseEvent& event);
78
79 protected:
80 // Temporary pointer to pass to window
81 wxHtmlHelpData* m_Data;
82 wxString m_TitleFormat; // title of the help frame
83 wxHtmlHelpWindow *m_HtmlHelpWin;
84 wxHtmlHelpController* m_helpController;
85
86 DECLARE_EVENT_TABLE()
87 DECLARE_NO_COPY_CLASS(wxHtmlHelpDialog)
88 };
89
90 #endif
91 // wxUSE_WXHTML_HELP
92
93 #endif
94