]> git.saurik.com Git - wxWidgets.git/blame - include/wx/html/helpfrm.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / html / helpfrm.h
CommitLineData
8ec2b484 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/html/helpfrm.h
8ec2b484 3// Purpose: wxHtmlHelpFrame
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
8ec2b484 7// Copyright: (c) Harm van der Heijden and Vaclav Slavik
65571936 8// Licence: wxWindows licence
8ec2b484
HH
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_HELPFRM_H_
12#define _WX_HELPFRM_H_
13
8ec2b484
HH
14#include "wx/defs.h"
15
3379ed37 16#if wxUSE_WXHTML_HELP
8ec2b484 17
69b5cec2 18#include "wx/helpbase.h"
16a12a3d 19#include "wx/html/helpdata.h"
8ec2b484
HH
20#include "wx/window.h"
21#include "wx/frame.h"
22#include "wx/config.h"
23#include "wx/splitter.h"
24#include "wx/notebook.h"
25#include "wx/listbox.h"
26#include "wx/choice.h"
382e6efe 27#include "wx/combobox.h"
c4971147 28#include "wx/checkbox.h"
240c2873 29#include "wx/stattext.h"
8ec2b484 30#include "wx/html/htmlwin.h"
4e1ed07b 31#include "wx/html/helpwnd.h"
0646614d 32#include "wx/html/htmprint.h"
2b5f62a0 33
b5dbe15d
VS
34class WXDLLIMPEXP_FWD_CORE wxButton;
35class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
36class WXDLLIMPEXP_FWD_CORE wxTreeEvent;
37class WXDLLIMPEXP_FWD_CORE wxTreeCtrl;
8ec2b484 38
d5bb85a0 39
8ec2b484 40// style flags for the Help Frame
576507e2
VS
41#define wxHF_TOOLBAR 0x0001
42#define wxHF_CONTENTS 0x0002
43#define wxHF_INDEX 0x0004
44#define wxHF_SEARCH 0x0008
45#define wxHF_BOOKMARKS 0x0010
46#define wxHF_OPEN_FILES 0x0020
47#define wxHF_PRINT 0x0040
48#define wxHF_FLAT_TOOLBAR 0x0080
49#define wxHF_MERGE_BOOKS 0x0100
50#define wxHF_ICONS_BOOK 0x0200
51#define wxHF_ICONS_BOOK_CHAPTER 0x0400
52#define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default
53#define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \
54 wxHF_INDEX | wxHF_SEARCH | \
55 wxHF_BOOKMARKS | wxHF_PRINT)
56//compatibility:
57#define wxHF_OPENFILES wxHF_OPEN_FILES
58#define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR
59#define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE
8ec2b484 60
9817a085 61struct wxHtmlHelpMergedIndexItem;
08300277 62class wxHtmlHelpMergedIndex;
d5bb85a0 63
b5dbe15d
VS
64class WXDLLIMPEXP_FWD_CORE wxHelpControllerBase;
65class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController;
4f7d425f 66class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow;
b31ba288 67
6acba9a7 68class WXDLLIMPEXP_HTML wxHtmlHelpFrame : public wxFrame
8ec2b484 69{
97494971
VS
70 DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame)
71
72public:
73 wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); }
74 wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
75 const wxString& title = wxEmptyString,
b4246849
VZ
76 int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL
77#if wxUSE_CONFIG
78 , wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString
79#endif // wxUSE_CONFIG
80 );
97494971 81 bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
b4246849
VZ
82 int style = wxHF_DEFAULT_STYLE
83#if wxUSE_CONFIG
84 , wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString
85#endif // wxUSE_CONFIG
86 );
d3c7fc99 87 virtual ~wxHtmlHelpFrame();
97494971 88
3755cfa6 89 /// Returns the data associated with the window.
97494971 90 wxHtmlHelpData* GetData() { return m_Data; }
97494971 91
3755cfa6
JS
92 /// Returns the help controller associated with the window.
93 wxHtmlHelpController* GetController() const { return m_helpController; }
97494971 94
3755cfa6 95 /// Sets the help controller associated with the window.
664d1729 96 void SetController(wxHtmlHelpController* controller);
dabbc6a5 97
3755cfa6
JS
98 /// Returns the help window.
99 wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
97494971 100
3755cfa6
JS
101 // Sets format of title of the frame. Must contain exactly one "%s"
102 // (for title of displayed HTML page)
103 void SetTitleFormat(const wxString& format);
97494971 104
b4246849 105#if wxUSE_CONFIG
3755cfa6
JS
106 // For compatibility
107 void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
b4246849 108#endif // wxUSE_CONFIG
97494971 109
3755cfa6
JS
110 // Make the help controller's frame 'modal' if
111 // needed
112 void AddGrabIfNeeded();
08300277 113
3755cfa6 114 // Override to add custom buttons to the toolbar
47b378bd 115 virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {}
97494971 116
bd45b3e1
VZ
117 void SetShouldPreventAppExit(bool enable);
118
65afac3f
VZ
119 // we don't want to prevent the app from closing just because a help window
120 // remains opened
bd45b3e1 121 virtual bool ShouldPreventAppExit() const { return m_shouldPreventAppExit; }
65afac3f 122
171a1afe 123protected:
3755cfa6 124 void Init(wxHtmlHelpData* data = NULL);
97494971 125
97494971 126 void OnCloseWindow(wxCloseEvent& event);
d45bc436 127 void OnActivate(wxActivateEvent& event);
97494971 128
d9b21c9f 129#ifdef __WXMAC__
4aa31786 130 void OnClose(wxCommandEvent& event);
d9b21c9f
JS
131 void OnAbout(wxCommandEvent& event);
132#endif
133
97494971
VS
134 // Images:
135 enum {
136 IMG_Book = 0,
137 IMG_Folder,
07e252a5 138 IMG_Page
97494971
VS
139 };
140
141protected:
142 wxHtmlHelpData* m_Data;
143 bool m_DataCreated; // m_Data created by frame, or supplied?
144 wxString m_TitleFormat; // title of the help frame
3755cfa6
JS
145 wxHtmlHelpWindow *m_HtmlHelpWin;
146 wxHtmlHelpController* m_helpController;
bd45b3e1 147 bool m_shouldPreventAppExit;
d5bb85a0 148
08300277 149private:
6953da00 150
97494971 151 DECLARE_EVENT_TABLE()
c0c133e1 152 wxDECLARE_NO_COPY_CLASS(wxHtmlHelpFrame);
8ec2b484
HH
153};
154
3379ed37 155#endif // wxUSE_WXHTML_HELP
8ec2b484
HH
156
157#endif