Set the correct svn properties on the new files. Correct a minor date typo.
[wxWidgets.git] / src / common / webview.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: webview.cpp
3 // Purpose: Common interface and events for web view component
4 // Author: Marianne Gagnon
5 // Id: $Id$
6 // Copyright: (c) 2010 Marianne Gagnon
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #include "wx/webview.h"
11
12 #include "wx/osx/webkit.h"
13 #include "wx/gtk/webkit.h"
14 #include "wx/msw/webkitie.h"
15
16 extern WXDLLEXPORT_DATA(const char) wxWebViewNameStr[] = "wxWebView";
17 extern WXDLLEXPORT_DATA(const char) wxWebViewDefaultURLStr[] = "about:blank";
18
19 IMPLEMENT_DYNAMIC_CLASS(wxWebNavigationEvent, wxCommandEvent)
20
21 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebNavigationEvent );
22 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebNavigationEvent );
23 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebNavigationEvent );
24 wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebNavigationEvent );
25
26 // static
27 wxWebView* wxWebView::New(wxWebViewBackend backend)
28 {
29 switch (backend)
30 {
31 #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
32 case wxWEB_VIEW_BACKEND_OSX_WEBKIT:
33 return new wxOSXWebKitCtrl();
34 #endif
35
36 #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
37 case wxWEB_VIEW_BACKEND_GTK_WEBKIT:
38 return new wxGtkWebKitCtrl();
39 #endif
40
41 #if wxHAVE_WEB_BACKEND_IE
42 case wxWEB_VIEW_BACKEND_IE:
43 return new wxIEPanel();
44 #endif
45
46 case wxWEB_VIEW_BACKEND_DEFAULT:
47
48 #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
49 return new wxOSXWebKitCtrl();
50 #endif
51
52 #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
53 return new wxGtkWebKitCtrl();
54 #endif
55
56 #if wxHAVE_WEB_BACKEND_IE
57 return new wxIEPanel();
58 #endif
59
60 // fall-through intended
61 default:
62 return NULL;
63 }
64 }
65
66 // static
67 wxWebView* wxWebView::New(wxWindow* parent,
68 wxWindowID id,
69 const wxString& url,
70 const wxPoint& pos,
71 const wxSize& size,
72 wxWebViewBackend backend,
73 long style,
74 const wxString& name)
75 {
76 switch (backend)
77 {
78 #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
79 case wxWEB_VIEW_BACKEND_OSX_WEBKIT:
80 return new wxOSXWebKitCtrl(parent, id, url, pos, size, style,
81 name);
82 #endif
83
84 #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
85 case wxWEB_VIEW_BACKEND_GTK_WEBKIT:
86 return new wxGtkWebKitCtrl(parent, id, url, pos, size, style,
87 name);
88 #endif
89
90 #if wxHAVE_WEB_BACKEND_IE
91 case wxWEB_VIEW_BACKEND_IE:
92 return new wxIEPanel(parent, id, url, pos, size, style, name);
93 #endif
94
95 case wxWEB_VIEW_BACKEND_DEFAULT:
96
97 #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
98 return new wxOSXWebKitCtrl(parent, id, url, pos, size, style, name);
99 #endif
100
101 #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
102 return new wxGtkWebKitCtrl(parent, id, url, pos, size, style, name);
103 #endif
104
105 #if wxHAVE_WEB_BACKEND_IE
106 return new wxIEPanel(parent, id, url, pos, size, style, name);
107 #endif
108
109 // fall-through intended
110 default:
111 return NULL;
112 }
113 }