1 /*=========================================================================
3 Module: $RCSfile: bbtkWxGUIHtmlBrowser.h,v $
5 Date: $Date: 2008/11/24 15:45:48 $
6 Version: $Revision: 1.7 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
33 * \brief Short description in one line
35 * Long description which
36 * can span multiple lines
47 #ifdef _USE_WXWIDGETS_
50 #ifndef __bbtkWxGUIHtmlBrowser_h_INCLUDED__
51 #define __bbtkWxGUIHtmlBrowser_h_INCLUDED__
54 #include <wx/html/htmlwin.h>
59 class WxGUIHtmlBrowser;
62 class WxHtmlWindow : public virtual wxHtmlWindow
65 WxHtmlWindow( wxWindow *parent, int id, WxGUIHtmlBrowser* browser, wxSize size)
66 : wxHtmlWindow(parent, id,
70 _T("bbtk::WxGUIHtmlBrowser")),
73 std::cout << "ctor"<<std::endl;
76 // wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,const wxString& url, wxString *redirect);
77 // virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
79 //EED2 void OnSize( wxSizeEvent&);
83 WxGUIHtmlBrowser* mBrowser;
85 // any class wishing to process wxWidgets events must use this macro
86 //EED2 DECLARE_EVENT_TABLE()
90 // typedef wxHtmlWindow WxHtmlWindow;
93 #define THE_HTML_WINDOW_CLASS wxHtmlWindow
95 /// Abstract class which defines the callbacks invoked by WxGUIHtmlBrowser
96 class WxGUIHtmlBrowserUser
99 WxGUIHtmlBrowserUser() {}
100 virtual ~WxGUIHtmlBrowserUser() {}
102 virtual bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
108 // class WxGUIConsole;
111 class BBTK_EXPORT WxGUIHtmlBrowser : public wxPanel
114 WxGUIHtmlBrowser ( wxWindow *parent, wxSize size,
115 WxGUIHtmlBrowserUser* = 0 );
117 bool GoTo(std::string&);
120 void OnBackButton(wxCommandEvent& );
121 void OnForwardButton(wxCommandEvent& );
122 void OnHomeButton(wxCommandEvent& );
123 void OnReloadButton(wxCommandEvent& );
124 // void OnRunButton(wxCommandEvent& );
125 void OnLinkClicked(wxHtmlLinkEvent& );
126 void OnLinkClicked2(const wxHtmlLinkInfo& );
127 void OnURLEnter( wxCommandEvent&);
128 void OnSize( wxSizeEvent&);
131 // void OnCell(wxHtmlCellEvent& );
133 void SetSize( wxSize );
135 std::string GetCurrentPage();
138 THE_HTML_WINDOW_CLASS * mwxHtmlWindow;
140 wxButton* mwxBackButton;
141 wxButton* mwxForwardButton;
142 wxButton* mwxHomeButton;
143 wxButton* mwxReloadButton;
144 // wxButton* mwxRunButton;
146 WxGUIHtmlBrowserUser* mUser;
148 // any class wishing to process wxWidgets events must use this macro
149 DECLARE_EVENT_TABLE()