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 /////////////////////////////////////////////////////////////////////////////
17 #include "wx/control.h"
18 #include "wx/webview.h"
19 #include "wx/msw/ole/automtn.h"
20 #include "wx/msw/ole/activex.h"
22 class WXDLLIMPEXP_WEB wxWebViewIE
: public wxWebView
28 wxWebViewIE(wxWindow
* parent
,
30 const wxString
& url
= wxWebViewDefaultURLStr
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
34 const wxString
& name
= wxWebViewNameStr
)
36 Create(parent
, id
, url
, pos
, size
, style
, name
);
39 bool Create(wxWindow
* parent
,
41 const wxString
& url
= wxWebViewDefaultURLStr
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
45 const wxString
& name
= wxWebViewNameStr
);
47 virtual void LoadUrl(const wxString
& url
);
49 virtual bool CanGoForward() { return m_canNavigateForward
; }
50 virtual bool CanGoBack() { return m_canNavigateBack
; }
51 virtual void GoBack();
52 virtual void GoForward();
54 virtual void Reload(wxWebViewReloadFlags flags
= wxWEB_VIEW_RELOAD_DEFAULT
);
56 virtual wxString
GetPageSource();
58 virtual bool IsBusy();
59 virtual wxString
GetCurrentURL();
60 virtual wxString
GetCurrentTitle();
62 virtual void SetZoomType(wxWebViewZoomType
);
63 virtual wxWebViewZoomType
GetZoomType() const;
64 virtual bool CanSetZoomType(wxWebViewZoomType
) const;
68 virtual void SetPage(const wxString
& html
, const wxString
& baseUrl
);
70 virtual wxWebViewZoom
GetZoom();
71 virtual void SetZoom(wxWebViewZoom zoom
);
73 // ---- IE-specific methods
75 // FIXME: I seem to be able to access remote webpages even in offline mode...
77 void SetOfflineMode(bool offline
);
81 * @return text zoom from 0 to 4
88 void SetIETextZoom(int level
);
90 void SetIEOpticalZoom(float zoom
);
91 float GetIEOpticalZoom();
93 void onActiveXEvent(wxActiveXEvent
& evt
);
94 void onEraseBg(wxEraseEvent
& evt
) {}
96 DECLARE_EVENT_TABLE();
99 wxActiveXContainer
* m_container
;
100 wxAutomationObject m_ie
;
101 IWebBrowser2
* m_webBrowser
;
103 bool m_canNavigateBack
;
104 bool m_canNavigateForward
;
106 /** The "Busy" property of IWebBrowser2 does not always return busy when
107 * we'd want it to; this variable may be set to true in cases where the
108 * Busy property is false but should be true.
113 #endif // wxUSE_WEBVIEW_IE
115 #endif // wxWebViewIE_H