]>
Commit | Line | Data |
---|---|---|
cfcf1d6e SL |
1 | /////////////////////////////////////////////////////////////////////////////\r |
2 | // Name: include/wx/msw/webviewie.h\r | |
3 | // Purpose: wxMSW IE wxWebView backend\r | |
4 | // Author: Marianne Gagnon\r | |
5 | // Id: $Id$\r | |
6 | // Copyright: (c) 2010 Marianne Gagnon\r | |
7 | // Licence: wxWindows licence\r | |
8 | /////////////////////////////////////////////////////////////////////////////\r | |
9 | \r | |
10 | #ifndef wxWebViewIE_H\r | |
11 | #define wxWebViewIE_H\r | |
12 | \r | |
13 | #include "wx/setup.h"\r | |
14 | \r | |
15 | #if wxHAVE_WEB_BACKEND_IE\r | |
16 | \r | |
17 | #include "wx/control.h"\r | |
18 | #include "wx/webview.h"\r | |
19 | #include "wx/msw/ole/automtn.h"\r | |
20 | #include "wx/msw/ole/activex.h"\r | |
21 | \r | |
22 | // TODO: move this to wx/msw/chkconf.h\r | |
23 | #if wxUSE_ACTIVEX != 1\r | |
24 | #error "wxUSE_ACTIVEX must be activated for this to work"\r | |
25 | #endif\r | |
26 | \r | |
27 | #if wxUSE_OLE_AUTOMATION != 1\r | |
28 | #error "wxUSE_OLE_AUTOMATION must be activated for this to work"\r | |
29 | #endif\r | |
30 | \r | |
31 | // FIXME: get those DLL export macros right...\r | |
32 | \r | |
33 | class wxWebViewIE : public wxWebView\r | |
34 | {\r | |
35 | public:\r | |
36 | \r | |
37 | wxWebViewIE() {}\r | |
38 | \r | |
39 | wxWebViewIE(wxWindow* parent,\r | |
40 | wxWindowID id,\r | |
41 | const wxString& url = wxWebViewDefaultURLStr,\r | |
42 | const wxPoint& pos = wxDefaultPosition,\r | |
43 | const wxSize& size = wxDefaultSize,\r | |
44 | long style = 0,\r | |
45 | const wxString& name = wxWebViewNameStr)\r | |
46 | {\r | |
47 | Create(parent, id, url, pos, size, style, name);\r | |
48 | }\r | |
49 | \r | |
50 | bool Create(wxWindow* parent,\r | |
51 | wxWindowID id,\r | |
52 | const wxString& url = wxWebViewDefaultURLStr,\r | |
53 | const wxPoint& pos = wxDefaultPosition,\r | |
54 | const wxSize& size = wxDefaultSize,\r | |
55 | long style = 0,\r | |
56 | const wxString& name = wxWebViewNameStr);\r | |
57 | \r | |
58 | virtual void LoadUrl(const wxString& url);\r | |
59 | \r | |
60 | virtual bool CanGoForward() { return m_canNavigateForward; }\r | |
61 | virtual bool CanGoBack() { return m_canNavigateBack; }\r | |
62 | virtual void GoBack();\r | |
63 | virtual void GoForward();\r | |
64 | virtual void Stop();\r | |
65 | virtual void Reload(wxWebViewReloadFlags flags=0);\r | |
66 | \r | |
67 | virtual wxString GetPageSource();\r | |
68 | \r | |
69 | virtual bool IsBusy();\r | |
70 | virtual wxString GetCurrentURL();\r | |
71 | virtual wxString GetCurrentTitle();\r | |
72 | \r | |
73 | virtual void SetZoomType(wxWebViewZoomType);\r | |
74 | virtual wxWebViewZoomType GetZoomType() const;\r | |
75 | virtual bool CanSetZoomType(wxWebViewZoomType) const;\r | |
76 | \r | |
77 | virtual void Print();\r | |
78 | \r | |
79 | virtual void SetPage(const wxString& html, const wxString& baseUrl);\r | |
80 | \r | |
81 | virtual wxWebViewZoom GetZoom();\r | |
82 | virtual void SetZoom(wxWebViewZoom zoom);\r | |
83 | \r | |
84 | // ---- IE-specific methods\r | |
85 | \r | |
86 | // FIXME: I seem to be able to access remote webpages even in offline mode...\r | |
87 | bool IsOfflineMode();\r | |
88 | void SetOfflineMode(bool offline);\r | |
89 | \r | |
90 | /**\r | |
91 | * Get text zoom\r | |
92 | * @return text zoom from 0 to 4\r | |
93 | */\r | |
94 | int GetIETextZoom();\r | |
95 | \r | |
96 | /**\r | |
97 | * @param level 0 to 4\r | |
98 | */\r | |
99 | void SetIETextZoom(int level);\r | |
100 | \r | |
101 | void SetIEOpticalZoom(float zoom);\r | |
102 | float GetIEOpticalZoom();\r | |
103 | \r | |
104 | void onActiveXEvent(wxActiveXEvent& evt);\r | |
105 | void onEraseBg(wxEraseEvent& evt) {}\r | |
106 | \r | |
107 | DECLARE_EVENT_TABLE();\r | |
108 | \r | |
109 | private:\r | |
110 | wxActiveXContainer* m_container;\r | |
111 | wxAutomationObject m_ie;\r | |
112 | IWebBrowser2* m_webBrowser;\r | |
113 | DWORD m_dwCookie;\r | |
114 | bool m_canNavigateBack;\r | |
115 | bool m_canNavigateForward;\r | |
116 | \r | |
117 | /** The "Busy" property of IWebBrowser2 does not always return busy when\r | |
118 | * we'd want it to; this variable may be set to true in cases where the\r | |
119 | * Busy property is false but should be true.\r | |
120 | */\r | |
121 | bool m_isBusy;\r | |
122 | };\r | |
123 | \r | |
124 | #endif // wxHAVE_WEB_BACKEND_IE\r | |
125 | \r | |
126 | #endif // wxWebViewIE_H\r |