1 /////////////////////////////////////////////////////////////////////////////
2 // Name: include/wx/msw/webviewie.h
3 // Purpose: wxMSW IE wxWebView backend
4 // Author: Marianne Gagnon
6 // Copyright: (c) 2010 Marianne Gagnon
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
16 #define wxHAVE_WEB_BACKEND_IE 1
19 #if wxHAVE_WEB_BACKEND_IE
21 #include "wx/control.h"
22 #include "wx/webview.h"
23 #include "wx/msw/ole/automtn.h"
24 #include "wx/msw/ole/activex.h"
26 class WXDLLIMPEXP_WEB wxWebViewIE
: public wxWebView
32 wxWebViewIE(wxWindow
* parent
,
34 const wxString
& url
= wxWebViewDefaultURLStr
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
38 const wxString
& name
= wxWebViewNameStr
)
40 Create(parent
, id
, url
, pos
, size
, style
, name
);
43 bool Create(wxWindow
* parent
,
45 const wxString
& url
= wxWebViewDefaultURLStr
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
49 const wxString
& name
= wxWebViewNameStr
);
51 virtual void LoadUrl(const wxString
& url
);
53 virtual bool CanGoForward() { return m_canNavigateForward
; }
54 virtual bool CanGoBack() { return m_canNavigateBack
; }
55 virtual void GoBack();
56 virtual void GoForward();
58 virtual void Reload(wxWebViewReloadFlags flags
= wxWEB_VIEW_RELOAD_DEFAULT
);
60 virtual wxString
GetPageSource();
62 virtual bool IsBusy();
63 virtual wxString
GetCurrentURL();
64 virtual wxString
GetCurrentTitle();
66 virtual void SetZoomType(wxWebViewZoomType
);
67 virtual wxWebViewZoomType
GetZoomType() const;
68 virtual bool CanSetZoomType(wxWebViewZoomType
) const;
72 virtual void SetPage(const wxString
& html
, const wxString
& baseUrl
);
74 virtual wxWebViewZoom
GetZoom();
75 virtual void SetZoom(wxWebViewZoom zoom
);
77 // ---- IE-specific methods
79 // FIXME: I seem to be able to access remote webpages even in offline mode...
81 void SetOfflineMode(bool offline
);
85 * @return text zoom from 0 to 4
92 void SetIETextZoom(int level
);
94 void SetIEOpticalZoom(float zoom
);
95 float GetIEOpticalZoom();
97 void onActiveXEvent(wxActiveXEvent
& evt
);
98 void onEraseBg(wxEraseEvent
& evt
) {}
100 DECLARE_EVENT_TABLE();
103 wxActiveXContainer
* m_container
;
104 wxAutomationObject m_ie
;
105 IWebBrowser2
* m_webBrowser
;
107 bool m_canNavigateBack
;
108 bool m_canNavigateForward
;
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.
117 #endif // wxHAVE_WEB_BACKEND_IE
119 #endif // wxWebViewIE_H