]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxGUIHtmlBrowser.h
885dad03481f2aada0ca11c2447042269c1e7136
[bbtk.git] / kernel / src / bbtkWxGUIHtmlBrowser.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkWxGUIHtmlBrowser.h,v $
5   Language:  C++
6   Date:      $Date: 2008/03/20 09:51:29 $
7   Version:   $Revision: 1.1 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*//**
18  * \brief Short description in one line
19  * 
20  * Long description which 
21  * can span multiple lines
22  */
23 /**
24  * \file 
25  * \brief 
26  */
27 /**
28  * \class bbtk::
29  * \brief 
30  */
31
32 #ifdef _USE_WXWIDGETS_
33
34
35 #ifndef __bbtkWxGUIHtmlBrowser_h_INCLUDED__
36 #define __bbtkWxGUIHtmlBrowser_h_INCLUDED__
37
38 #include "bbtkWx.h"
39 #include <wx/html/htmlwin.h>
40
41 namespace bbtk
42 {
43
44   class WxGUIHtmlBrowser;
45
46   class WxHtmlWindow : public virtual wxHtmlWindow
47   {
48   public:
49     WxHtmlWindow( wxWindow *parent, int id, WxGUIHtmlBrowser* browser, wxSize size) 
50       : wxHtmlWindow(parent, id, 
51                      wxDefaultPosition, 
52                      size,
53                      wxHW_SCROLLBAR_AUTO, 
54                   _T("bbtk::WxGUIHtmlBrowser")),
55               mBrowser(browser)
56     {
57      
58     }
59     //    wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,const wxString& url, wxString *redirect);
60 //EED    virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
61
62   private: 
63     WxGUIHtmlBrowser* mBrowser;
64
65
66   };
67
68   /*
69   /// Abstract class which defines the callbacks invoked by WxGUIHtmlBrowser
70   class WxGUIHtmlBrowserUser 
71   {
72   public :
73     WxGUIHtmlBrowserUser() {}
74     ~WxGUIHtmlBrowserUser() {}
75   };
76   */
77  
78
79   // class WxGUIConsole;
80
81   
82   class WxGUIHtmlBrowser : public wxPanel
83   {
84   public:
85     WxGUIHtmlBrowser ( wxWindow *parent, wxSize size ); 
86     //                 WxGUIHtmlBrowserUser* = 0 );
87  
88     bool GoTo(std::string&);
89     void GoHome();
90
91     void OnBackButton(wxCommandEvent& );
92     void OnForwardButton(wxCommandEvent& );
93     void OnHomeButton(wxCommandEvent& );
94     void OnReloadButton(wxCommandEvent& );
95     //   void OnRunButton(wxCommandEvent& );
96     void OnLinkClicked(wxHtmlLinkEvent& );
97     void OnURLEnter( wxCommandEvent&);
98     void UpdateURL();
99     //  void OnCell(wxHtmlCellEvent& );
100
101     void SetSize( wxSize );
102
103     std::string GetCurrentPage();
104
105   private:
106     WxHtmlWindow* mwxHtmlWindow;
107     wxTextCtrl* mwxURL;
108     wxButton* mwxBackButton;
109     wxButton* mwxForwardButton;
110     wxButton* mwxHomeButton;
111     wxButton* mwxReloadButton;
112     //    wxButton* mwxRunButton;
113     
114     //  WxGUIHtmlBrowserUser* mUser;
115     
116    // any class wishing to process wxWidgets events must use this macro
117     DECLARE_EVENT_TABLE()  
118   };
119
120 }
121 #endif
122
123 #endif