]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/webview_ie.h
Update msw files to use the new definitions
[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 #if wxUSE_WEBVIEW_IE
16
17 #include "wx/control.h"
18 #include "wx/webview.h"
19 #include "wx/msw/ole/automtn.h"
20 #include "wx/msw/ole/activex.h"
21
22 class WXDLLIMPEXP_WEB wxWebViewIE : public wxWebView
23 {
24 public:
25
26 wxWebViewIE() {}
27
28 wxWebViewIE(wxWindow* parent,
29 wxWindowID id,
30 const wxString& url = wxWebViewDefaultURLStr,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
33 long style = 0,
34 const wxString& name = wxWebViewNameStr)
35 {
36 Create(parent, id, url, pos, size, style, name);
37 }
38
39 bool Create(wxWindow* parent,
40 wxWindowID id,
41 const wxString& url = wxWebViewDefaultURLStr,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 long style = 0,
45 const wxString& name = wxWebViewNameStr);
46
47 virtual void LoadUrl(const wxString& url);
48
49 virtual bool CanGoForward() { return m_canNavigateForward; }
50 virtual bool CanGoBack() { return m_canNavigateBack; }
51 virtual void GoBack();
52 virtual void GoForward();
53 virtual void Stop();
54 virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
55
56 virtual wxString GetPageSource();
57
58 virtual bool IsBusy();
59 virtual wxString GetCurrentURL();
60 virtual wxString GetCurrentTitle();
61
62 virtual void SetZoomType(wxWebViewZoomType);
63 virtual wxWebViewZoomType GetZoomType() const;
64 virtual bool CanSetZoomType(wxWebViewZoomType) const;
65
66 virtual void Print();
67
68 virtual void SetPage(const wxString& html, const wxString& baseUrl);
69
70 virtual wxWebViewZoom GetZoom();
71 virtual void SetZoom(wxWebViewZoom zoom);
72
73 // ---- IE-specific methods
74
75 // FIXME: I seem to be able to access remote webpages even in offline mode...
76 bool IsOfflineMode();
77 void SetOfflineMode(bool offline);
78
79 /**
80 * Get text zoom
81 * @return text zoom from 0 to 4
82 */
83 int GetIETextZoom();
84
85 /**
86 * @param level 0 to 4
87 */
88 void SetIETextZoom(int level);
89
90 void SetIEOpticalZoom(float zoom);
91 float GetIEOpticalZoom();
92
93 void onActiveXEvent(wxActiveXEvent& evt);
94 void onEraseBg(wxEraseEvent& evt) {}
95
96 DECLARE_EVENT_TABLE();
97
98 private:
99 wxActiveXContainer* m_container;
100 wxAutomationObject m_ie;
101 IWebBrowser2* m_webBrowser;
102 DWORD m_dwCookie;
103 bool m_canNavigateBack;
104 bool m_canNavigateForward;
105
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.
109 */
110 bool m_isBusy;
111 };
112
113 #endif // wxUSE_WEBVIEW_IE
114
115 #endif // wxWebViewIE_H