1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common interface and events for web view component
4 // Author: Marianne Gagnon
6 // Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
15 #if defined(__BORLANDC__)
19 #include "wx/webview.h"
21 #include "wx/osx/webview_webkit.h"
22 #include "wx/gtk/webview_webkit.h"
23 #include "wx/msw/webview_ie.h"
25 // DLL options compatibility check:
27 WX_CHECK_BUILD_OPTIONS("wxWEBVIEW")
29 extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewNameStr
[] = "wxWebView";
30 extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewDefaultURLStr
[] = "about:blank";
32 wxIMPLEMENT_ABSTRACT_CLASS(wxWebView
, wxControl
);
33 wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewEvent
, wxCommandEvent
);
35 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATING
, wxWebViewEvent
);
36 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATED
, wxWebViewEvent
);
37 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_LOADED
, wxWebViewEvent
);
38 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_ERROR
, wxWebViewEvent
);
39 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NEWWINDOW
, wxWebViewEvent
);
40 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED
, wxWebViewEvent
);
43 wxWebView
* wxWebView::New(wxWebViewBackend backend
)
47 #if defined(wxUSE_WEBVIEW_WEBKIT) && \
48 (defined(__WXGTK__) || defined(__WXOSX__))
49 case wxWEB_VIEW_BACKEND_WEBKIT
:
50 return new wxWebViewWebKit();
54 case wxWEB_VIEW_BACKEND_IE
:
55 return new wxWebViewIE();
58 case wxWEB_VIEW_BACKEND_DEFAULT
:
60 #if defined(wxUSE_WEBVIEW_WEBKIT) && \
61 (defined(__WXGTK__) || defined(__WXOSX__))
62 return new wxWebViewWebKit();
66 return new wxWebViewIE();
69 // fall-through intended
76 wxWebView
* wxWebView::New(wxWindow
* parent
,
81 wxWebViewBackend backend
,
87 #if defined(wxUSE_WEBVIEW_WEBKIT) && \
88 (defined(__WXGTK__) || defined(__WXOSX__))
89 case wxWEB_VIEW_BACKEND_WEBKIT
:
90 return new wxWebViewWebKit(parent
, id
, url
, pos
, size
, style
, name
);
94 case wxWEB_VIEW_BACKEND_IE
:
95 return new wxWebViewIE(parent
, id
, url
, pos
, size
, style
, name
);
98 case wxWEB_VIEW_BACKEND_DEFAULT
:
100 #if defined(wxUSE_WEBVIEW_WEBKIT) && \
101 (defined(__WXGTK__) || defined(__WXOSX__))
102 return new wxWebViewWebKit(parent
, id
, url
, pos
, size
, style
, name
);
106 return new wxWebViewIE(parent
, id
, url
, pos
, size
, style
, name
);
109 // fall-through intended
115 #endif // wxUSE_WEBVIEW