ntoskrnl.exe: Update version resource.
[wine] / dlls / ieframe / shellbrowser.c
1 /*
2  * Implementation of IShellBrowser interface
3  *
4  * Copyright 2011 Piotr Caban for CodeWeavers
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #include "ieframe.h"
22
23 #include "shdeprecated.h"
24 #include "docobjectservice.h"
25
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
29
30 typedef struct {
31     IShellBrowser IShellBrowser_iface;
32     IBrowserService IBrowserService_iface;
33     IDocObjectService IDocObjectService_iface;
34
35     LONG ref;
36 } ShellBrowser;
37
38 static inline ShellBrowser *impl_from_IShellBrowser(IShellBrowser *iface)
39 {
40     return CONTAINING_RECORD(iface, ShellBrowser, IShellBrowser_iface);
41 }
42
43 static HRESULT WINAPI ShellBrowser_QueryInterface(
44         IShellBrowser* iface,
45         REFIID riid,
46         void **ppvObject)
47 {
48     ShellBrowser *This = impl_from_IShellBrowser(iface);
49     *ppvObject = NULL;
50
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;
58
59     if(*ppvObject) {
60         TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
61         IUnknown_AddRef((IUnknown*)*ppvObject);
62         return S_OK;
63     }
64
65     FIXME("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
66     return E_NOINTERFACE;
67 }
68
69 static ULONG WINAPI ShellBrowser_AddRef(
70         IShellBrowser* iface)
71 {
72     ShellBrowser *This = impl_from_IShellBrowser(iface);
73     LONG ref = InterlockedIncrement(&This->ref);
74
75     TRACE("(%p) ref=%d\n", This, ref);
76
77     return ref;
78 }
79
80 static ULONG WINAPI ShellBrowser_Release(
81         IShellBrowser* iface)
82 {
83     ShellBrowser *This = impl_from_IShellBrowser(iface);
84     LONG ref = InterlockedDecrement(&This->ref);
85
86     TRACE("(%p) ref=%d\n", This, ref);
87
88     if(!ref)
89         heap_free(This);
90     return ref;
91 }
92
93 static HRESULT WINAPI ShellBrowser_GetWindow(
94         IShellBrowser* iface,
95         HWND *phwnd)
96 {
97     ShellBrowser *This = impl_from_IShellBrowser(iface);
98     FIXME("%p %p\n", This, phwnd);
99     return E_NOTIMPL;
100 }
101
102 static HRESULT WINAPI ShellBrowser_ContextSensitiveHelp(
103         IShellBrowser* iface,
104         BOOL fEnterMode)
105 {
106     ShellBrowser *This = impl_from_IShellBrowser(iface);
107     FIXME("%p %d\n", This, fEnterMode);
108     return E_NOTIMPL;
109 }
110
111 static HRESULT WINAPI ShellBrowser_InsertMenusSB(
112         IShellBrowser* iface,
113         HMENU hmenuShared,
114         LPOLEMENUGROUPWIDTHS lpMenuWidths)
115 {
116     ShellBrowser *This = impl_from_IShellBrowser(iface);
117     FIXME("%p %p %p\n", This, hmenuShared, lpMenuWidths);
118     return E_NOTIMPL;
119 }
120
121 static HRESULT WINAPI ShellBrowser_SetMenuSB(
122         IShellBrowser* iface,
123         HMENU hmenuShared,
124         HOLEMENU holemenuReserved,
125         HWND hwndActiveObject)
126 {
127     ShellBrowser *This = impl_from_IShellBrowser(iface);
128     FIXME("%p %p %p %p\n", This, hmenuShared, holemenuReserved, hwndActiveObject);
129     return E_NOTIMPL;
130 }
131
132 static HRESULT WINAPI ShellBrowser_RemoveMenusSB(
133         IShellBrowser* iface,
134         HMENU hmenuShared)
135 {
136     ShellBrowser *This = impl_from_IShellBrowser(iface);
137     FIXME("%p %p\n", This, hmenuShared);
138     return E_NOTIMPL;
139 }
140
141 static HRESULT WINAPI ShellBrowser_SetStatusTextSB(
142         IShellBrowser* iface,
143         LPCOLESTR pszStatusText)
144 {
145     ShellBrowser *This = impl_from_IShellBrowser(iface);
146     FIXME("%p %s\n", This, debugstr_w(pszStatusText));
147     return E_NOTIMPL;
148 }
149
150 static HRESULT WINAPI ShellBrowser_EnableModelessSB(
151         IShellBrowser* iface,
152         BOOL fEnable)
153 {
154     ShellBrowser *This = impl_from_IShellBrowser(iface);
155     FIXME("%p %d\n", This, fEnable);
156     return E_NOTIMPL;
157 }
158
159 static HRESULT WINAPI ShellBrowser_TranslateAcceleratorSB(
160         IShellBrowser* iface,
161         MSG *pmsg,
162         WORD wID)
163 {
164     ShellBrowser *This = impl_from_IShellBrowser(iface);
165     FIXME("%p %p %d\n", This, pmsg, (int)wID);
166     return E_NOTIMPL;
167 }
168
169 static HRESULT WINAPI ShellBrowser_BrowseObject(
170         IShellBrowser* iface,
171         LPCITEMIDLIST pidl,
172         UINT wFlags)
173 {
174     ShellBrowser *This = impl_from_IShellBrowser(iface);
175     FIXME("%p %p %u\n", This, pidl, wFlags);
176     return E_NOTIMPL;
177 }
178
179 static HRESULT WINAPI ShellBrowser_GetViewStateStream(
180         IShellBrowser* iface,
181         DWORD grfMode,
182         IStream **ppStrm)
183 {
184     ShellBrowser *This = impl_from_IShellBrowser(iface);
185     FIXME("%p %x %p\n", This, grfMode, ppStrm);
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI ShellBrowser_GetControlWindow(
190         IShellBrowser* iface,
191         UINT id,
192         HWND *phwnd)
193 {
194     ShellBrowser *This = impl_from_IShellBrowser(iface);
195     FIXME("%p %u %p\n", This, id, phwnd);
196     return E_NOTIMPL;
197 }
198
199 static HRESULT WINAPI ShellBrowser_SendControlMsg(
200         IShellBrowser* iface,
201         UINT id,
202         UINT uMsg,
203         WPARAM wParam,
204         LPARAM lParam,
205         LRESULT *pret)
206 {
207     ShellBrowser *This = impl_from_IShellBrowser(iface);
208     FIXME("%p %u %u %p\n", This, id, uMsg, pret);
209     return E_NOTIMPL;
210 }
211
212 static HRESULT WINAPI ShellBrowser_QueryActiveShellView(
213         IShellBrowser* iface,
214         IShellView **ppshv)
215 {
216     ShellBrowser *This = impl_from_IShellBrowser(iface);
217     FIXME("%p %p\n", This, ppshv);
218     return E_NOTIMPL;
219 }
220
221 static HRESULT WINAPI ShellBrowser_OnViewWindowActive(
222         IShellBrowser* iface,
223         IShellView *pshv)
224 {
225     ShellBrowser *This = impl_from_IShellBrowser(iface);
226     FIXME("%p %p\n", This, pshv);
227     return E_NOTIMPL;
228 }
229
230 static HRESULT WINAPI ShellBrowser_SetToolbarItems(
231         IShellBrowser* iface,
232         LPTBBUTTONSB lpButtons,
233         UINT nButtons,
234         UINT uFlags)
235 {
236     ShellBrowser *This = impl_from_IShellBrowser(iface);
237     FIXME("%p %p %u %u\n", This, lpButtons, nButtons, uFlags);
238     return E_NOTIMPL;
239 }
240
241 static const IShellBrowserVtbl ShellBrowserVtbl = {
242     ShellBrowser_QueryInterface,
243     ShellBrowser_AddRef,
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
260 };
261
262 static inline ShellBrowser *impl_from_IBrowserService(IBrowserService *iface)
263 {
264     return CONTAINING_RECORD(iface, ShellBrowser, IBrowserService_iface);
265 }
266
267 static HRESULT WINAPI BrowserService_QueryInterface(
268         IBrowserService* iface,
269         REFIID riid,
270         void **ppvObject)
271 {
272     ShellBrowser *This = impl_from_IBrowserService(iface);
273     return IShellBrowser_QueryInterface(&This->IShellBrowser_iface, riid, ppvObject);
274 }
275
276 static ULONG WINAPI BrowserService_AddRef(
277         IBrowserService *iface)
278 {
279     ShellBrowser *This = impl_from_IBrowserService(iface);
280     return IShellBrowser_AddRef(&This->IShellBrowser_iface);
281 }
282
283 static ULONG WINAPI BrowserService_Release(
284         IBrowserService* iface)
285 {
286     ShellBrowser *This = impl_from_IBrowserService(iface);
287     return IShellBrowser_Release(&This->IShellBrowser_iface);
288 }
289
290 static HRESULT WINAPI BrowserService_GetParentSite(
291         IBrowserService* iface,
292         IOleInPlaceSite **ppipsite)
293 {
294     ShellBrowser *This = impl_from_IBrowserService(iface);
295     FIXME("%p %p\n", This, ppipsite);
296     return E_NOTIMPL;
297 }
298
299 static HRESULT WINAPI BrowserService_SetTitle(
300         IBrowserService* iface,
301         IShellView *psv,
302         LPCWSTR pszName)
303 {
304     ShellBrowser *This = impl_from_IBrowserService(iface);
305     FIXME("%p %p %s\n", This, psv, debugstr_w(pszName));
306     return E_NOTIMPL;
307 }
308
309 static HRESULT WINAPI BrowserService_GetTitle(
310         IBrowserService* iface,
311         IShellView *psv,
312         LPWSTR pszName,
313         DWORD cchName)
314 {
315     ShellBrowser *This = impl_from_IBrowserService(iface);
316     FIXME("%p %p %p %d\n", This, psv, pszName, cchName);
317     return E_NOTIMPL;
318 }
319
320 static HRESULT WINAPI BrowserService_GetOleObject(
321         IBrowserService* iface,
322         IOleObject **ppobjv)
323 {
324     ShellBrowser *This = impl_from_IBrowserService(iface);
325     FIXME("%p %p\n", This, ppobjv);
326     return E_NOTIMPL;
327 }
328
329 static HRESULT WINAPI BrowserService_GetTravelLog(
330         IBrowserService* iface,
331         ITravelLog **pptl)
332 {
333     ShellBrowser *This = impl_from_IBrowserService(iface);
334     FIXME("%p %p\n", This, pptl);
335     return E_NOTIMPL;
336 }
337
338 static HRESULT WINAPI BrowserService_ShowControlWindow(
339         IBrowserService* iface,
340         UINT id,
341         BOOL fShow)
342 {
343     ShellBrowser *This = impl_from_IBrowserService(iface);
344     FIXME("%p %u %d\n", This, id, fShow);
345     return E_NOTIMPL;
346 }
347
348 static HRESULT WINAPI BrowserService_IsControlWindowShown(
349         IBrowserService* iface,
350         UINT id,
351         BOOL *pfShown)
352 {
353     ShellBrowser *This = impl_from_IBrowserService(iface);
354     FIXME("%p %u %p\n", This, id, pfShown);
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI BrowserService_IEGetDisplayName(
359         IBrowserService* iface,
360         PCIDLIST_ABSOLUTE pidl,
361         LPWSTR pwszName,
362         UINT uFlags)
363 {
364     ShellBrowser *This = impl_from_IBrowserService(iface);
365     FIXME("%p %p %p %u\n", This, pidl, pwszName, uFlags);
366     return E_NOTIMPL;
367 }
368
369 static HRESULT WINAPI BrowserService_IEParseDisplayName(
370         IBrowserService* iface,
371         UINT uiCP,
372         LPCWSTR pwszPath,
373         PIDLIST_ABSOLUTE *ppidlOut)
374 {
375     ShellBrowser *This = impl_from_IBrowserService(iface);
376     FIXME("%p %u %s %p\n", This, uiCP, debugstr_w(pwszPath), ppidlOut);
377     return E_NOTIMPL;
378 }
379
380 static HRESULT WINAPI BrowserService_DisplayParseError(
381         IBrowserService* iface,
382         HRESULT hres,
383         LPCWSTR pwszPath)
384 {
385     ShellBrowser *This = impl_from_IBrowserService(iface);
386     FIXME("%p %x %s\n", This, hres, debugstr_w(pwszPath));
387     return E_NOTIMPL;
388 }
389
390 static HRESULT WINAPI BrowserService_NavigateToPidl(
391         IBrowserService* iface,
392         PCIDLIST_ABSOLUTE pidl,
393         DWORD grfHLNF)
394 {
395     ShellBrowser *This = impl_from_IBrowserService(iface);
396     FIXME("%p %p %d\n", This, pidl, grfHLNF);
397     return E_NOTIMPL;
398 }
399
400 static HRESULT WINAPI BrowserService_SetNavigateState(
401         IBrowserService* iface,
402         BNSTATE bnstate)
403 {
404     ShellBrowser *This = impl_from_IBrowserService(iface);
405     FIXME("%p %d\n", This, bnstate);
406     return E_NOTIMPL;
407 }
408
409 static HRESULT WINAPI BrowserService_GetNavigateState(
410         IBrowserService* iface,
411         BNSTATE *pbnstate)
412 {
413     ShellBrowser *This = impl_from_IBrowserService(iface);
414     FIXME("%p %p\n", This, pbnstate);
415     return E_NOTIMPL;
416 }
417
418 static HRESULT WINAPI BrowserService_NotifyRedirect(
419         IBrowserService* iface,
420         IShellView *psv,
421         PCIDLIST_ABSOLUTE pidl,
422         BOOL *pfDidBrowse)
423 {
424     ShellBrowser *This = impl_from_IBrowserService(iface);
425     FIXME("%p %p %p %p\n", This, psv, pidl, pfDidBrowse);
426     return E_NOTIMPL;
427 }
428
429 static HRESULT WINAPI BrowserService_UpdateWindowList(
430         IBrowserService* iface)
431 {
432     ShellBrowser *This = impl_from_IBrowserService(iface);
433     FIXME("%p\n", This);
434     return E_NOTIMPL;
435 }
436
437 static HRESULT WINAPI BrowserService_UpdateBackForwardState(
438         IBrowserService* iface)
439 {
440     ShellBrowser *This = impl_from_IBrowserService(iface);
441     FIXME("%p\n", This);
442     return E_NOTIMPL;
443 }
444
445 static HRESULT WINAPI BrowserService_SetFlags(
446         IBrowserService* iface,
447         DWORD dwFlags,
448         DWORD dwFlagMask)
449 {
450     ShellBrowser *This = impl_from_IBrowserService(iface);
451     FIXME("%p %x %x\n", This, dwFlags, dwFlagMask);
452     return E_NOTIMPL;
453 }
454
455 static HRESULT WINAPI BrowserService_GetFlags(
456         IBrowserService* iface,
457         DWORD *pdwFlags)
458 {
459     ShellBrowser *This = impl_from_IBrowserService(iface);
460     FIXME("%p %p\n", This, pdwFlags);
461     return E_NOTIMPL;
462 }
463
464 static HRESULT WINAPI BrowserService_CanNavigateNow(
465         IBrowserService* iface)
466 {
467     ShellBrowser *This = impl_from_IBrowserService(iface);
468     FIXME("%p\n", This);
469     return E_NOTIMPL;
470 }
471
472 static HRESULT WINAPI BrowserService_GetPidl(
473         IBrowserService* iface,
474         PIDLIST_ABSOLUTE *ppidl)
475 {
476     ShellBrowser *This = impl_from_IBrowserService(iface);
477     FIXME("%p %p\n", This, ppidl);
478     return E_NOTIMPL;
479 }
480
481 static HRESULT WINAPI BrowserService_SetReferrer(
482         IBrowserService* iface,
483         PCIDLIST_ABSOLUTE pidl)
484 {
485     ShellBrowser *This = impl_from_IBrowserService(iface);
486     FIXME("%p %p\n", This, pidl);
487     return E_NOTIMPL;
488 }
489
490 static DWORD WINAPI BrowserService_GetBrowserIndex(
491         IBrowserService* iface)
492 {
493     ShellBrowser *This = impl_from_IBrowserService(iface);
494     FIXME("%p\n", This);
495     return E_NOTIMPL;
496 }
497
498 static HRESULT WINAPI BrowserService_GetBrowserByIndex(
499         IBrowserService* iface,
500         DWORD dwID,
501         IUnknown **ppunk)
502 {
503     ShellBrowser *This = impl_from_IBrowserService(iface);
504     FIXME("%p %x %p\n", This, dwID, ppunk);
505     return E_NOTIMPL;
506 }
507
508 static HRESULT WINAPI BrowserService_GetHistoryObject(
509         IBrowserService* iface,
510         IOleObject **ppole,
511         IStream **pstm,
512         IBindCtx **ppbc)
513 {
514     ShellBrowser *This = impl_from_IBrowserService(iface);
515     FIXME("%p %p %p %p\n", This, ppole, pstm, ppbc);
516     return E_NOTIMPL;
517 }
518
519 static HRESULT WINAPI BrowserService_SetHistoryObject(
520         IBrowserService* iface,
521         IOleObject *pole,
522         BOOL fIsLocalAnchor)
523 {
524     ShellBrowser *This = impl_from_IBrowserService(iface);
525     FIXME("%p %p %d\n", This, pole, fIsLocalAnchor);
526     return E_NOTIMPL;
527 }
528
529 static HRESULT WINAPI BrowserService_CacheOLEServer(
530         IBrowserService* iface,
531         IOleObject *pole)
532 {
533     ShellBrowser *This = impl_from_IBrowserService(iface);
534     FIXME("%p %p\n", This, pole);
535     return E_NOTIMPL;
536 }
537
538 static HRESULT WINAPI BrowserService_GetSetCodePage(
539         IBrowserService* iface,
540         VARIANT *pvarIn,
541         VARIANT *pvarOut)
542 {
543     ShellBrowser *This = impl_from_IBrowserService(iface);
544     FIXME("%p %p %p\n", This, pvarIn, pvarOut);
545     return E_NOTIMPL;
546 }
547
548 static HRESULT WINAPI BrowserService_OnHttpEquiv(
549         IBrowserService* iface,
550         IShellView *psv,
551         BOOL fDone,
552         VARIANT *pvarargIn,
553         VARIANT *pvarargOut)
554 {
555     ShellBrowser *This = impl_from_IBrowserService(iface);
556     FIXME("%p %p %d %p %p\n", This, psv, fDone, pvarargIn, pvarargOut);
557     return E_NOTIMPL;
558 }
559
560 static HRESULT WINAPI BrowserService_GetPalette(
561         IBrowserService* iface,
562         HPALETTE *hpal)
563 {
564     ShellBrowser *This = impl_from_IBrowserService(iface);
565     FIXME("%p %p\n", This, hpal);
566     return E_NOTIMPL;
567 }
568
569 static HRESULT WINAPI BrowserService_RegisterWindow(
570         IBrowserService* iface,
571         BOOL fForceRegister,
572         int swc)
573 {
574     ShellBrowser *This = impl_from_IBrowserService(iface);
575     FIXME("%p %d %d\n", This, fForceRegister, swc);
576     return E_NOTIMPL;
577 }
578
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
613 };
614
615 static inline ShellBrowser *impl_from_IDocObjectService(IDocObjectService *iface)
616 {
617     return CONTAINING_RECORD(iface, ShellBrowser, IDocObjectService_iface);
618 }
619
620 static HRESULT WINAPI DocObjectService_QueryInterface(
621         IDocObjectService* iface,
622         REFIID riid,
623         void **ppvObject)
624 {
625     ShellBrowser *This = impl_from_IDocObjectService(iface);
626     return IShellBrowser_QueryInterface(&This->IShellBrowser_iface, riid, ppvObject);
627 }
628
629 static ULONG WINAPI DocObjectService_AddRef(
630         IDocObjectService* iface)
631 {
632     ShellBrowser *This = impl_from_IDocObjectService(iface);
633     return IShellBrowser_AddRef(&This->IShellBrowser_iface);
634 }
635
636 static ULONG WINAPI DocObjectService_Release(
637         IDocObjectService* iface)
638 {
639     ShellBrowser *This = impl_from_IDocObjectService(iface);
640     return IShellBrowser_Release(&This->IShellBrowser_iface);
641 }
642
643 static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
644         IDocObjectService* iface,
645         IDispatch *pDispatch,
646         LPCWSTR lpszUrl,
647         DWORD dwFlags,
648         LPCWSTR lpszFrameName,
649         BYTE *pPostData,
650         DWORD cbPostData,
651         LPCWSTR lpszHeaders,
652         BOOL fPlayNavSound,
653         BOOL *pfCancel)
654 {
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);
659     return E_NOTIMPL;
660 }
661
662 static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
663         IDocObjectService* iface,
664         IHTMLWindow2 *pHTMLWindow2,
665         DWORD dwFlags)
666 {
667     ShellBrowser *This = impl_from_IDocObjectService(iface);
668     FIXME("%p %p %x\n", This, pHTMLWindow2, dwFlags);
669     return E_NOTIMPL;
670 }
671
672 static HRESULT WINAPI DocObjectService_FireDownloadBegin(
673         IDocObjectService* iface)
674 {
675     ShellBrowser *This = impl_from_IDocObjectService(iface);
676     FIXME("%p\n", This);
677     return E_NOTIMPL;
678 }
679
680 static HRESULT WINAPI DocObjectService_FireDownloadComplete(
681         IDocObjectService* iface)
682 {
683     ShellBrowser *This = impl_from_IDocObjectService(iface);
684     FIXME("%p\n", This);
685     return E_NOTIMPL;
686 }
687
688 static HRESULT WINAPI DocObjectService_FireDocumentComplete(
689         IDocObjectService* iface,
690         IHTMLWindow2 *pHTMLWindow,
691         DWORD dwFlags)
692 {
693     ShellBrowser *This = impl_from_IDocObjectService(iface);
694     FIXME("%p %p %x\n", This, pHTMLWindow, dwFlags);
695     return E_NOTIMPL;
696 }
697
698 static HRESULT WINAPI DocObjectService_UpdateDesktopComponent(
699         IDocObjectService* iface,
700         IHTMLWindow2 *pHTMLWindow)
701 {
702     ShellBrowser *This = impl_from_IDocObjectService(iface);
703     FIXME("%p %p\n", This, pHTMLWindow);
704     return E_NOTIMPL;
705 }
706
707 static HRESULT WINAPI DocObjectService_GetPendingUrl(
708         IDocObjectService* iface,
709         BSTR *pbstrPendingUrl)
710 {
711     ShellBrowser *This = impl_from_IDocObjectService(iface);
712     FIXME("%p %p\n", This, pbstrPendingUrl);
713     return E_NOTIMPL;
714 }
715
716 static HRESULT WINAPI DocObjectService_ActiveElementChanged(
717         IDocObjectService* iface,
718         IHTMLElement *pHTMLElement)
719 {
720     ShellBrowser *This = impl_from_IDocObjectService(iface);
721     FIXME("%p %p\n", This, pHTMLElement);
722     return E_NOTIMPL;
723 }
724
725 static HRESULT WINAPI DocObjectService_GetUrlSearchComponent(
726         IDocObjectService* iface,
727         BSTR *pbstrSearch)
728 {
729     ShellBrowser *This = impl_from_IDocObjectService(iface);
730     FIXME("%p %p\n", This, pbstrSearch);
731     return E_NOTIMPL;
732 }
733
734 static HRESULT WINAPI DocObjectService_IsErrorUrl(
735         IDocObjectService* iface,
736         LPCWSTR lpszUrl,
737         BOOL *pfIsError)
738 {
739     ShellBrowser *This = impl_from_IDocObjectService(iface);
740     FIXME("%p %s %p\n", This, debugstr_w(lpszUrl), pfIsError);
741
742     *pfIsError = FALSE;
743     return S_OK;
744 }
745
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
760 };
761
762 HRESULT ShellBrowser_Create(IShellBrowser **ppv)
763 {
764     ShellBrowser *sb;
765
766     sb = heap_alloc(sizeof(ShellBrowser));
767     if(!sb)
768         return E_OUTOFMEMORY;
769
770     sb->IShellBrowser_iface.lpVtbl = &ShellBrowserVtbl;
771     sb->IBrowserService_iface.lpVtbl = &BrowserServiceVtbl;
772     sb->IDocObjectService_iface.lpVtbl = &DocObjectServiceVtbl;
773
774     sb->ref = 1;
775
776     *ppv = &sb->IShellBrowser_iface;
777     return S_OK;
778 }