Rename source files for consistency
[wxWidgets.git] / include / wx / msw / webview_ie.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: include/wx/msw/webviewie.h
3 // Purpose: wxMSW IE wxWebView backend
4 // Author: Marianne Gagnon
5 // Id: $Id$
6 // Copyright: (c) 2010 Marianne Gagnon
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef wxWebViewIE_H
11 #define wxWebViewIE_H
12
13 #include "wx/setup.h"
14
15 #ifdef __WXMSW__
16 #define wxHAVE_WEB_BACKEND_IE 1
17 #endif
18
19 #if wxHAVE_WEB_BACKEND_IE
20
21 #include "wx/control.h"
22 #include "wx/webview.h"
23 #include "wx/msw/ole/automtn.h"
24 #include "wx/msw/ole/activex.h"
25
26 class WXDLLIMPEXP_WEB wxWebViewIE : public wxWebView
27 {
28 public:
29
30 wxWebViewIE() {}
31
32 wxWebViewIE(wxWindow* parent,
33 wxWindowID id,
34 const wxString& url = wxWebViewDefaultURLStr,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = 0,
38 const wxString& name = wxWebViewNameStr)
39 {
40 Create(parent, id, url, pos, size, style, name);
41 }
42
43 bool Create(wxWindow* parent,
44 wxWindowID id,
45 const wxString& url = wxWebViewDefaultURLStr,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = 0,
49 const wxString& name = wxWebViewNameStr);
50
51 virtual void LoadUrl(const wxString& url);
52
53 virtual bool CanGoForward() { return m_canNavigateForward; }
54 virtual bool CanGoBack() { return m_canNavigateBack; }
55 virtual void GoBack();
56 virtual void GoForward();
57 virtual void Stop();
58 virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
59
60 virtual wxString GetPageSource();
61
62 virtual bool IsBusy();
63 virtual wxString GetCurrentURL();
64 virtual wxString GetCurrentTitle();
65
66 virtual void SetZoomType(wxWebViewZoomType);
67 virtual wxWebViewZoomType GetZoomType() const;
68 virtual bool CanSetZoomType(wxWebViewZoomType) const;
69
70 virtual void Print();
71
72 virtual void SetPage(const wxString& html, const wxString& baseUrl);
73
74 virtual wxWebViewZoom GetZoom();
75 virtual void SetZoom(wxWebViewZoom zoom);
76
77 // ---- IE-specific methods
78
79 // FIXME: I seem to be able to access remote webpages even in offline mode...
80 bool IsOfflineMode();
81 void SetOfflineMode(bool offline);
82
83 /**
84 * Get text zoom
85 * @return text zoom from 0 to 4
86 */
87 int GetIETextZoom();
88
89 /**
90 * @param level 0 to 4
91 */
92 void SetIETextZoom(int level);
93
94 void SetIEOpticalZoom(float zoom);
95 float GetIEOpticalZoom();
96
97 void onActiveXEvent(wxActiveXEvent& evt);
98 void onEraseBg(wxEraseEvent& evt) {}
99
100 DECLARE_EVENT_TABLE();
101
102 private:
103 wxActiveXContainer* m_container;
104 wxAutomationObject m_ie;
105 IWebBrowser2* m_webBrowser;
106 DWORD m_dwCookie;
107 bool m_canNavigateBack;
108 bool m_canNavigateForward;
109
110 /** The "Busy" property of IWebBrowser2 does not always return busy when
111 * we'd want it to; this variable may be set to true in cases where the
112 * Busy property is false but should be true.
113 */
114 bool m_isBusy;
115 };
116
117 #endif // wxHAVE_WEB_BACKEND_IE
118
119 #endif // wxWebViewIE_H