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 /////////////////////////////////////////////////////////////////////////////
15 #if wxHAVE_WEB_BACKEND_IE
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 // TODO: move this to wx/msw/chkconf.h
23 #if wxUSE_ACTIVEX != 1
24 #error "wxUSE_ACTIVEX must be activated for this to work"
27 #if wxUSE_OLE_AUTOMATION != 1
28 #error "wxUSE_OLE_AUTOMATION must be activated for this to work"
31 // FIXME: get those DLL export macros right...
33 class WXDLLIMPEXP_WEB wxWebViewIE
: public wxWebView
39 wxWebViewIE(wxWindow
* parent
,
41 const wxString
& url
= wxWebViewDefaultURLStr
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
45 const wxString
& name
= wxWebViewNameStr
)
47 Create(parent
, id
, url
, pos
, size
, style
, name
);
50 bool Create(wxWindow
* parent
,
52 const wxString
& url
= wxWebViewDefaultURLStr
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
56 const wxString
& name
= wxWebViewNameStr
);
58 virtual void LoadUrl(const wxString
& url
);
60 virtual bool CanGoForward() { return m_canNavigateForward
; }
61 virtual bool CanGoBack() { return m_canNavigateBack
; }
62 virtual void GoBack();
63 virtual void GoForward();
65 virtual void Reload(wxWebViewReloadFlags flags
=0);
67 virtual wxString
GetPageSource();
69 virtual bool IsBusy();
70 virtual wxString
GetCurrentURL();
71 virtual wxString
GetCurrentTitle();
73 virtual void SetZoomType(wxWebViewZoomType
);
74 virtual wxWebViewZoomType
GetZoomType() const;
75 virtual bool CanSetZoomType(wxWebViewZoomType
) const;
79 virtual void SetPage(const wxString
& html
, const wxString
& baseUrl
);
81 virtual wxWebViewZoom
GetZoom();
82 virtual void SetZoom(wxWebViewZoom zoom
);
84 // ---- IE-specific methods
86 // FIXME: I seem to be able to access remote webpages even in offline mode...
88 void SetOfflineMode(bool offline
);
92 * @return text zoom from 0 to 4
99 void SetIETextZoom(int level
);
101 void SetIEOpticalZoom(float zoom
);
102 float GetIEOpticalZoom();
104 void onActiveXEvent(wxActiveXEvent
& evt
);
105 void onEraseBg(wxEraseEvent
& evt
) {}
107 DECLARE_EVENT_TABLE();
110 wxActiveXContainer
* m_container
;
111 wxAutomationObject m_ie
;
112 IWebBrowser2
* m_webBrowser
;
114 bool m_canNavigateBack
;
115 bool m_canNavigateForward
;
117 /** The "Busy" property of IWebBrowser2 does not always return busy when
118 * we'd want it to; this variable may be set to true in cases where the
119 * Busy property is false but should be true.
124 #endif // wxHAVE_WEB_BACKEND_IE
126 #endif // wxWebViewIE_H