xCHM  1.23
chmhtmlnotebook.h
1 /*
2 
3  Copyright (C) 2003 - 2013 Razvan Cojocaru <rzvncj@gmail.com>
4  Tabbed browsing support developed by Cedric Boudinet <bouced@gmx.fr>
5  (this file originally written by Cedric Boudinet)
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20  MA 02110-1301, USA.
21 
22 */
23 
24 #ifndef __CHMHTMLNOTEBOOK_H_
25 #define __CHMHTMLNOTEBOOK_H_
26 
27 #include <wx/aui/auibook.h>
28 #include <wx/treectrl.h>
29 
30 
31 enum {
32  ID_NextPage,
33  ID_PriorPage,
34 };
35 
36 // Forward declarations
37 class CHMFrame;
39 
40 
49 class CHMHtmlNotebook : public wxAuiNotebook {
50 
51 public:
53  CHMHtmlNotebook(wxWindow *parent, wxTreeCtrl *tc,
54  const wxString& normalFont, const wxString& fixedFont,
55  const int fontSize, CHMFrame* frame);
56 
58  void AddHtmlView(const wxString& path,
59  const wxString& link);
60 
62  bool LoadPageInCurrentView(const wxString& location);
63 
66 
68  void OnChildrenTitleChanged(const wxString& title);
69 
72 
74  void SetChildrenFonts(const wxString& normal_face,
75  const wxString& fixed_face,
76  const int *sizes = NULL);
77 
79  void OnCloseTab(wxCommandEvent&);
80 
82  void OnNewTab(wxCommandEvent& event);
83 
86 
88  virtual bool AddPage(wxWindow* page, const wxString& title);
89 
90 protected:
92  void OnGoToNextPage(wxCommandEvent&);
93 
95  void OnGoToPriorPage(wxCommandEvent&);
96 
98  void OnPageChanged(wxAuiNotebookEvent&);
99 
100 private:
101  wxTreeCtrl* _tcl;
102  CHMFrame *_frame;
103  wxString _fonts_normal_face;
104  wxString _fonts_fixed_face;
105  int _fonts_sizes[7];
106  DECLARE_EVENT_TABLE()
107 };
108 
109 
110 #endif // __CHMHTMLNOTEBOOK_H_
111 
112 
113 /*
114  Local Variables:
115  mode: c++
116  c-basic-offset: 8
117  tab-width: 8
118  c-indent-comments-syntactically-p: t
119  c-tab-always-indent: t
120  indent-tabs-mode: t
121  End:
122 */
123 
124 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
125 
126 
void OnGoToNextPage(wxCommandEvent &)
Called when user asks for next notebook page.
Definition: chmhtmlnotebook.cpp:98
void OnGoToPriorPage(wxCommandEvent &)
Called when user asks for prior notebook page.
Definition: chmhtmlnotebook.cpp:109
bool LoadPageInCurrentView(const wxString &location)
Displays the URL in the current tab.
Definition: chmhtmlnotebook.cpp:79
Custom HTML widget class. Needed for sychnronization between the topics tree control and the currentl...
Definition: chmhtmlwindow.h:62
virtual bool AddPage(wxWindow *page, const wxString &title)
Overload for tab height control.
Definition: chmhtmlnotebook.cpp:176
CHMHtmlWindow * GetCurrentPage()
Returns the current page as a CHMHtmlWindow.
Definition: chmhtmlnotebook.cpp:86
void CloseAllPagesExceptFirst()
Close all pages except the first one.
Definition: chmhtmlnotebook.cpp:143
void OnCloseTab(wxCommandEvent &)
Called when user asks for a tab to close.
Definition: chmhtmlnotebook.cpp:120
void OnPageChanged(wxAuiNotebookEvent &)
Callback for the page changed wxWidgets event.
Definition: chmhtmlnotebook.cpp:190
void OnNewTab(wxCommandEvent &event)
Called when user ask for a new tab.
Definition: chmhtmlnotebook.cpp:129
Custom HTML notebook widget class. For tabbed viewing of a CHM file.
Definition: chmhtmlnotebook.h:49
void AddHtmlView(const wxString &path, const wxString &link)
Add a notebook tab and display the specified URL.
Definition: chmhtmlnotebook.cpp:67
The frame, owner of the wxHtmlWindow, contents tree control and all the other nifty stuff...
Definition: chmframe.h:97
void SetChildrenFonts(const wxString &normal_face, const wxString &fixed_face, const int *sizes=NULL)
Propagate font settings to the children.
Definition: chmhtmlnotebook.cpp:154
CHMHtmlNotebook(wxWindow *parent, wxTreeCtrl *tc, const wxString &normalFont, const wxString &fixedFont, const int fontSize, CHMFrame *frame)
Constructor.
Definition: chmhtmlnotebook.cpp:30
CHMHtmlWindow * CreateView()
Creates a new tab view.
Definition: chmhtmlnotebook.cpp:54
void OnChildrenTitleChanged(const wxString &title)
Callback for when a child&#39;s title changes.
Definition: chmhtmlnotebook.cpp:135