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
23 #include "shdeprecated.h"
24 #include "docobjectservice.h"
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
31 IShellBrowser IShellBrowser_iface;
32 IBrowserService IBrowserService_iface;
33 IDocObjectService IDocObjectService_iface;
38 static inline ShellBrowser *impl_from_IShellBrowser(IShellBrowser *iface)
40 return CONTAINING_RECORD(iface, ShellBrowser, IShellBrowser_iface);
43 static HRESULT WINAPI ShellBrowser_QueryInterface(
48 ShellBrowser *This = impl_from_IShellBrowser(iface);
51 if(IsEqualGUID(&IID_IShellBrowser, riid) || IsEqualGUID(&IID_IOleWindow, riid)
52 || IsEqualGUID(&IID_IUnknown, riid))
53 *ppvObject = &This->IShellBrowser_iface;
54 else if(IsEqualGUID(&IID_IBrowserService, riid))
55 *ppvObject = &This->IBrowserService_iface;
56 else if(IsEqualGUID(&IID_IDocObjectService, riid))
57 *ppvObject = &This->IDocObjectService_iface;
60 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
61 IUnknown_AddRef((IUnknown*)*ppvObject);
65 FIXME("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
69 static ULONG WINAPI ShellBrowser_AddRef(
72 ShellBrowser *This = impl_from_IShellBrowser(iface);
73 LONG ref = InterlockedIncrement(&This->ref);
75 TRACE("(%p) ref=%d\n", This, ref);
80 static ULONG WINAPI ShellBrowser_Release(
83 ShellBrowser *This = impl_from_IShellBrowser(iface);
84 LONG ref = InterlockedDecrement(&This->ref);
86 TRACE("(%p) ref=%d\n", This, ref);
93 static HRESULT WINAPI ShellBrowser_GetWindow(
97 ShellBrowser *This = impl_from_IShellBrowser(iface);
98 FIXME("%p %p\n", This, phwnd);
102 static HRESULT WINAPI ShellBrowser_ContextSensitiveHelp(
103 IShellBrowser* iface,
106 ShellBrowser *This = impl_from_IShellBrowser(iface);
107 FIXME("%p %d\n", This, fEnterMode);
111 static HRESULT WINAPI ShellBrowser_InsertMenusSB(
112 IShellBrowser* iface,
114 LPOLEMENUGROUPWIDTHS lpMenuWidths)
116 ShellBrowser *This = impl_from_IShellBrowser(iface);
117 FIXME("%p %p %p\n", This, hmenuShared, lpMenuWidths);
121 static HRESULT WINAPI ShellBrowser_SetMenuSB(
122 IShellBrowser* iface,
124 HOLEMENU holemenuReserved,
125 HWND hwndActiveObject)
127 ShellBrowser *This = impl_from_IShellBrowser(iface);
128 FIXME("%p %p %p %p\n", This, hmenuShared, holemenuReserved, hwndActiveObject);
132 static HRESULT WINAPI ShellBrowser_RemoveMenusSB(
133 IShellBrowser* iface,
136 ShellBrowser *This = impl_from_IShellBrowser(iface);
137 FIXME("%p %p\n", This, hmenuShared);
141 static HRESULT WINAPI ShellBrowser_SetStatusTextSB(
142 IShellBrowser* iface,
143 LPCOLESTR pszStatusText)
145 ShellBrowser *This = impl_from_IShellBrowser(iface);
146 FIXME("%p %s\n", This, debugstr_w(pszStatusText));
150 static HRESULT WINAPI ShellBrowser_EnableModelessSB(
151 IShellBrowser* iface,
154 ShellBrowser *This = impl_from_IShellBrowser(iface);
155 FIXME("%p %d\n", This, fEnable);
159 static HRESULT WINAPI ShellBrowser_TranslateAcceleratorSB(
160 IShellBrowser* iface,
164 ShellBrowser *This = impl_from_IShellBrowser(iface);
165 FIXME("%p %p %d\n", This, pmsg, (int)wID);
169 static HRESULT WINAPI ShellBrowser_BrowseObject(
170 IShellBrowser* iface,
174 ShellBrowser *This = impl_from_IShellBrowser(iface);
175 FIXME("%p %p %u\n", This, pidl, wFlags);
179 static HRESULT WINAPI ShellBrowser_GetViewStateStream(
180 IShellBrowser* iface,
184 ShellBrowser *This = impl_from_IShellBrowser(iface);
185 FIXME("%p %x %p\n", This, grfMode, ppStrm);
189 static HRESULT WINAPI ShellBrowser_GetControlWindow(
190 IShellBrowser* iface,
194 ShellBrowser *This = impl_from_IShellBrowser(iface);
195 FIXME("%p %u %p\n", This, id, phwnd);
199 static HRESULT WINAPI ShellBrowser_SendControlMsg(
200 IShellBrowser* iface,
207 ShellBrowser *This = impl_from_IShellBrowser(iface);
208 FIXME("%p %u %u %p\n", This, id, uMsg, pret);
212 static HRESULT WINAPI ShellBrowser_QueryActiveShellView(
213 IShellBrowser* iface,
216 ShellBrowser *This = impl_from_IShellBrowser(iface);
217 FIXME("%p %p\n", This, ppshv);
221 static HRESULT WINAPI ShellBrowser_OnViewWindowActive(
222 IShellBrowser* iface,
225 ShellBrowser *This = impl_from_IShellBrowser(iface);
226 FIXME("%p %p\n", This, pshv);
230 static HRESULT WINAPI ShellBrowser_SetToolbarItems(
231 IShellBrowser* iface,
232 LPTBBUTTONSB lpButtons,
236 ShellBrowser *This = impl_from_IShellBrowser(iface);
237 FIXME("%p %p %u %u\n", This, lpButtons, nButtons, uFlags);
241 static const IShellBrowserVtbl ShellBrowserVtbl = {
242 ShellBrowser_QueryInterface,
244 ShellBrowser_Release,
245 ShellBrowser_GetWindow,
246 ShellBrowser_ContextSensitiveHelp,
247 ShellBrowser_InsertMenusSB,
248 ShellBrowser_SetMenuSB,
249 ShellBrowser_RemoveMenusSB,
250 ShellBrowser_SetStatusTextSB,
251 ShellBrowser_EnableModelessSB,
252 ShellBrowser_TranslateAcceleratorSB,
253 ShellBrowser_BrowseObject,
254 ShellBrowser_GetViewStateStream,
255 ShellBrowser_GetControlWindow,
256 ShellBrowser_SendControlMsg,
257 ShellBrowser_QueryActiveShellView,
258 ShellBrowser_OnViewWindowActive,
259 ShellBrowser_SetToolbarItems
262 static inline ShellBrowser *impl_from_IBrowserService(IBrowserService *iface)
264 return CONTAINING_RECORD(iface, ShellBrowser, IBrowserService_iface);
267 static HRESULT WINAPI BrowserService_QueryInterface(
268 IBrowserService* iface,
272 ShellBrowser *This = impl_from_IBrowserService(iface);
273 return IShellBrowser_QueryInterface(&This->IShellBrowser_iface, riid, ppvObject);
276 static ULONG WINAPI BrowserService_AddRef(
277 IBrowserService *iface)
279 ShellBrowser *This = impl_from_IBrowserService(iface);
280 return IShellBrowser_AddRef(&This->IShellBrowser_iface);
283 static ULONG WINAPI BrowserService_Release(
284 IBrowserService* iface)
286 ShellBrowser *This = impl_from_IBrowserService(iface);
287 return IShellBrowser_Release(&This->IShellBrowser_iface);
290 static HRESULT WINAPI BrowserService_GetParentSite(
291 IBrowserService* iface,
292 IOleInPlaceSite **ppipsite)
294 ShellBrowser *This = impl_from_IBrowserService(iface);
295 FIXME("%p %p\n", This, ppipsite);
299 static HRESULT WINAPI BrowserService_SetTitle(
300 IBrowserService* iface,
304 ShellBrowser *This = impl_from_IBrowserService(iface);
305 FIXME("%p %p %s\n", This, psv, debugstr_w(pszName));
309 static HRESULT WINAPI BrowserService_GetTitle(
310 IBrowserService* iface,
315 ShellBrowser *This = impl_from_IBrowserService(iface);
316 FIXME("%p %p %p %d\n", This, psv, pszName, cchName);
320 static HRESULT WINAPI BrowserService_GetOleObject(
321 IBrowserService* iface,
324 ShellBrowser *This = impl_from_IBrowserService(iface);
325 FIXME("%p %p\n", This, ppobjv);
329 static HRESULT WINAPI BrowserService_GetTravelLog(
330 IBrowserService* iface,
333 ShellBrowser *This = impl_from_IBrowserService(iface);
334 FIXME("%p %p\n", This, pptl);
338 static HRESULT WINAPI BrowserService_ShowControlWindow(
339 IBrowserService* iface,
343 ShellBrowser *This = impl_from_IBrowserService(iface);
344 FIXME("%p %u %d\n", This, id, fShow);
348 static HRESULT WINAPI BrowserService_IsControlWindowShown(
349 IBrowserService* iface,
353 ShellBrowser *This = impl_from_IBrowserService(iface);
354 FIXME("%p %u %p\n", This, id, pfShown);
358 static HRESULT WINAPI BrowserService_IEGetDisplayName(
359 IBrowserService* iface,
360 PCIDLIST_ABSOLUTE pidl,
364 ShellBrowser *This = impl_from_IBrowserService(iface);
365 FIXME("%p %p %p %u\n", This, pidl, pwszName, uFlags);
369 static HRESULT WINAPI BrowserService_IEParseDisplayName(
370 IBrowserService* iface,
373 PIDLIST_ABSOLUTE *ppidlOut)
375 ShellBrowser *This = impl_from_IBrowserService(iface);
376 FIXME("%p %u %s %p\n", This, uiCP, debugstr_w(pwszPath), ppidlOut);
380 static HRESULT WINAPI BrowserService_DisplayParseError(
381 IBrowserService* iface,
385 ShellBrowser *This = impl_from_IBrowserService(iface);
386 FIXME("%p %x %s\n", This, hres, debugstr_w(pwszPath));
390 static HRESULT WINAPI BrowserService_NavigateToPidl(
391 IBrowserService* iface,
392 PCIDLIST_ABSOLUTE pidl,
395 ShellBrowser *This = impl_from_IBrowserService(iface);
396 FIXME("%p %p %d\n", This, pidl, grfHLNF);
400 static HRESULT WINAPI BrowserService_SetNavigateState(
401 IBrowserService* iface,
404 ShellBrowser *This = impl_from_IBrowserService(iface);
405 FIXME("%p %d\n", This, bnstate);
409 static HRESULT WINAPI BrowserService_GetNavigateState(
410 IBrowserService* iface,
413 ShellBrowser *This = impl_from_IBrowserService(iface);
414 FIXME("%p %p\n", This, pbnstate);
418 static HRESULT WINAPI BrowserService_NotifyRedirect(
419 IBrowserService* iface,
421 PCIDLIST_ABSOLUTE pidl,
424 ShellBrowser *This = impl_from_IBrowserService(iface);
425 FIXME("%p %p %p %p\n", This, psv, pidl, pfDidBrowse);
429 static HRESULT WINAPI BrowserService_UpdateWindowList(
430 IBrowserService* iface)
432 ShellBrowser *This = impl_from_IBrowserService(iface);
437 static HRESULT WINAPI BrowserService_UpdateBackForwardState(
438 IBrowserService* iface)
440 ShellBrowser *This = impl_from_IBrowserService(iface);
445 static HRESULT WINAPI BrowserService_SetFlags(
446 IBrowserService* iface,
450 ShellBrowser *This = impl_from_IBrowserService(iface);
451 FIXME("%p %x %x\n", This, dwFlags, dwFlagMask);
455 static HRESULT WINAPI BrowserService_GetFlags(
456 IBrowserService* iface,
459 ShellBrowser *This = impl_from_IBrowserService(iface);
460 FIXME("%p %p\n", This, pdwFlags);
464 static HRESULT WINAPI BrowserService_CanNavigateNow(
465 IBrowserService* iface)
467 ShellBrowser *This = impl_from_IBrowserService(iface);
472 static HRESULT WINAPI BrowserService_GetPidl(
473 IBrowserService* iface,
474 PIDLIST_ABSOLUTE *ppidl)
476 ShellBrowser *This = impl_from_IBrowserService(iface);
477 FIXME("%p %p\n", This, ppidl);
481 static HRESULT WINAPI BrowserService_SetReferrer(
482 IBrowserService* iface,
483 PCIDLIST_ABSOLUTE pidl)
485 ShellBrowser *This = impl_from_IBrowserService(iface);
486 FIXME("%p %p\n", This, pidl);
490 static DWORD WINAPI BrowserService_GetBrowserIndex(
491 IBrowserService* iface)
493 ShellBrowser *This = impl_from_IBrowserService(iface);
498 static HRESULT WINAPI BrowserService_GetBrowserByIndex(
499 IBrowserService* iface,
503 ShellBrowser *This = impl_from_IBrowserService(iface);
504 FIXME("%p %x %p\n", This, dwID, ppunk);
508 static HRESULT WINAPI BrowserService_GetHistoryObject(
509 IBrowserService* iface,
514 ShellBrowser *This = impl_from_IBrowserService(iface);
515 FIXME("%p %p %p %p\n", This, ppole, pstm, ppbc);
519 static HRESULT WINAPI BrowserService_SetHistoryObject(
520 IBrowserService* iface,
524 ShellBrowser *This = impl_from_IBrowserService(iface);
525 FIXME("%p %p %d\n", This, pole, fIsLocalAnchor);
529 static HRESULT WINAPI BrowserService_CacheOLEServer(
530 IBrowserService* iface,
533 ShellBrowser *This = impl_from_IBrowserService(iface);
534 FIXME("%p %p\n", This, pole);
538 static HRESULT WINAPI BrowserService_GetSetCodePage(
539 IBrowserService* iface,
543 ShellBrowser *This = impl_from_IBrowserService(iface);
544 FIXME("%p %p %p\n", This, pvarIn, pvarOut);
548 static HRESULT WINAPI BrowserService_OnHttpEquiv(
549 IBrowserService* iface,
555 ShellBrowser *This = impl_from_IBrowserService(iface);
556 FIXME("%p %p %d %p %p\n", This, psv, fDone, pvarargIn, pvarargOut);
560 static HRESULT WINAPI BrowserService_GetPalette(
561 IBrowserService* iface,
564 ShellBrowser *This = impl_from_IBrowserService(iface);
565 FIXME("%p %p\n", This, hpal);
569 static HRESULT WINAPI BrowserService_RegisterWindow(
570 IBrowserService* iface,
574 ShellBrowser *This = impl_from_IBrowserService(iface);
575 FIXME("%p %d %d\n", This, fForceRegister, swc);
579 static const IBrowserServiceVtbl BrowserServiceVtbl = {
580 BrowserService_QueryInterface,
581 BrowserService_AddRef,
582 BrowserService_Release,
583 BrowserService_GetParentSite,
584 BrowserService_SetTitle,
585 BrowserService_GetTitle,
586 BrowserService_GetOleObject,
587 BrowserService_GetTravelLog,
588 BrowserService_ShowControlWindow,
589 BrowserService_IsControlWindowShown,
590 BrowserService_IEGetDisplayName,
591 BrowserService_IEParseDisplayName,
592 BrowserService_DisplayParseError,
593 BrowserService_NavigateToPidl,
594 BrowserService_SetNavigateState,
595 BrowserService_GetNavigateState,
596 BrowserService_NotifyRedirect,
597 BrowserService_UpdateWindowList,
598 BrowserService_UpdateBackForwardState,
599 BrowserService_SetFlags,
600 BrowserService_GetFlags,
601 BrowserService_CanNavigateNow,
602 BrowserService_GetPidl,
603 BrowserService_SetReferrer,
604 BrowserService_GetBrowserIndex,
605 BrowserService_GetBrowserByIndex,
606 BrowserService_GetHistoryObject,
607 BrowserService_SetHistoryObject,
608 BrowserService_CacheOLEServer,
609 BrowserService_GetSetCodePage,
610 BrowserService_OnHttpEquiv,
611 BrowserService_GetPalette,
612 BrowserService_RegisterWindow
615 static inline ShellBrowser *impl_from_IDocObjectService(IDocObjectService *iface)
617 return CONTAINING_RECORD(iface, ShellBrowser, IDocObjectService_iface);
620 static HRESULT WINAPI DocObjectService_QueryInterface(
621 IDocObjectService* iface,
625 ShellBrowser *This = impl_from_IDocObjectService(iface);
626 return IShellBrowser_QueryInterface(&This->IShellBrowser_iface, riid, ppvObject);
629 static ULONG WINAPI DocObjectService_AddRef(
630 IDocObjectService* iface)
632 ShellBrowser *This = impl_from_IDocObjectService(iface);
633 return IShellBrowser_AddRef(&This->IShellBrowser_iface);
636 static ULONG WINAPI DocObjectService_Release(
637 IDocObjectService* iface)
639 ShellBrowser *This = impl_from_IDocObjectService(iface);
640 return IShellBrowser_Release(&This->IShellBrowser_iface);
643 static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
644 IDocObjectService* iface,
645 IDispatch *pDispatch,
648 LPCWSTR lpszFrameName,
655 ShellBrowser *This = impl_from_IDocObjectService(iface);
656 FIXME("%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);
662 static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
663 IDocObjectService* iface,
664 IHTMLWindow2 *pHTMLWindow2,
667 ShellBrowser *This = impl_from_IDocObjectService(iface);
668 FIXME("%p %p %x\n", This, pHTMLWindow2, dwFlags);
672 static HRESULT WINAPI DocObjectService_FireDownloadBegin(
673 IDocObjectService* iface)
675 ShellBrowser *This = impl_from_IDocObjectService(iface);
680 static HRESULT WINAPI DocObjectService_FireDownloadComplete(
681 IDocObjectService* iface)
683 ShellBrowser *This = impl_from_IDocObjectService(iface);
688 static HRESULT WINAPI DocObjectService_FireDocumentComplete(
689 IDocObjectService* iface,
690 IHTMLWindow2 *pHTMLWindow,
693 ShellBrowser *This = impl_from_IDocObjectService(iface);
694 FIXME("%p %p %x\n", This, pHTMLWindow, dwFlags);
698 static HRESULT WINAPI DocObjectService_UpdateDesktopComponent(
699 IDocObjectService* iface,
700 IHTMLWindow2 *pHTMLWindow)
702 ShellBrowser *This = impl_from_IDocObjectService(iface);
703 FIXME("%p %p\n", This, pHTMLWindow);
707 static HRESULT WINAPI DocObjectService_GetPendingUrl(
708 IDocObjectService* iface,
709 BSTR *pbstrPendingUrl)
711 ShellBrowser *This = impl_from_IDocObjectService(iface);
712 FIXME("%p %p\n", This, pbstrPendingUrl);
716 static HRESULT WINAPI DocObjectService_ActiveElementChanged(
717 IDocObjectService* iface,
718 IHTMLElement *pHTMLElement)
720 ShellBrowser *This = impl_from_IDocObjectService(iface);
721 FIXME("%p %p\n", This, pHTMLElement);
725 static HRESULT WINAPI DocObjectService_GetUrlSearchComponent(
726 IDocObjectService* iface,
729 ShellBrowser *This = impl_from_IDocObjectService(iface);
730 FIXME("%p %p\n", This, pbstrSearch);
734 static HRESULT WINAPI DocObjectService_IsErrorUrl(
735 IDocObjectService* iface,
739 ShellBrowser *This = impl_from_IDocObjectService(iface);
740 FIXME("%p %s %p\n", This, debugstr_w(lpszUrl), pfIsError);
746 static const IDocObjectServiceVtbl DocObjectServiceVtbl = {
747 DocObjectService_QueryInterface,
748 DocObjectService_AddRef,
749 DocObjectService_Release,
750 DocObjectService_FireBeforeNavigate2,
751 DocObjectService_FireNavigateComplete2,
752 DocObjectService_FireDownloadBegin,
753 DocObjectService_FireDownloadComplete,
754 DocObjectService_FireDocumentComplete,
755 DocObjectService_UpdateDesktopComponent,
756 DocObjectService_GetPendingUrl,
757 DocObjectService_ActiveElementChanged,
758 DocObjectService_GetUrlSearchComponent,
759 DocObjectService_IsErrorUrl
762 HRESULT ShellBrowser_Create(IShellBrowser **ppv)
766 sb = heap_alloc(sizeof(ShellBrowser));
768 return E_OUTOFMEMORY;
770 sb->IShellBrowser_iface.lpVtbl = &ShellBrowserVtbl;
771 sb->IBrowserService_iface.lpVtbl = &BrowserServiceVtbl;
772 sb->IDocObjectService_iface.lpVtbl = &DocObjectServiceVtbl;
776 *ppv = &sb->IShellBrowser_iface;