]>
Commit | Line | Data |
---|---|---|
61b98a2d SL |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: include/wx/msw/webviewie.h | |
3 | // Purpose: wxMSW IE wxWebView backend | |
4 | // Author: Marianne Gagnon | |
5 | // Id: $Id$ | |
153530af | 6 | // Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton |
61b98a2d SL |
7 | // Licence: wxWindows licence |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef wxWebViewIE_H | |
11 | #define wxWebViewIE_H | |
12 | ||
13 | #include "wx/setup.h" | |
14 | ||
9d2f31db | 15 | #if wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE && defined(__WXMSW__) |
61b98a2d SL |
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" | |
9f194b9d | 21 | #include "wx/msw/ole/oleutils.h" |
97aa7b99 | 22 | #include "wx/msw/wrapwin.h" |
e924e848 | 23 | #include "wx/msw/missing.h" |
74af0b13 | 24 | #include "wx/sharedptr.h" |
5cbda74b | 25 | #include "wx/vector.h" |
61b98a2d | 26 | |
f559d1a2 VZ |
27 | /* Classes and definitions from urlmon.h vary in their |
28 | * completeness between compilers and versions of compilers. | |
29 | * We implement our own versions here which should work | |
30 | * for all compilers. The definitions are taken from the | |
31 | * mingw-w64 headers which are public domain. | |
32 | */ | |
33 | ||
34 | #ifndef REFRESH_NORMAL | |
35 | #define REFRESH_NORMAL 0 | |
36 | #endif | |
37 | ||
38 | #ifndef REFRESH_COMPLETELY | |
39 | #define REFRESH_COMPLETELY 3 | |
40 | #endif | |
41 | ||
42 | typedef enum __wxMIDL_IBindStatusCallback_0006 | |
43 | { | |
44 | wxBSCF_FIRSTDATANOTIFICATION = 0x1, | |
45 | wxBSCF_INTERMEDIATEDATANOTIFICATION = 0x2, | |
46 | wxBSCF_LASTDATANOTIFICATION = 0x4, | |
47 | wxBSCF_DATAFULLYAVAILABLE = 0x8, | |
48 | wxBSCF_AVAILABLEDATASIZEUNKNOWN = 0x10 | |
49 | } wxBSCF; | |
50 | ||
51 | EXTERN_C const IID CLSID_FileProtocol; | |
52 | ||
53 | typedef struct _tagwxBINDINFO | |
54 | { | |
55 | ULONG cbSize; | |
56 | LPWSTR szExtraInfo; | |
57 | STGMEDIUM stgmedData; | |
58 | DWORD grfBindInfoF; | |
59 | DWORD dwBindVerb; | |
60 | LPWSTR szCustomVerb; | |
61 | DWORD cbstgmedData; | |
62 | DWORD dwOptions; | |
63 | DWORD dwOptionsFlags; | |
64 | DWORD dwCodePage; | |
65 | SECURITY_ATTRIBUTES securityAttributes; | |
66 | IID iid; | |
67 | IUnknown *pUnk; | |
68 | DWORD dwReserved; | |
69 | } wxBINDINFO; | |
70 | ||
71 | typedef struct _tagwxPROTOCOLDATA | |
72 | { | |
73 | DWORD grfFlags; | |
74 | DWORD dwState; | |
75 | LPVOID pData; | |
76 | ULONG cbData; | |
77 | } wxPROTOCOLDATA; | |
78 | ||
79 | class wxIInternetBindInfo : public IUnknown | |
80 | { | |
81 | public: | |
82 | virtual HRESULT wxSTDCALL GetBindInfo(DWORD *grfBINDF,wxBINDINFO *pbindinfo) = 0; | |
83 | virtual HRESULT wxSTDCALL GetBindString(ULONG ulStringType,LPOLESTR *ppwzStr, | |
84 | ULONG cEl,ULONG *pcElFetched) = 0; | |
85 | }; | |
86 | ||
87 | class wxIInternetProtocolSink : public IUnknown | |
88 | { | |
89 | public: | |
90 | virtual HRESULT wxSTDCALL Switch(wxPROTOCOLDATA *pProtocolData) = 0; | |
91 | virtual HRESULT wxSTDCALL ReportProgress(ULONG ulStatusCode, | |
92 | LPCWSTR szStatusText) = 0; | |
93 | virtual HRESULT wxSTDCALL ReportData(DWORD grfBSCF,ULONG ulProgress, | |
94 | ULONG ulProgressMax) = 0; | |
95 | virtual HRESULT wxSTDCALL ReportResult(HRESULT hrResult,DWORD dwError, | |
96 | LPCWSTR szResult) = 0; | |
97 | }; | |
98 | ||
99 | class wxIInternetProtocolRoot : public IUnknown | |
100 | { | |
101 | public: | |
102 | virtual HRESULT wxSTDCALL Start(LPCWSTR szUrl,wxIInternetProtocolSink *pOIProtSink, | |
103 | wxIInternetBindInfo *pOIBindInfo,DWORD grfPI, | |
104 | HANDLE_PTR dwReserved) = 0; | |
105 | virtual HRESULT wxSTDCALL Continue(wxPROTOCOLDATA *pProtocolData) = 0; | |
106 | virtual HRESULT wxSTDCALL Abort(HRESULT hrReason,DWORD dwOptions) = 0; | |
107 | virtual HRESULT wxSTDCALL Terminate(DWORD dwOptions) = 0; | |
108 | virtual HRESULT wxSTDCALL Suspend(void) = 0; | |
109 | virtual HRESULT wxSTDCALL Resume(void) = 0; | |
110 | }; | |
111 | ||
112 | ||
113 | class wxIInternetProtocol : public wxIInternetProtocolRoot | |
114 | { | |
115 | public: | |
116 | virtual HRESULT wxSTDCALL Read(void *pv,ULONG cb,ULONG *pcbRead) = 0; | |
117 | virtual HRESULT wxSTDCALL Seek(LARGE_INTEGER dlibMove,DWORD dwOrigin, | |
118 | ULARGE_INTEGER *plibNewPosition) = 0; | |
119 | virtual HRESULT wxSTDCALL LockRequest(DWORD dwOptions) = 0; | |
120 | virtual HRESULT wxSTDCALL UnlockRequest(void) = 0; | |
121 | }; | |
122 | ||
123 | ||
124 | class wxIInternetSession : public IUnknown | |
125 | { | |
126 | public: | |
127 | virtual HRESULT wxSTDCALL RegisterNameSpace(IClassFactory *pCF,REFCLSID rclsid, | |
128 | LPCWSTR pwzProtocol, | |
129 | ULONG cPatterns, | |
130 | const LPCWSTR *ppwzPatterns, | |
131 | DWORD dwReserved) = 0; | |
132 | virtual HRESULT wxSTDCALL UnregisterNameSpace(IClassFactory *pCF, | |
133 | LPCWSTR pszProtocol) = 0; | |
134 | virtual HRESULT wxSTDCALL RegisterMimeFilter(IClassFactory *pCF, | |
135 | REFCLSID rclsid, | |
136 | LPCWSTR pwzType) = 0; | |
137 | virtual HRESULT wxSTDCALL UnregisterMimeFilter(IClassFactory *pCF, | |
138 | LPCWSTR pwzType) = 0; | |
139 | virtual HRESULT wxSTDCALL CreateBinding(LPBC pBC,LPCWSTR szUrl, | |
140 | IUnknown *pUnkOuter,IUnknown **ppUnk, | |
141 | wxIInternetProtocol **ppOInetProt, | |
142 | DWORD dwOption) = 0; | |
143 | virtual HRESULT wxSTDCALL SetSessionOption(DWORD dwOption,LPVOID pBuffer, | |
144 | DWORD dwBufferLength, | |
145 | DWORD dwReserved) = 0; | |
146 | virtual HRESULT wxSTDCALL GetSessionOption(DWORD dwOption,LPVOID pBuffer, | |
147 | DWORD *pdwBufferLength, | |
148 | DWORD dwReserved) = 0; | |
149 | }; | |
150 | ||
151 | /* END OF URLMON.H implementation */ | |
152 | ||
accc94d5 SL |
153 | /* Same goes for the mshtmhst.h, these are also taken |
154 | * from mingw-w64 headers. | |
155 | */ | |
156 | ||
157 | typedef enum _tagwxDOCHOSTUIFLAG | |
158 | { | |
159 | DOCHOSTUIFLAG_DIALOG = 0x1, | |
160 | DOCHOSTUIFLAG_DISABLE_HELP_MENU = 0x2, | |
161 | DOCHOSTUIFLAG_NO3DBORDER = 0x4, | |
162 | DOCHOSTUIFLAG_SCROLL_NO = 0x8, | |
163 | DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 0x10, | |
164 | DOCHOSTUIFLAG_OPENNEWWIN = 0x20, | |
165 | DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 0x40, | |
166 | DOCHOSTUIFLAG_FLAT_SCROLLBAR = 0x80, | |
167 | DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 0x100, | |
168 | DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 0x200, | |
169 | DOCHOSTUIFLAG_OVERRIDEBEHAVIORFACTORY = 0x400, | |
170 | DOCHOSTUIFLAG_CODEPAGELINKEDFONTS = 0x800, | |
171 | DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 = 0x1000, | |
172 | DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 = 0x2000, | |
173 | DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE = 0x4000, | |
174 | DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION = 0x10000, | |
175 | DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION = 0x20000, | |
176 | DOCHOSTUIFLAG_THEME = 0x40000, | |
177 | DOCHOSTUIFLAG_NOTHEME = 0x80000, | |
178 | DOCHOSTUIFLAG_NOPICS = 0x100000, | |
179 | DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x200000, | |
180 | DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = 0x400000, | |
181 | DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = 0x800000, | |
182 | DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x1000000 | |
183 | } DOCHOSTUIFLAG; | |
184 | ||
185 | typedef struct _tagwxDOCHOSTUIINFO | |
186 | { | |
187 | ULONG cbSize; | |
188 | DWORD dwFlags; | |
189 | DWORD dwDoubleClick; | |
190 | OLECHAR *pchHostCss; | |
191 | OLECHAR *pchHostNS; | |
192 | } DOCHOSTUIINFO; | |
193 | ||
194 | class wxIDocHostUIHandler : public IUnknown | |
195 | { | |
196 | public: | |
197 | virtual HRESULT wxSTDCALL ShowContextMenu(DWORD dwID, POINT *ppt, | |
198 | IUnknown *pcmdtReserved, | |
199 | IDispatch *pdispReserved) = 0; | |
200 | ||
201 | virtual HRESULT wxSTDCALL GetHostInfo(DOCHOSTUIINFO *pInfo) = 0; | |
202 | ||
203 | virtual HRESULT wxSTDCALL ShowUI(DWORD dwID, | |
204 | IOleInPlaceActiveObject *pActiveObject, | |
205 | IOleCommandTarget *pCommandTarget, | |
206 | IOleInPlaceFrame *pFrame, | |
207 | IOleInPlaceUIWindow *pDoc) = 0; | |
208 | ||
209 | virtual HRESULT wxSTDCALL HideUI(void) = 0; | |
210 | ||
211 | virtual HRESULT wxSTDCALL UpdateUI(void) = 0; | |
212 | ||
213 | virtual HRESULT wxSTDCALL EnableModeless(BOOL fEnable) = 0; | |
214 | ||
215 | virtual HRESULT wxSTDCALL OnDocWindowActivate(BOOL fActivate) = 0; | |
216 | ||
217 | virtual HRESULT wxSTDCALL OnFrameWindowActivate(BOOL fActivate) = 0; | |
218 | ||
219 | virtual HRESULT wxSTDCALL ResizeBorder(LPCRECT prcBorder, | |
220 | IOleInPlaceUIWindow *pUIWindow, | |
221 | BOOL fRameWindow) = 0; | |
222 | ||
223 | virtual HRESULT wxSTDCALL TranslateAccelerator(LPMSG lpMsg, | |
224 | const GUID *pguidCmdGroup, | |
225 | DWORD nCmdID) = 0; | |
226 | ||
6627ac2d | 227 | virtual HRESULT wxSTDCALL GetOptionKeyPath(LPOLESTR *pchKey, |
accc94d5 SL |
228 | DWORD dw) = 0; |
229 | ||
230 | virtual HRESULT wxSTDCALL GetDropTarget(IDropTarget *pDropTarget, | |
231 | IDropTarget **ppDropTarget) = 0; | |
232 | ||
233 | virtual HRESULT wxSTDCALL GetExternal(IDispatch **ppDispatch) = 0; | |
234 | ||
235 | virtual HRESULT wxSTDCALL TranslateUrl(DWORD dwTranslate, | |
6627ac2d VZ |
236 | OLECHAR *pchURLIn, |
237 | OLECHAR **ppchURLOut) = 0; | |
accc94d5 SL |
238 | |
239 | virtual HRESULT wxSTDCALL FilterDataObject(IDataObject *pDO, | |
240 | IDataObject **ppDORet) = 0; | |
241 | }; | |
242 | ||
243 | /* END OF MSHTMHST.H implementation */ | |
244 | ||
22ca10fa | 245 | struct IHTMLDocument2; |
7d3f6b4d | 246 | class wxFSFile; |
39498710 | 247 | class ClassFactory; |
accc94d5 SL |
248 | class wxIEContainer; |
249 | class DocHostUIHandler; | |
29365629 | 250 | |
467d261e | 251 | class WXDLLIMPEXP_WEBVIEW wxWebViewIE : public wxWebView |
61b98a2d SL |
252 | { |
253 | public: | |
254 | ||
255 | wxWebViewIE() {} | |
256 | ||
257 | wxWebViewIE(wxWindow* parent, | |
258 | wxWindowID id, | |
259 | const wxString& url = wxWebViewDefaultURLStr, | |
260 | const wxPoint& pos = wxDefaultPosition, | |
261 | const wxSize& size = wxDefaultSize, | |
262 | long style = 0, | |
263 | const wxString& name = wxWebViewNameStr) | |
264 | { | |
265 | Create(parent, id, url, pos, size, style, name); | |
266 | } | |
267 | ||
39498710 SL |
268 | ~wxWebViewIE(); |
269 | ||
61b98a2d SL |
270 | bool Create(wxWindow* parent, |
271 | wxWindowID id, | |
272 | const wxString& url = wxWebViewDefaultURLStr, | |
273 | const wxPoint& pos = wxDefaultPosition, | |
274 | const wxSize& size = wxDefaultSize, | |
275 | long style = 0, | |
276 | const wxString& name = wxWebViewNameStr); | |
277 | ||
4d0dddc7 | 278 | virtual void LoadURL(const wxString& url); |
c13d6ac1 SL |
279 | virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item); |
280 | virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory(); | |
281 | virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory(); | |
61b98a2d | 282 | |
e669ddde SL |
283 | virtual bool CanGoForward() const; |
284 | virtual bool CanGoBack() const; | |
61b98a2d SL |
285 | virtual void GoBack(); |
286 | virtual void GoForward(); | |
74af0b13 SL |
287 | virtual void ClearHistory(); |
288 | virtual void EnableHistory(bool enable = true); | |
61b98a2d | 289 | virtual void Stop(); |
a703012a | 290 | virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); |
61b98a2d | 291 | |
e669ddde SL |
292 | virtual wxString GetPageSource() const; |
293 | virtual wxString GetPageText() const; | |
61b98a2d | 294 | |
e669ddde SL |
295 | virtual bool IsBusy() const; |
296 | virtual wxString GetCurrentURL() const; | |
297 | virtual wxString GetCurrentTitle() const; | |
61b98a2d SL |
298 | |
299 | virtual void SetZoomType(wxWebViewZoomType); | |
300 | virtual wxWebViewZoomType GetZoomType() const; | |
301 | virtual bool CanSetZoomType(wxWebViewZoomType) const; | |
302 | ||
303 | virtual void Print(); | |
304 | ||
305 | virtual void SetPage(const wxString& html, const wxString& baseUrl); | |
306 | ||
e669ddde | 307 | virtual wxWebViewZoom GetZoom() const; |
61b98a2d SL |
308 | virtual void SetZoom(wxWebViewZoom zoom); |
309 | ||
4681a3ea | 310 | //Clipboard functions |
e669ddde SL |
311 | virtual bool CanCut() const; |
312 | virtual bool CanCopy() const; | |
313 | virtual bool CanPaste() const; | |
4681a3ea SL |
314 | virtual void Cut(); |
315 | virtual void Copy(); | |
316 | virtual void Paste(); | |
317 | ||
97e49559 | 318 | //Undo / redo functionality |
e669ddde SL |
319 | virtual bool CanUndo() const; |
320 | virtual bool CanRedo() const; | |
97e49559 SL |
321 | virtual void Undo(); |
322 | virtual void Redo(); | |
323 | ||
c7cbe308 SL |
324 | //Editing functions |
325 | virtual void SetEditable(bool enable = true); | |
e669ddde | 326 | virtual bool IsEditable() const; |
c7cbe308 | 327 | |
63a65070 SL |
328 | //Selection |
329 | virtual void SelectAll(); | |
e669ddde | 330 | virtual bool HasSelection() const; |
63a65070 | 331 | virtual void DeleteSelection(); |
e669ddde SL |
332 | virtual wxString GetSelectedText() const; |
333 | virtual wxString GetSelectedSource() const; | |
41933aa5 | 334 | virtual void ClearSelection(); |
63a65070 | 335 | |
c9ccc09c | 336 | virtual void RunScript(const wxString& javascript); |
63a65070 | 337 | |
29365629 | 338 | //Virtual Filesystem Support |
7d8d6163 | 339 | virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler); |
29365629 | 340 | |
61b98a2d SL |
341 | // ---- IE-specific methods |
342 | ||
343 | // FIXME: I seem to be able to access remote webpages even in offline mode... | |
344 | bool IsOfflineMode(); | |
345 | void SetOfflineMode(bool offline); | |
346 | ||
e669ddde | 347 | wxWebViewZoom GetIETextZoom() const; |
c5f417cb | 348 | void SetIETextZoom(wxWebViewZoom level); |
61b98a2d | 349 | |
e669ddde | 350 | wxWebViewZoom GetIEOpticalZoom() const; |
c5f417cb | 351 | void SetIEOpticalZoom(wxWebViewZoom level); |
61b98a2d SL |
352 | |
353 | void onActiveXEvent(wxActiveXEvent& evt); | |
22ca10fa | 354 | void onEraseBg(wxEraseEvent&) {} |
61b98a2d SL |
355 | |
356 | DECLARE_EVENT_TABLE(); | |
357 | ||
358 | private: | |
accc94d5 | 359 | wxIEContainer* m_container; |
61b98a2d SL |
360 | wxAutomationObject m_ie; |
361 | IWebBrowser2* m_webBrowser; | |
362 | DWORD m_dwCookie; | |
accc94d5 | 363 | DocHostUIHandler* m_uiHandler; |
61b98a2d | 364 | |
c5f417cb SL |
365 | //We store the current zoom type; |
366 | wxWebViewZoomType m_zoomType; | |
367 | ||
61b98a2d SL |
368 | /** The "Busy" property of IWebBrowser2 does not always return busy when |
369 | * we'd want it to; this variable may be set to true in cases where the | |
370 | * Busy property is false but should be true. | |
371 | */ | |
372 | bool m_isBusy; | |
60eabdbe | 373 | //We manage our own history, the history list contains the history items |
3e7968c2 SL |
374 | //which are added as documentcomplete events arrive, unless we are loading |
375 | //an item from the history. The position is stored as an int, and reflects | |
376 | //where we are in the history list. | |
c13d6ac1 | 377 | wxVector<wxSharedPtr<wxWebViewHistoryItem> > m_historyList; |
39498710 | 378 | wxVector<ClassFactory*> m_factories; |
74af0b13 SL |
379 | int m_historyPosition; |
380 | bool m_historyLoadingFromList; | |
381 | bool m_historyEnabled; | |
382 | ||
4681a3ea | 383 | //Generic helper functions for IHtmlDocument commands |
e669ddde | 384 | bool CanExecCommand(wxString command) const; |
4681a3ea | 385 | void ExecCommand(wxString command); |
e669ddde | 386 | IHTMLDocument2* GetDocument() const; |
9447a0d6 SL |
387 | //Toggles control features see INTERNETFEATURELIST for values. |
388 | bool EnableControlFeature(long flag, bool enable = true); | |
4681a3ea | 389 | |
cddf4541 | 390 | wxDECLARE_DYNAMIC_CLASS(wxWebViewIE); |
61b98a2d SL |
391 | }; |
392 | ||
f559d1a2 | 393 | class VirtualProtocol : public wxIInternetProtocol |
7d3f6b4d SL |
394 | { |
395 | protected: | |
f559d1a2 | 396 | wxIInternetProtocolSink* m_protocolSink; |
7d3f6b4d SL |
397 | wxString m_html; |
398 | VOID * fileP; | |
399 | ||
400 | wxFSFile* m_file; | |
7d8d6163 | 401 | wxSharedPtr<wxWebViewHandler> m_handler; |
7d3f6b4d SL |
402 | |
403 | public: | |
7d8d6163 | 404 | VirtualProtocol(wxSharedPtr<wxWebViewHandler> handler); |
6dd0883d | 405 | ~VirtualProtocol() {} |
7d3f6b4d SL |
406 | |
407 | //IUnknown | |
9f194b9d | 408 | DECLARE_IUNKNOWN_METHODS; |
7d3f6b4d SL |
409 | |
410 | //IInternetProtocolRoot | |
60eabdbe | 411 | HRESULT STDMETHODCALLTYPE Abort(HRESULT WXUNUSED(hrReason), |
0995b9dc | 412 | DWORD WXUNUSED(dwOptions)) |
7d3f6b4d | 413 | { return E_NOTIMPL; } |
f559d1a2 | 414 | HRESULT STDMETHODCALLTYPE Continue(wxPROTOCOLDATA *WXUNUSED(pProtocolData)) |
7d3f6b4d SL |
415 | { return S_OK; } |
416 | HRESULT STDMETHODCALLTYPE Resume() { return S_OK; } | |
60eabdbe | 417 | HRESULT STDMETHODCALLTYPE Start(LPCWSTR szUrl, |
f559d1a2 VZ |
418 | wxIInternetProtocolSink *pOIProtSink, |
419 | wxIInternetBindInfo *pOIBindInfo, | |
60eabdbe | 420 | DWORD grfPI, |
7d3f6b4d SL |
421 | HANDLE_PTR dwReserved); |
422 | HRESULT STDMETHODCALLTYPE Suspend() { return S_OK; } | |
0995b9dc | 423 | HRESULT STDMETHODCALLTYPE Terminate(DWORD WXUNUSED(dwOptions)) { return S_OK; } |
7d3f6b4d SL |
424 | |
425 | //IInternetProtocol | |
60eabdbe | 426 | HRESULT STDMETHODCALLTYPE LockRequest(DWORD WXUNUSED(dwOptions)) |
0995b9dc | 427 | { return S_OK; } |
7d3f6b4d | 428 | HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead); |
60eabdbe VZ |
429 | HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER WXUNUSED(dlibMove), |
430 | DWORD WXUNUSED(dwOrigin), | |
431 | ULARGE_INTEGER* WXUNUSED(plibNewPosition)) | |
7d3f6b4d SL |
432 | { return E_FAIL; } |
433 | HRESULT STDMETHODCALLTYPE UnlockRequest() { return S_OK; } | |
434 | }; | |
435 | ||
436 | class ClassFactory : public IClassFactory | |
437 | { | |
7d3f6b4d | 438 | public: |
9f194b9d | 439 | ClassFactory(wxSharedPtr<wxWebViewHandler> handler) : m_handler(handler) {} |
7d3f6b4d SL |
440 | |
441 | //IClassFactory | |
60eabdbe | 442 | HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown* pUnkOuter, |
7d3f6b4d SL |
443 | REFIID riid, void** ppvObject); |
444 | HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock); | |
9f194b9d SL |
445 | |
446 | //IUnknown | |
447 | DECLARE_IUNKNOWN_METHODS; | |
448 | ||
29365629 | 449 | private: |
7d8d6163 | 450 | wxSharedPtr<wxWebViewHandler> m_handler; |
7d3f6b4d SL |
451 | }; |
452 | ||
accc94d5 SL |
453 | class wxIEContainer : public wxActiveXContainer |
454 | { | |
455 | public: | |
456 | wxIEContainer(wxWindow *parent, REFIID iid, IUnknown *pUnk, DocHostUIHandler* uiHandler = NULL); | |
457 | virtual ~wxIEContainer(); | |
458 | virtual bool QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc); | |
459 | private: | |
460 | DocHostUIHandler* m_uiHandler; | |
461 | }; | |
462 | ||
463 | class DocHostUIHandler : public wxIDocHostUIHandler | |
464 | { | |
465 | public: | |
466 | DocHostUIHandler() {}; | |
467 | ~DocHostUIHandler() {}; | |
468 | virtual HRESULT wxSTDCALL ShowContextMenu(DWORD dwID, POINT *ppt, | |
469 | IUnknown *pcmdtReserved, | |
470 | IDispatch *pdispReserved); | |
471 | ||
472 | virtual HRESULT wxSTDCALL GetHostInfo(DOCHOSTUIINFO *pInfo); | |
473 | ||
474 | virtual HRESULT wxSTDCALL ShowUI(DWORD dwID, | |
475 | IOleInPlaceActiveObject *pActiveObject, | |
476 | IOleCommandTarget *pCommandTarget, | |
477 | IOleInPlaceFrame *pFrame, | |
478 | IOleInPlaceUIWindow *pDoc); | |
479 | ||
480 | virtual HRESULT wxSTDCALL HideUI(void); | |
481 | ||
482 | virtual HRESULT wxSTDCALL UpdateUI(void); | |
483 | ||
484 | virtual HRESULT wxSTDCALL EnableModeless(BOOL fEnable); | |
485 | ||
486 | virtual HRESULT wxSTDCALL OnDocWindowActivate(BOOL fActivate); | |
487 | ||
488 | virtual HRESULT wxSTDCALL OnFrameWindowActivate(BOOL fActivate); | |
489 | ||
490 | virtual HRESULT wxSTDCALL ResizeBorder(LPCRECT prcBorder, | |
491 | IOleInPlaceUIWindow *pUIWindow, | |
492 | BOOL fRameWindow); | |
493 | ||
494 | virtual HRESULT wxSTDCALL TranslateAccelerator(LPMSG lpMsg, | |
495 | const GUID *pguidCmdGroup, | |
496 | DWORD nCmdID); | |
497 | ||
96457e67 | 498 | virtual HRESULT wxSTDCALL GetOptionKeyPath(LPOLESTR *pchKey, |
accc94d5 SL |
499 | DWORD dw); |
500 | ||
501 | virtual HRESULT wxSTDCALL GetDropTarget(IDropTarget *pDropTarget, | |
502 | IDropTarget **ppDropTarget); | |
503 | ||
504 | virtual HRESULT wxSTDCALL GetExternal(IDispatch **ppDispatch); | |
505 | ||
506 | virtual HRESULT wxSTDCALL TranslateUrl(DWORD dwTranslate, | |
96457e67 SL |
507 | OLECHAR *pchURLIn, |
508 | OLECHAR **ppchURLOut); | |
accc94d5 SL |
509 | |
510 | virtual HRESULT wxSTDCALL FilterDataObject(IDataObject *pDO, | |
511 | IDataObject **ppDORet); | |
512 | //IUnknown | |
513 | DECLARE_IUNKNOWN_METHODS; | |
514 | }; | |
515 | ||
9d2f31db | 516 | #endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE && defined(__WXMSW__) |
61b98a2d SL |
517 | |
518 | #endif // wxWebViewIE_H |