]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/webviewie.h
Add the correct dll export macros
[wxWidgets.git] / include / wx / msw / webviewie.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 wxHAVE_WEB_BACKEND_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 // TODO: move this to wx/msw/chkconf.h
23 #if wxUSE_ACTIVEX != 1
24 #error "wxUSE_ACTIVEX must be activated for this to work"
25 #endif
26
27 #if wxUSE_OLE_AUTOMATION != 1
28 #error "wxUSE_OLE_AUTOMATION must be activated for this to work"
29 #endif
30
31 // FIXME: get those DLL export macros right...
32
33 class WXDLLIMPEXP_WEB wxWebViewIE : public wxWebView
34 {
35 public:
36
37 wxWebViewIE() {}
38
39 wxWebViewIE(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 Create(parent, id, url, pos, size, style, name);
48 }
49
50 bool Create(wxWindow* parent,
51 wxWindowID id,
52 const wxString& url = wxWebViewDefaultURLStr,
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize,
55 long style = 0,
56 const wxString& name = wxWebViewNameStr);
57
58 virtual void LoadUrl(const wxString& url);
59
60 virtual bool CanGoForward() { return m_canNavigateForward; }
61 virtual bool CanGoBack() { return m_canNavigateBack; }
62 virtual void GoBack();
63 virtual void GoForward();
64 virtual void Stop();
65 virtual void Reload(wxWebViewReloadFlags flags=0);
66
67 virtual wxString GetPageSource();
68
69 virtual bool IsBusy();
70 virtual wxString GetCurrentURL();
71 virtual wxString GetCurrentTitle();
72
73 virtual void SetZoomType(wxWebViewZoomType);
74 virtual wxWebViewZoomType GetZoomType() const;
75 virtual bool CanSetZoomType(wxWebViewZoomType) const;
76
77 virtual void Print();
78
79 virtual void SetPage(const wxString& html, const wxString& baseUrl);
80
81 virtual wxWebViewZoom GetZoom();
82 virtual void SetZoom(wxWebViewZoom zoom);
83
84 // ---- IE-specific methods
85
86 // FIXME: I seem to be able to access remote webpages even in offline mode...
87 bool IsOfflineMode();
88 void SetOfflineMode(bool offline);
89
90 /**
91 * Get text zoom
92 * @return text zoom from 0 to 4
93 */
94 int GetIETextZoom();
95
96 /**
97 * @param level 0 to 4
98 */
99 void SetIETextZoom(int level);
100
101 void SetIEOpticalZoom(float zoom);
102 float GetIEOpticalZoom();
103
104 void onActiveXEvent(wxActiveXEvent& evt);
105 void onEraseBg(wxEraseEvent& evt) {}
106
107 DECLARE_EVENT_TABLE();
108
109 private:
110 wxActiveXContainer* m_container;
111 wxAutomationObject m_ie;
112 IWebBrowser2* m_webBrowser;
113 DWORD m_dwCookie;
114 bool m_canNavigateBack;
115 bool m_canNavigateForward;
116
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.
120 */
121 bool m_isBusy;
122 };
123
124 #endif // wxHAVE_WEB_BACKEND_IE
125
126 #endif // wxWebViewIE_H