chmhtmlnotebook.h

00001 /*
00002 
00003   Copyright (C) 2003  Razvan Cojocaru <razvanco@gmx.net>
00004   Tabbed browsing support developed by Cedric Boudinet <bouced@gmx.fr>
00005   (this file originally written by Cedric Boudinet)
00006  
00007   This program is free software; you can redistribute it and/or modify
00008   it under the terms of the GNU General Public License as published by
00009   the Free Software Foundation; either version 2 of the License, or
00010   (at your option) any later version.
00011   
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015   GNU General Public License for more details.
00016   
00017   You should have received a copy of the GNU General Public License
00018   along with this program; if not, write to the Free Software
00019   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00020   MA 02110-1301, USA.
00021 
00022 */
00023 
00024 #ifndef __CHMHTMLNOTEBOOK_H_
00025 #define __CHMHTMLNOTEBOOK_H_
00026 
00027 #include <wx/aui/auibook.h>
00028 #include <wx/treectrl.h>
00029 
00030 
00031 enum {
00032         ID_NextPage,
00033         ID_PriorPage,
00034 };
00035 
00036 // Forward declarations
00037 class CHMFrame;
00038 class CHMHtmlWindow;
00039 
00040 
00049 class CHMHtmlNotebook : public wxAuiNotebook {
00050 
00051 public:
00053         CHMHtmlNotebook(wxWindow *parent, wxTreeCtrl *tc, CHMFrame* frame);
00054 
00056         void AddHtmlView(const wxString& path,
00057                          const wxString& link);
00058 
00060         bool LoadPageInCurrentView(const wxString& location);
00061 
00063         CHMHtmlWindow* GetCurrentPage();
00064 
00066         void OnChildrenTitleChanged(const wxString& title);
00067 
00069         void CloseAllPagesExceptFirst();
00070 
00072         void SetChildrenFonts(const wxString& normal_face, 
00073                               const wxString& fixed_face, 
00074                               const int *sizes = NULL);
00075 
00077         void OnCloseTab(wxCommandEvent&);
00078 
00080         void OnNewTab(wxCommandEvent& event);
00081 
00083         CHMHtmlWindow* CreateView();
00084 
00086         virtual bool AddPage(wxWindow* page, const wxString& title);
00087 
00088 protected:
00090         void OnGoToNextPage(wxCommandEvent&);
00091 
00093         void OnGoToPriorPage(wxCommandEvent&);
00094 
00096         void OnPageChanged(wxAuiNotebookEvent&);
00097 
00098 private:
00099         wxTreeCtrl* _tcl;
00100         CHMFrame *_frame;
00101         wxString _fonts_normal_face;
00102         wxString _fonts_fixed_face;
00103         int _fonts_sizes[7];
00104         DECLARE_EVENT_TABLE()
00105 };
00106 
00107 
00108 #endif // __CHMHTMLNOTEBOOK_H_
00109 
00110 
00111 /*
00112   Local Variables:
00113   mode: c++
00114   c-basic-offset: 8
00115   tab-width: 8
00116   c-indent-comments-syntactically-p: t
00117   c-tab-always-indent: t
00118   indent-tabs-mode: t
00119   End:
00120 */
00121 
00122 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
00123 
00124 

Generated on Tue Apr 14 19:43:38 2009 for xCHM by  doxygen 1.5.4