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