ieframe: Added IDocObjectService::FireBeforeNavigate2 implementation.
[wine/multimedia.git] / dlls / ieframe / shellbrowser.c
bloba81fa1682be2fe427087f4dc820372a8f7642788
1 /*
2 * Implementation of IShellBrowser interface
4 * Copyright 2011 Piotr Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <assert.h>
23 #include "ieframe.h"
24 #include "exdispid.h"
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
30 static inline ShellBrowser *impl_from_IShellBrowser(IShellBrowser *iface)
32 return CONTAINING_RECORD(iface, ShellBrowser, IShellBrowser_iface);
35 static HRESULT WINAPI ShellBrowser_QueryInterface(
36 IShellBrowser* iface,
37 REFIID riid,
38 void **ppvObject)
40 ShellBrowser *This = impl_from_IShellBrowser(iface);
41 *ppvObject = NULL;
43 if(IsEqualGUID(&IID_IShellBrowser, riid) || IsEqualGUID(&IID_IOleWindow, riid)
44 || IsEqualGUID(&IID_IUnknown, riid))
45 *ppvObject = &This->IShellBrowser_iface;
46 else if(IsEqualGUID(&IID_IBrowserService, riid))
47 *ppvObject = &This->IBrowserService_iface;
48 else if(IsEqualGUID(&IID_IDocObjectService, riid))
49 *ppvObject = &This->IDocObjectService_iface;
51 if(*ppvObject) {
52 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
53 IUnknown_AddRef((IUnknown*)*ppvObject);
54 return S_OK;
57 FIXME("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
58 return E_NOINTERFACE;
61 static ULONG WINAPI ShellBrowser_AddRef(
62 IShellBrowser* iface)
64 ShellBrowser *This = impl_from_IShellBrowser(iface);
65 LONG ref = InterlockedIncrement(&This->ref);
67 TRACE("(%p) ref=%d\n", This, ref);
69 return ref;
72 static ULONG WINAPI ShellBrowser_Release(IShellBrowser* iface)
74 ShellBrowser *This = impl_from_IShellBrowser(iface);
75 LONG ref = InterlockedDecrement(&This->ref);
77 TRACE("(%p) ref=%d\n", This, ref);
79 if(!ref) {
80 assert(!This->doc_host);
81 heap_free(This);
84 return ref;
87 static HRESULT WINAPI ShellBrowser_GetWindow(
88 IShellBrowser* iface,
89 HWND *phwnd)
91 ShellBrowser *This = impl_from_IShellBrowser(iface);
92 FIXME("%p %p\n", This, phwnd);
93 return E_NOTIMPL;
96 static HRESULT WINAPI ShellBrowser_ContextSensitiveHelp(
97 IShellBrowser* iface,
98 BOOL fEnterMode)
100 ShellBrowser *This = impl_from_IShellBrowser(iface);
101 FIXME("%p %d\n", This, fEnterMode);
102 return E_NOTIMPL;
105 static HRESULT WINAPI ShellBrowser_InsertMenusSB(
106 IShellBrowser* iface,
107 HMENU hmenuShared,
108 LPOLEMENUGROUPWIDTHS lpMenuWidths)
110 ShellBrowser *This = impl_from_IShellBrowser(iface);
111 FIXME("%p %p %p\n", This, hmenuShared, lpMenuWidths);
112 return E_NOTIMPL;
115 static HRESULT WINAPI ShellBrowser_SetMenuSB(
116 IShellBrowser* iface,
117 HMENU hmenuShared,
118 HOLEMENU holemenuReserved,
119 HWND hwndActiveObject)
121 ShellBrowser *This = impl_from_IShellBrowser(iface);
122 FIXME("%p %p %p %p\n", This, hmenuShared, holemenuReserved, hwndActiveObject);
123 return E_NOTIMPL;
126 static HRESULT WINAPI ShellBrowser_RemoveMenusSB(
127 IShellBrowser* iface,
128 HMENU hmenuShared)
130 ShellBrowser *This = impl_from_IShellBrowser(iface);
131 FIXME("%p %p\n", This, hmenuShared);
132 return E_NOTIMPL;
135 static HRESULT WINAPI ShellBrowser_SetStatusTextSB(
136 IShellBrowser* iface,
137 LPCOLESTR pszStatusText)
139 ShellBrowser *This = impl_from_IShellBrowser(iface);
140 FIXME("%p %s\n", This, debugstr_w(pszStatusText));
141 return E_NOTIMPL;
144 static HRESULT WINAPI ShellBrowser_EnableModelessSB(
145 IShellBrowser* iface,
146 BOOL fEnable)
148 ShellBrowser *This = impl_from_IShellBrowser(iface);
149 FIXME("%p %d\n", This, fEnable);
150 return E_NOTIMPL;
153 static HRESULT WINAPI ShellBrowser_TranslateAcceleratorSB(
154 IShellBrowser* iface,
155 MSG *pmsg,
156 WORD wID)
158 ShellBrowser *This = impl_from_IShellBrowser(iface);
159 FIXME("%p %p %d\n", This, pmsg, (int)wID);
160 return E_NOTIMPL;
163 static HRESULT WINAPI ShellBrowser_BrowseObject(
164 IShellBrowser* iface,
165 LPCITEMIDLIST pidl,
166 UINT wFlags)
168 ShellBrowser *This = impl_from_IShellBrowser(iface);
169 FIXME("%p %p %u\n", This, pidl, wFlags);
170 return E_NOTIMPL;
173 static HRESULT WINAPI ShellBrowser_GetViewStateStream(
174 IShellBrowser* iface,
175 DWORD grfMode,
176 IStream **ppStrm)
178 ShellBrowser *This = impl_from_IShellBrowser(iface);
179 FIXME("%p %x %p\n", This, grfMode, ppStrm);
180 return E_NOTIMPL;
183 static HRESULT WINAPI ShellBrowser_GetControlWindow(
184 IShellBrowser* iface,
185 UINT id,
186 HWND *phwnd)
188 ShellBrowser *This = impl_from_IShellBrowser(iface);
189 FIXME("%p %u %p\n", This, id, phwnd);
190 return E_NOTIMPL;
193 static HRESULT WINAPI ShellBrowser_SendControlMsg(
194 IShellBrowser* iface,
195 UINT id,
196 UINT uMsg,
197 WPARAM wParam,
198 LPARAM lParam,
199 LRESULT *pret)
201 ShellBrowser *This = impl_from_IShellBrowser(iface);
202 FIXME("%p %u %u %p\n", This, id, uMsg, pret);
203 return E_NOTIMPL;
206 static HRESULT WINAPI ShellBrowser_QueryActiveShellView(
207 IShellBrowser* iface,
208 IShellView **ppshv)
210 ShellBrowser *This = impl_from_IShellBrowser(iface);
211 FIXME("%p %p\n", This, ppshv);
212 return E_NOTIMPL;
215 static HRESULT WINAPI ShellBrowser_OnViewWindowActive(
216 IShellBrowser* iface,
217 IShellView *pshv)
219 ShellBrowser *This = impl_from_IShellBrowser(iface);
220 FIXME("%p %p\n", This, pshv);
221 return E_NOTIMPL;
224 static HRESULT WINAPI ShellBrowser_SetToolbarItems(
225 IShellBrowser* iface,
226 LPTBBUTTONSB lpButtons,
227 UINT nButtons,
228 UINT uFlags)
230 ShellBrowser *This = impl_from_IShellBrowser(iface);
231 FIXME("%p %p %u %u\n", This, lpButtons, nButtons, uFlags);
232 return E_NOTIMPL;
235 static const IShellBrowserVtbl ShellBrowserVtbl = {
236 ShellBrowser_QueryInterface,
237 ShellBrowser_AddRef,
238 ShellBrowser_Release,
239 ShellBrowser_GetWindow,
240 ShellBrowser_ContextSensitiveHelp,
241 ShellBrowser_InsertMenusSB,
242 ShellBrowser_SetMenuSB,
243 ShellBrowser_RemoveMenusSB,
244 ShellBrowser_SetStatusTextSB,
245 ShellBrowser_EnableModelessSB,
246 ShellBrowser_TranslateAcceleratorSB,
247 ShellBrowser_BrowseObject,
248 ShellBrowser_GetViewStateStream,
249 ShellBrowser_GetControlWindow,
250 ShellBrowser_SendControlMsg,
251 ShellBrowser_QueryActiveShellView,
252 ShellBrowser_OnViewWindowActive,
253 ShellBrowser_SetToolbarItems
256 static inline ShellBrowser *impl_from_IBrowserService(IBrowserService *iface)
258 return CONTAINING_RECORD(iface, ShellBrowser, IBrowserService_iface);
261 static HRESULT WINAPI BrowserService_QueryInterface(
262 IBrowserService* iface,
263 REFIID riid,
264 void **ppvObject)
266 ShellBrowser *This = impl_from_IBrowserService(iface);
267 return IShellBrowser_QueryInterface(&This->IShellBrowser_iface, riid, ppvObject);
270 static ULONG WINAPI BrowserService_AddRef(
271 IBrowserService *iface)
273 ShellBrowser *This = impl_from_IBrowserService(iface);
274 return IShellBrowser_AddRef(&This->IShellBrowser_iface);
277 static ULONG WINAPI BrowserService_Release(
278 IBrowserService* iface)
280 ShellBrowser *This = impl_from_IBrowserService(iface);
281 return IShellBrowser_Release(&This->IShellBrowser_iface);
284 static HRESULT WINAPI BrowserService_GetParentSite(
285 IBrowserService* iface,
286 IOleInPlaceSite **ppipsite)
288 ShellBrowser *This = impl_from_IBrowserService(iface);
289 FIXME("%p %p\n", This, ppipsite);
290 return E_NOTIMPL;
293 static HRESULT WINAPI BrowserService_SetTitle(
294 IBrowserService* iface,
295 IShellView *psv,
296 LPCWSTR pszName)
298 ShellBrowser *This = impl_from_IBrowserService(iface);
299 FIXME("%p %p %s\n", This, psv, debugstr_w(pszName));
300 return E_NOTIMPL;
303 static HRESULT WINAPI BrowserService_GetTitle(
304 IBrowserService* iface,
305 IShellView *psv,
306 LPWSTR pszName,
307 DWORD cchName)
309 ShellBrowser *This = impl_from_IBrowserService(iface);
310 FIXME("%p %p %p %d\n", This, psv, pszName, cchName);
311 return E_NOTIMPL;
314 static HRESULT WINAPI BrowserService_GetOleObject(
315 IBrowserService* iface,
316 IOleObject **ppobjv)
318 ShellBrowser *This = impl_from_IBrowserService(iface);
319 FIXME("%p %p\n", This, ppobjv);
320 return E_NOTIMPL;
323 static HRESULT WINAPI BrowserService_GetTravelLog(
324 IBrowserService* iface,
325 ITravelLog **pptl)
327 ShellBrowser *This = impl_from_IBrowserService(iface);
328 FIXME("%p %p\n", This, pptl);
329 return E_NOTIMPL;
332 static HRESULT WINAPI BrowserService_ShowControlWindow(
333 IBrowserService* iface,
334 UINT id,
335 BOOL fShow)
337 ShellBrowser *This = impl_from_IBrowserService(iface);
338 FIXME("%p %u %d\n", This, id, fShow);
339 return E_NOTIMPL;
342 static HRESULT WINAPI BrowserService_IsControlWindowShown(
343 IBrowserService* iface,
344 UINT id,
345 BOOL *pfShown)
347 ShellBrowser *This = impl_from_IBrowserService(iface);
348 FIXME("%p %u %p\n", This, id, pfShown);
349 return E_NOTIMPL;
352 static HRESULT WINAPI BrowserService_IEGetDisplayName(
353 IBrowserService* iface,
354 PCIDLIST_ABSOLUTE pidl,
355 LPWSTR pwszName,
356 UINT uFlags)
358 ShellBrowser *This = impl_from_IBrowserService(iface);
359 FIXME("%p %p %p %u\n", This, pidl, pwszName, uFlags);
360 return E_NOTIMPL;
363 static HRESULT WINAPI BrowserService_IEParseDisplayName(
364 IBrowserService* iface,
365 UINT uiCP,
366 LPCWSTR pwszPath,
367 PIDLIST_ABSOLUTE *ppidlOut)
369 ShellBrowser *This = impl_from_IBrowserService(iface);
370 FIXME("%p %u %s %p\n", This, uiCP, debugstr_w(pwszPath), ppidlOut);
371 return E_NOTIMPL;
374 static HRESULT WINAPI BrowserService_DisplayParseError(
375 IBrowserService* iface,
376 HRESULT hres,
377 LPCWSTR pwszPath)
379 ShellBrowser *This = impl_from_IBrowserService(iface);
380 FIXME("%p %x %s\n", This, hres, debugstr_w(pwszPath));
381 return E_NOTIMPL;
384 static HRESULT WINAPI BrowserService_NavigateToPidl(
385 IBrowserService* iface,
386 PCIDLIST_ABSOLUTE pidl,
387 DWORD grfHLNF)
389 ShellBrowser *This = impl_from_IBrowserService(iface);
390 FIXME("%p %p %d\n", This, pidl, grfHLNF);
391 return E_NOTIMPL;
394 static HRESULT WINAPI BrowserService_SetNavigateState(
395 IBrowserService* iface,
396 BNSTATE bnstate)
398 ShellBrowser *This = impl_from_IBrowserService(iface);
399 FIXME("%p %d\n", This, bnstate);
400 return E_NOTIMPL;
403 static HRESULT WINAPI BrowserService_GetNavigateState(
404 IBrowserService* iface,
405 BNSTATE *pbnstate)
407 ShellBrowser *This = impl_from_IBrowserService(iface);
408 FIXME("%p %p\n", This, pbnstate);
409 return E_NOTIMPL;
412 static HRESULT WINAPI BrowserService_NotifyRedirect(
413 IBrowserService* iface,
414 IShellView *psv,
415 PCIDLIST_ABSOLUTE pidl,
416 BOOL *pfDidBrowse)
418 ShellBrowser *This = impl_from_IBrowserService(iface);
419 FIXME("%p %p %p %p\n", This, psv, pidl, pfDidBrowse);
420 return E_NOTIMPL;
423 static HRESULT WINAPI BrowserService_UpdateWindowList(
424 IBrowserService* iface)
426 ShellBrowser *This = impl_from_IBrowserService(iface);
427 FIXME("%p\n", This);
428 return E_NOTIMPL;
431 static HRESULT WINAPI BrowserService_UpdateBackForwardState(
432 IBrowserService* iface)
434 ShellBrowser *This = impl_from_IBrowserService(iface);
435 FIXME("%p\n", This);
436 return E_NOTIMPL;
439 static HRESULT WINAPI BrowserService_SetFlags(
440 IBrowserService* iface,
441 DWORD dwFlags,
442 DWORD dwFlagMask)
444 ShellBrowser *This = impl_from_IBrowserService(iface);
445 FIXME("%p %x %x\n", This, dwFlags, dwFlagMask);
446 return E_NOTIMPL;
449 static HRESULT WINAPI BrowserService_GetFlags(
450 IBrowserService* iface,
451 DWORD *pdwFlags)
453 ShellBrowser *This = impl_from_IBrowserService(iface);
454 FIXME("%p %p\n", This, pdwFlags);
455 return E_NOTIMPL;
458 static HRESULT WINAPI BrowserService_CanNavigateNow(
459 IBrowserService* iface)
461 ShellBrowser *This = impl_from_IBrowserService(iface);
462 FIXME("%p\n", This);
463 return E_NOTIMPL;
466 static HRESULT WINAPI BrowserService_GetPidl(
467 IBrowserService* iface,
468 PIDLIST_ABSOLUTE *ppidl)
470 ShellBrowser *This = impl_from_IBrowserService(iface);
471 FIXME("%p %p\n", This, ppidl);
472 return E_NOTIMPL;
475 static HRESULT WINAPI BrowserService_SetReferrer(
476 IBrowserService* iface,
477 PCIDLIST_ABSOLUTE pidl)
479 ShellBrowser *This = impl_from_IBrowserService(iface);
480 FIXME("%p %p\n", This, pidl);
481 return E_NOTIMPL;
484 static DWORD WINAPI BrowserService_GetBrowserIndex(
485 IBrowserService* iface)
487 ShellBrowser *This = impl_from_IBrowserService(iface);
488 FIXME("%p\n", This);
489 return E_NOTIMPL;
492 static HRESULT WINAPI BrowserService_GetBrowserByIndex(
493 IBrowserService* iface,
494 DWORD dwID,
495 IUnknown **ppunk)
497 ShellBrowser *This = impl_from_IBrowserService(iface);
498 FIXME("%p %x %p\n", This, dwID, ppunk);
499 return E_NOTIMPL;
502 static HRESULT WINAPI BrowserService_GetHistoryObject(
503 IBrowserService* iface,
504 IOleObject **ppole,
505 IStream **pstm,
506 IBindCtx **ppbc)
508 ShellBrowser *This = impl_from_IBrowserService(iface);
509 FIXME("%p %p %p %p\n", This, ppole, pstm, ppbc);
510 return E_NOTIMPL;
513 static HRESULT WINAPI BrowserService_SetHistoryObject(
514 IBrowserService* iface,
515 IOleObject *pole,
516 BOOL fIsLocalAnchor)
518 ShellBrowser *This = impl_from_IBrowserService(iface);
519 FIXME("%p %p %d\n", This, pole, fIsLocalAnchor);
520 return E_NOTIMPL;
523 static HRESULT WINAPI BrowserService_CacheOLEServer(
524 IBrowserService* iface,
525 IOleObject *pole)
527 ShellBrowser *This = impl_from_IBrowserService(iface);
528 FIXME("%p %p\n", This, pole);
529 return E_NOTIMPL;
532 static HRESULT WINAPI BrowserService_GetSetCodePage(
533 IBrowserService* iface,
534 VARIANT *pvarIn,
535 VARIANT *pvarOut)
537 ShellBrowser *This = impl_from_IBrowserService(iface);
538 FIXME("%p %p %p\n", This, pvarIn, pvarOut);
539 return E_NOTIMPL;
542 static HRESULT WINAPI BrowserService_OnHttpEquiv(
543 IBrowserService* iface,
544 IShellView *psv,
545 BOOL fDone,
546 VARIANT *pvarargIn,
547 VARIANT *pvarargOut)
549 ShellBrowser *This = impl_from_IBrowserService(iface);
550 FIXME("%p %p %d %p %p\n", This, psv, fDone, pvarargIn, pvarargOut);
551 return E_NOTIMPL;
554 static HRESULT WINAPI BrowserService_GetPalette(
555 IBrowserService* iface,
556 HPALETTE *hpal)
558 ShellBrowser *This = impl_from_IBrowserService(iface);
559 FIXME("%p %p\n", This, hpal);
560 return E_NOTIMPL;
563 static HRESULT WINAPI BrowserService_RegisterWindow(
564 IBrowserService* iface,
565 BOOL fForceRegister,
566 int swc)
568 ShellBrowser *This = impl_from_IBrowserService(iface);
569 FIXME("%p %d %d\n", This, fForceRegister, swc);
570 return E_NOTIMPL;
573 static const IBrowserServiceVtbl BrowserServiceVtbl = {
574 BrowserService_QueryInterface,
575 BrowserService_AddRef,
576 BrowserService_Release,
577 BrowserService_GetParentSite,
578 BrowserService_SetTitle,
579 BrowserService_GetTitle,
580 BrowserService_GetOleObject,
581 BrowserService_GetTravelLog,
582 BrowserService_ShowControlWindow,
583 BrowserService_IsControlWindowShown,
584 BrowserService_IEGetDisplayName,
585 BrowserService_IEParseDisplayName,
586 BrowserService_DisplayParseError,
587 BrowserService_NavigateToPidl,
588 BrowserService_SetNavigateState,
589 BrowserService_GetNavigateState,
590 BrowserService_NotifyRedirect,
591 BrowserService_UpdateWindowList,
592 BrowserService_UpdateBackForwardState,
593 BrowserService_SetFlags,
594 BrowserService_GetFlags,
595 BrowserService_CanNavigateNow,
596 BrowserService_GetPidl,
597 BrowserService_SetReferrer,
598 BrowserService_GetBrowserIndex,
599 BrowserService_GetBrowserByIndex,
600 BrowserService_GetHistoryObject,
601 BrowserService_SetHistoryObject,
602 BrowserService_CacheOLEServer,
603 BrowserService_GetSetCodePage,
604 BrowserService_OnHttpEquiv,
605 BrowserService_GetPalette,
606 BrowserService_RegisterWindow
609 static inline ShellBrowser *impl_from_IDocObjectService(IDocObjectService *iface)
611 return CONTAINING_RECORD(iface, ShellBrowser, IDocObjectService_iface);
614 static HRESULT WINAPI DocObjectService_QueryInterface(
615 IDocObjectService* iface,
616 REFIID riid,
617 void **ppvObject)
619 ShellBrowser *This = impl_from_IDocObjectService(iface);
620 return IShellBrowser_QueryInterface(&This->IShellBrowser_iface, riid, ppvObject);
623 static ULONG WINAPI DocObjectService_AddRef(
624 IDocObjectService* iface)
626 ShellBrowser *This = impl_from_IDocObjectService(iface);
627 return IShellBrowser_AddRef(&This->IShellBrowser_iface);
630 static ULONG WINAPI DocObjectService_Release(
631 IDocObjectService* iface)
633 ShellBrowser *This = impl_from_IDocObjectService(iface);
634 return IShellBrowser_Release(&This->IShellBrowser_iface);
637 static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
638 IDocObjectService* iface,
639 IDispatch *pDispatch,
640 LPCWSTR lpszUrl,
641 DWORD dwFlags,
642 LPCWSTR lpszFrameName,
643 BYTE *pPostData,
644 DWORD cbPostData,
645 LPCWSTR lpszHeaders,
646 BOOL fPlayNavSound,
647 BOOL *pfCancel)
649 ShellBrowser *This = impl_from_IDocObjectService(iface);
650 VARIANT var_url, var_flags, var_frame_name, var_post_data, var_post_data2, var_headers;
651 VARIANTARG params[7];
652 DISPPARAMS dp = {params, NULL, 7, 0};
653 VARIANT_BOOL cancel = VARIANT_FALSE;
654 SAFEARRAY *post_data;
656 TRACE("%p %p %s %x %s %p %d %s %d %p\n", This, pDispatch, debugstr_w(lpszUrl),
657 dwFlags, debugstr_w(lpszFrameName), pPostData, cbPostData,
658 debugstr_w(lpszHeaders), fPlayNavSound, pfCancel);
660 if(cbPostData) {
661 post_data = SafeArrayCreateVector(VT_UI1, 0, cbPostData);
662 memcpy(post_data->pvData, pPostData, cbPostData);
663 if(!post_data)
664 return E_OUTOFMEMORY;
665 }else {
666 post_data = NULL;
669 V_VT(params) = VT_BOOL|VT_BYREF;
670 V_BOOLREF(params) = &cancel;
672 V_VT(params+1) = (VT_BYREF|VT_VARIANT);
673 V_VARIANTREF(params+1) = &var_headers;
674 V_VT(&var_headers) = VT_BSTR;
675 V_BSTR(&var_headers) = lpszHeaders ? SysAllocString(lpszHeaders) : NULL;
677 V_VT(params+2) = (VT_BYREF|VT_VARIANT);
678 V_VARIANTREF(params+2) = &var_post_data2;
679 V_VT(&var_post_data2) = (VT_BYREF|VT_VARIANT);
680 V_VARIANTREF(&var_post_data2) = &var_post_data;
682 if(post_data) {
683 V_VT(&var_post_data) = VT_UI1|VT_ARRAY;
684 V_ARRAY(&var_post_data) = post_data;
685 }else {
686 V_VT(&var_post_data) = VT_EMPTY;
689 V_VT(params+3) = (VT_BYREF|VT_VARIANT);
690 V_VARIANTREF(params+3) = &var_frame_name;
691 V_VT(&var_frame_name) = VT_BSTR;
692 V_BSTR(&var_frame_name) = NULL;
694 V_VT(params+4) = (VT_BYREF|VT_VARIANT);
695 V_VARIANTREF(params+4) = &var_flags;
696 V_VT(&var_flags) = VT_I4;
697 V_I4(&var_flags) = 0;
699 V_VT(params+5) = (VT_BYREF|VT_VARIANT);
700 V_VARIANTREF(params+5) = &var_url;
701 V_VT(&var_url) = VT_BSTR;
702 V_BSTR(&var_url) = SysAllocString(lpszUrl);
704 V_VT(params+6) = (VT_DISPATCH);
705 V_DISPATCH(params+6) = This->doc_host->disp;
707 TRACE(">>>\n");
708 call_sink(This->doc_host->cps.wbe2, DISPID_BEFORENAVIGATE2, &dp);
709 TRACE("<<<\n");
711 SysFreeString(V_BSTR(&var_url));
712 SysFreeString(V_BSTR(&var_headers));
713 SafeArrayDestroy(post_data);
715 *pfCancel = !!cancel;
716 return S_OK;
719 static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
720 IDocObjectService* iface,
721 IHTMLWindow2 *pHTMLWindow2,
722 DWORD dwFlags)
724 ShellBrowser *This = impl_from_IDocObjectService(iface);
725 FIXME("%p %p %x\n", This, pHTMLWindow2, dwFlags);
726 return E_NOTIMPL;
729 static HRESULT WINAPI DocObjectService_FireDownloadBegin(
730 IDocObjectService* iface)
732 ShellBrowser *This = impl_from_IDocObjectService(iface);
733 FIXME("%p\n", This);
734 return E_NOTIMPL;
737 static HRESULT WINAPI DocObjectService_FireDownloadComplete(
738 IDocObjectService* iface)
740 ShellBrowser *This = impl_from_IDocObjectService(iface);
741 FIXME("%p\n", This);
742 return E_NOTIMPL;
745 static HRESULT WINAPI DocObjectService_FireDocumentComplete(
746 IDocObjectService* iface,
747 IHTMLWindow2 *pHTMLWindow,
748 DWORD dwFlags)
750 ShellBrowser *This = impl_from_IDocObjectService(iface);
751 FIXME("%p %p %x\n", This, pHTMLWindow, dwFlags);
752 return E_NOTIMPL;
755 static HRESULT WINAPI DocObjectService_UpdateDesktopComponent(
756 IDocObjectService* iface,
757 IHTMLWindow2 *pHTMLWindow)
759 ShellBrowser *This = impl_from_IDocObjectService(iface);
760 FIXME("%p %p\n", This, pHTMLWindow);
761 return E_NOTIMPL;
764 static HRESULT WINAPI DocObjectService_GetPendingUrl(
765 IDocObjectService* iface,
766 BSTR *pbstrPendingUrl)
768 ShellBrowser *This = impl_from_IDocObjectService(iface);
769 FIXME("%p %p\n", This, pbstrPendingUrl);
770 return E_NOTIMPL;
773 static HRESULT WINAPI DocObjectService_ActiveElementChanged(
774 IDocObjectService* iface,
775 IHTMLElement *pHTMLElement)
777 ShellBrowser *This = impl_from_IDocObjectService(iface);
778 FIXME("%p %p\n", This, pHTMLElement);
779 return E_NOTIMPL;
782 static HRESULT WINAPI DocObjectService_GetUrlSearchComponent(
783 IDocObjectService* iface,
784 BSTR *pbstrSearch)
786 ShellBrowser *This = impl_from_IDocObjectService(iface);
787 FIXME("%p %p\n", This, pbstrSearch);
788 return E_NOTIMPL;
791 static HRESULT WINAPI DocObjectService_IsErrorUrl(
792 IDocObjectService* iface,
793 LPCWSTR lpszUrl,
794 BOOL *pfIsError)
796 ShellBrowser *This = impl_from_IDocObjectService(iface);
797 FIXME("%p %s %p\n", This, debugstr_w(lpszUrl), pfIsError);
799 *pfIsError = FALSE;
800 return S_OK;
803 static const IDocObjectServiceVtbl DocObjectServiceVtbl = {
804 DocObjectService_QueryInterface,
805 DocObjectService_AddRef,
806 DocObjectService_Release,
807 DocObjectService_FireBeforeNavigate2,
808 DocObjectService_FireNavigateComplete2,
809 DocObjectService_FireDownloadBegin,
810 DocObjectService_FireDownloadComplete,
811 DocObjectService_FireDocumentComplete,
812 DocObjectService_UpdateDesktopComponent,
813 DocObjectService_GetPendingUrl,
814 DocObjectService_ActiveElementChanged,
815 DocObjectService_GetUrlSearchComponent,
816 DocObjectService_IsErrorUrl
819 HRESULT create_browser_service(DocHost *doc_host, ShellBrowser **ret)
821 ShellBrowser *sb;
823 sb = heap_alloc(sizeof(ShellBrowser));
824 if(!sb)
825 return E_OUTOFMEMORY;
827 sb->IShellBrowser_iface.lpVtbl = &ShellBrowserVtbl;
828 sb->IBrowserService_iface.lpVtbl = &BrowserServiceVtbl;
829 sb->IDocObjectService_iface.lpVtbl = &DocObjectServiceVtbl;
831 sb->ref = 1;
832 sb->doc_host = doc_host;
834 *ret = sb;
835 return S_OK;
838 void detach_browser_service(ShellBrowser *sb)
840 sb->doc_host = NULL;
841 IShellBrowser_Release(&sb->IShellBrowser_iface);