Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

chmhtmlwindow.h

00001 /*
00002 
00003   Copyright (C) 2003  Razvan Cojocaru <razvanco@gmx.net>
00004  
00005   This program is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009   
00010   This program is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU General Public License for more details.
00014   
00015   You should have received a copy of the GNU General Public License
00016   along with this program; if not, write to the Free Software
00017   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 */
00020 
00021 
00022 #ifndef __CHMHTMLWINDOW_H_
00023 #define __CHMHTMLWINDOW_H_
00024 
00025 
00026 #include <wx/html/htmlwin.h>
00027 #include <wx/treectrl.h>
00028 #include <wx/menu.h>
00029 #include <chmfinddialog.h>
00030 
00031 
00033 enum {
00034         ID_CopySel = 1216,
00035         ID_CopyLink,
00036         ID_PopupForward,
00037         ID_PopupBack,
00038         ID_PopupFind,
00039 };
00040 
00041 
00043 class CHMFrame;
00044 
00045 
00056 class CHMHtmlWindow : public wxHtmlWindow {
00057 
00058 public:
00066         CHMHtmlWindow(wxWindow *parent, wxTreeCtrl *tc, CHMFrame* frame);
00067 
00069         ~CHMHtmlWindow();
00070 
00072         bool LoadPage(const wxString& location);
00073 
00080         void SetSync(bool value) { _syncTree = value; }
00081         
00087         bool IsCaller() const { return _found; }
00088 
00089 public:
00103         wxHtmlCell* FindFirst(wxHtmlCell* parent, const wxString& word, 
00104                               bool wholeWords, bool caseSensitive);
00105         
00110         wxHtmlCell* FindNext(wxHtmlCell *start, 
00111                              const wxString& word, bool wholeWords,
00112                              bool caseSensitive);
00113 
00115         void ClearSelection();
00116         
00117         // Needs to be public, cause I call it from CHMHtmlFrame.
00119         void OnFind(wxCommandEvent& event);
00120 
00122         void OnCopy(wxCommandEvent& event);
00123 
00124 protected:      
00126         void OnForward(wxCommandEvent& event);
00127 
00129         void OnBack(wxCommandEvent& event);
00130         
00132         void OnCopyLink(wxCommandEvent& event);
00133 
00135         void OnChar(wxKeyEvent &event);
00136 
00138         void OnSize(wxSizeEvent& event);
00139 
00140 protected:      
00142         void OnRightClick(wxMouseEvent& event);
00143 
00145         void OnLinkClicked(const wxHtmlLinkInfo& link);
00146 
00147 private:
00149         void Sync(wxTreeItemId root, const wxString& page);
00150 
00152         wxString GetPrefix(const wxString& location) const;
00153         
00154 private:
00155         wxTreeCtrl* _tcl;
00156         bool _syncTree;
00157         bool _found;
00158         wxMenu *_menu;
00159         CHMFrame *_frame;
00160         wxString _link;
00161         CHMFindDialog* _fdlg;
00162 
00163 private:
00164         DECLARE_EVENT_TABLE()
00165 };
00166 
00167 
00168 #endif // __CHMHTMLWINDOW_H_
00169 
00170 
00171 /*
00172   Local Variables:
00173   mode: c++
00174   c-basic-offset: 8
00175   tab-width: 8
00176   c-indent-comments-syntactically-p: t
00177   c-tab-always-indent: t
00178   indent-tabs-mode: t
00179   End:
00180 */
00181 
00182 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
00183 

Generated on Fri Nov 17 12:35:46 2006 for xCHM by  doxygen 1.4.4