2 * Implementation of IWebBrowser interface for WebBrowser control
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2005 Jacek Caban
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
28 /**********************************************************************
29 * Implement the IWebBrowser interface
32 #define WEBBROWSER_THIS(iface) DEFINE_THIS(WebBrowser, WebBrowser2, iface)
34 static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid, LPVOID *ppv)
36 WebBrowser *This = WEBBROWSER_THIS(iface);
42 if(IsEqualGUID(&IID_IUnknown, riid)) {
43 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
44 *ppv = WEBBROWSER(This);
45 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
46 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
47 *ppv = WEBBROWSER(This);
48 }else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
49 TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
50 *ppv = WEBBROWSER(This);
51 }else if(IsEqualGUID(&IID_IWebBrowserApp, riid)) {
52 TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This, ppv);
53 *ppv = WEBBROWSER(This);
54 }else if(IsEqualGUID(&IID_IWebBrowser2, riid)) {
55 TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This, ppv);
56 *ppv = WEBBROWSER(This);
57 }else if(IsEqualGUID(&IID_IOleObject, riid)) {
58 TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
60 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
61 TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
62 *ppv = INPLACEOBJ(This);
63 }else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
64 TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
65 *ppv = INPLACEOBJ(This);
66 }else if(IsEqualGUID(&IID_IOleControl, riid)) {
67 TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
69 }else if(IsEqualGUID(&IID_IPersist, riid)) {
70 TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
71 *ppv = PERSTORAGE(This);
72 }else if(IsEqualGUID(&IID_IPersistStorage, riid)) {
73 TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
74 *ppv = PERSTORAGE(This);
75 }else if(IsEqualGUID (&IID_IPersistStreamInit, riid)) {
76 TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
77 *ppv = PERSTRINIT(This);
78 }else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) {
79 TRACE("(%p)->(IID_IProvideClassInfo %p)\n", This, ppv);
80 *ppv = CLASSINFO(This);
81 }else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) {
82 TRACE("(%p)->(IID_IProvideClassInfo2 %p)\n", This, ppv);
83 *ppv = CLASSINFO(This);
84 }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
85 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
86 *ppv = CONPTCONT(&This->doc_host.cps);
87 }else if(IsEqualGUID(&IID_IViewObject, riid)) {
88 TRACE("(%p)->(IID_IViewObject %p)\n", This, ppv);
90 }else if(IsEqualGUID(&IID_IViewObject2, riid)) {
91 TRACE("(%p)->(IID_IViewObject2 %p)\n", This, ppv);
92 *ppv = VIEWOBJ2(This);
93 }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
94 TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv);
95 *ppv = ACTIVEOBJ(This);
96 }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
97 TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
99 }else if(IsEqualGUID(&IID_IHlinkFrame, riid)) {
100 TRACE("(%p)->(IID_IHlinkFrame %p)\n", This, ppv);
101 *ppv = HLINKFRAME(This);
102 }else if(IsEqualGUID(&IID_IQuickActivate, riid)) {
103 TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This, ppv);
104 return E_NOINTERFACE;
105 }else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
106 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv);
107 return E_NOINTERFACE;
111 IUnknown_AddRef((IUnknown*)*ppv);
115 FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
116 return E_NOINTERFACE;
119 static ULONG WINAPI WebBrowser_AddRef(IWebBrowser2 *iface)
121 WebBrowser *This = WEBBROWSER_THIS(iface);
122 LONG ref = InterlockedIncrement(&This->ref);
123 TRACE("(%p) ref=%d\n", This, ref);
127 static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
129 WebBrowser *This = WEBBROWSER_THIS(iface);
130 LONG ref = InterlockedDecrement(&This->ref);
132 TRACE("(%p) ref=%d\n", This, ref);
135 if(This->doc_host.document)
136 IUnknown_Release(This->doc_host.document);
138 DocHost_Release(&This->doc_host);
140 WebBrowser_OleObject_Destroy(This);
143 SHDOCVW_UnlockModule();
149 /* IDispatch methods */
150 static HRESULT WINAPI WebBrowser_GetTypeInfoCount(IWebBrowser2 *iface, UINT *pctinfo)
152 WebBrowser *This = WEBBROWSER_THIS(iface);
153 FIXME("(%p)->(%p)\n", This, pctinfo);
157 static HRESULT WINAPI WebBrowser_GetTypeInfo(IWebBrowser2 *iface, UINT iTInfo, LCID lcid,
160 WebBrowser *This = WEBBROWSER_THIS(iface);
161 FIXME("(%p)->(%d %d %p)\n", This, iTInfo, lcid, ppTInfo);
165 static HRESULT WINAPI WebBrowser_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
166 LPOLESTR *rgszNames, UINT cNames,
167 LCID lcid, DISPID *rgDispId)
169 WebBrowser *This = WEBBROWSER_THIS(iface);
170 FIXME("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
175 static HRESULT WINAPI WebBrowser_Invoke(IWebBrowser2 *iface, DISPID dispIdMember,
176 REFIID riid, LCID lcid, WORD wFlags,
177 DISPPARAMS *pDispParams, VARIANT *pVarResult,
178 EXCEPINFO *pExepInfo, UINT *puArgErr)
180 WebBrowser *This = WEBBROWSER_THIS(iface);
184 TRACE("(%p)->(%d %s %d %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
185 lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
187 hres = get_typeinfo(&typeinfo);
191 return ITypeInfo_Invoke(typeinfo, WEBBROWSER2(This), dispIdMember, wFlags, pDispParams,
192 pVarResult, pExepInfo, puArgErr);
195 /* IWebBrowser methods */
196 static HRESULT WINAPI WebBrowser_GoBack(IWebBrowser2 *iface)
198 WebBrowser *This = WEBBROWSER_THIS(iface);
199 FIXME("(%p)\n", This);
203 static HRESULT WINAPI WebBrowser_GoForward(IWebBrowser2 *iface)
205 WebBrowser *This = WEBBROWSER_THIS(iface);
206 FIXME("(%p)\n", This);
210 static HRESULT WINAPI WebBrowser_GoHome(IWebBrowser2 *iface)
212 WebBrowser *This = WEBBROWSER_THIS(iface);
213 FIXME("(%p)\n", This);
217 static HRESULT WINAPI WebBrowser_GoSearch(IWebBrowser2 *iface)
219 WebBrowser *This = WEBBROWSER_THIS(iface);
220 FIXME("(%p)\n", This);
224 static HRESULT WINAPI WebBrowser_Navigate(IWebBrowser2 *iface, BSTR szUrl,
225 VARIANT *Flags, VARIANT *TargetFrameName,
226 VARIANT *PostData, VARIANT *Headers)
228 WebBrowser *This = WEBBROWSER_THIS(iface);
230 TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(szUrl), Flags, TargetFrameName,
233 return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers);
236 static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface)
238 WebBrowser *This = WEBBROWSER_THIS(iface);
239 FIXME("(%p)\n", This);
243 static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
245 WebBrowser *This = WEBBROWSER_THIS(iface);
246 FIXME("(%p)->(%p)\n", This, Level);
250 static HRESULT WINAPI WebBrowser_Stop(IWebBrowser2 *iface)
252 WebBrowser *This = WEBBROWSER_THIS(iface);
253 FIXME("(%p)\n", This);
257 static HRESULT WINAPI WebBrowser_get_Application(IWebBrowser2 *iface, IDispatch **ppDisp)
259 WebBrowser *This = WEBBROWSER_THIS(iface);
260 FIXME("(%p)->(%p)\n", This, ppDisp);
264 static HRESULT WINAPI WebBrowser_get_Parent(IWebBrowser2 *iface, IDispatch **ppDisp)
266 WebBrowser *This = WEBBROWSER_THIS(iface);
267 FIXME("(%p)->(%p)\n", This, ppDisp);
271 static HRESULT WINAPI WebBrowser_get_Container(IWebBrowser2 *iface, IDispatch **ppDisp)
273 WebBrowser *This = WEBBROWSER_THIS(iface);
274 FIXME("(%p)->(%p)\n", This, ppDisp);
278 static HRESULT WINAPI WebBrowser_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
280 WebBrowser *This = WEBBROWSER_THIS(iface);
282 TRACE("(%p)->(%p)\n", This, ppDisp);
285 if(This->doc_host.document)
286 IUnknown_QueryInterface(This->doc_host.document, &IID_IDispatch, (void**)ppDisp);
291 static HRESULT WINAPI WebBrowser_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
293 WebBrowser *This = WEBBROWSER_THIS(iface);
294 FIXME("(%p)->(%p)\n", This, pBool);
298 static HRESULT WINAPI WebBrowser_get_Type(IWebBrowser2 *iface, BSTR *Type)
300 WebBrowser *This = WEBBROWSER_THIS(iface);
301 FIXME("(%p)->(%p)\n", This, Type);
305 static HRESULT WINAPI WebBrowser_get_Left(IWebBrowser2 *iface, long *pl)
307 WebBrowser *This = WEBBROWSER_THIS(iface);
309 TRACE("(%p)->(%p)\n", This, pl);
311 *pl = This->pos_rect.left;
315 static HRESULT WINAPI WebBrowser_put_Left(IWebBrowser2 *iface, long Left)
317 WebBrowser *This = WEBBROWSER_THIS(iface);
320 TRACE("(%p)->(%ld)\n", This, Left);
325 memcpy(&rect, &This->pos_rect, sizeof(RECT));
328 /* We don't really change the window position here.
329 * We just notify the embedder that he should do so. */
330 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
333 static HRESULT WINAPI WebBrowser_get_Top(IWebBrowser2 *iface, long *pl)
335 WebBrowser *This = WEBBROWSER_THIS(iface);
337 TRACE("(%p)->(%p)\n", This, pl);
339 *pl = This->pos_rect.top;
343 static HRESULT WINAPI WebBrowser_put_Top(IWebBrowser2 *iface, long Top)
345 WebBrowser *This = WEBBROWSER_THIS(iface);
348 TRACE("(%p)->(%ld)\n", This, Top);
353 memcpy(&rect, &This->pos_rect, sizeof(RECT));
356 /* We don't really change the window position here.
357 * We just notify the embedder that he should do so. */
358 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
361 static HRESULT WINAPI WebBrowser_get_Width(IWebBrowser2 *iface, long *pl)
363 WebBrowser *This = WEBBROWSER_THIS(iface);
365 TRACE("(%p)->(%p)\n", This, pl);
367 *pl = This->pos_rect.right - This->pos_rect.left;
371 static HRESULT WINAPI WebBrowser_put_Width(IWebBrowser2 *iface, long Width)
373 WebBrowser *This = WEBBROWSER_THIS(iface);
376 TRACE("(%p)->(%ld)\n", This, Width);
381 memcpy(&rect, &This->pos_rect, sizeof(RECT));
382 rect.right = rect.left+Width;
384 /* We don't really change the window size here.
385 * We just notify the embedder that he should do so. */
386 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
389 static HRESULT WINAPI WebBrowser_get_Height(IWebBrowser2 *iface, long *pl)
391 WebBrowser *This = WEBBROWSER_THIS(iface);
393 TRACE("(%p)->(%p)\n", This, pl);
395 *pl = This->pos_rect.bottom - This->pos_rect.top;
399 static HRESULT WINAPI WebBrowser_put_Height(IWebBrowser2 *iface, long Height)
401 WebBrowser *This = WEBBROWSER_THIS(iface);
404 TRACE("(%p)->(%ld)\n", This, Height);
409 memcpy(&rect, &This->pos_rect, sizeof(RECT));
410 rect.bottom = rect.top+Height;
412 /* We don't really change the window size here.
413 * We just notify the embedder that he should do so. */
414 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
417 static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName)
419 WebBrowser *This = WEBBROWSER_THIS(iface);
420 FIXME("(%p)->(%p)\n", This, LocationName);
424 static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
426 WebBrowser *This = WEBBROWSER_THIS(iface);
428 FIXME("(%p)->(%p)\n", This, LocationURL);
430 if(!This->doc_host.url) {
431 static const WCHAR null_char = 0;
432 *LocationURL = SysAllocString(&null_char);
436 *LocationURL = SysAllocString(This->doc_host.url);
440 static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
442 WebBrowser *This = WEBBROWSER_THIS(iface);
443 FIXME("(%p)->(%p)\n", This, pBool);
447 static HRESULT WINAPI WebBrowser_Quit(IWebBrowser2 *iface)
449 WebBrowser *This = WEBBROWSER_THIS(iface);
450 FIXME("(%p)\n", This);
454 static HRESULT WINAPI WebBrowser_ClientToWindow(IWebBrowser2 *iface, int *pcx, int *pcy)
456 WebBrowser *This = WEBBROWSER_THIS(iface);
457 FIXME("(%p)->(%p %p)\n", This, pcx, pcy);
461 static HRESULT WINAPI WebBrowser_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue)
463 WebBrowser *This = WEBBROWSER_THIS(iface);
464 FIXME("(%p)->(%s)\n", This, debugstr_w(szProperty));
468 static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue)
470 WebBrowser *This = WEBBROWSER_THIS(iface);
471 FIXME("(%p)->(%s %p)\n", This, debugstr_w(szProperty), pvtValue);
475 static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
477 WebBrowser *This = WEBBROWSER_THIS(iface);
478 FIXME("(%p)->(%p)\n", This, Name);
482 static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, long *pHWND)
484 WebBrowser *This = WEBBROWSER_THIS(iface);
486 TRACE("(%p)->(%p)\n", This, pHWND);
488 /* WebBrowser control never has a frame window (in opposition to InternetExplorer) */
493 static HRESULT WINAPI WebBrowser_get_FullName(IWebBrowser2 *iface, BSTR *FullName)
495 WebBrowser *This = WEBBROWSER_THIS(iface);
496 FIXME("(%p)->(%p)\n", This, FullName);
500 static HRESULT WINAPI WebBrowser_get_Path(IWebBrowser2 *iface, BSTR *Path)
502 WebBrowser *This = WEBBROWSER_THIS(iface);
503 FIXME("(%p)->(%p)\n", This, Path);
507 static HRESULT WINAPI WebBrowser_get_Visible(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
509 WebBrowser *This = WEBBROWSER_THIS(iface);
511 TRACE("(%p)->(%p)\n", This, pBool);
513 *pBool = This->visible;
517 static HRESULT WINAPI WebBrowser_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL Value)
519 WebBrowser *This = WEBBROWSER_THIS(iface);
521 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
523 TRACE("(%p)->(%x)\n", This, Value);
525 This->visible = Value;
527 V_VT(&arg) = VT_BOOL;
528 V_BOOL(&arg) = Value;
529 call_sink(This->doc_host.cps.wbe2, DISPID_ONVISIBLE, &dispparams);
534 static HRESULT WINAPI WebBrowser_get_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
536 WebBrowser *This = WEBBROWSER_THIS(iface);
538 TRACE("(%p)->(%p)\n", This, pBool);
540 *pBool = This->status_bar;
544 static HRESULT WINAPI WebBrowser_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
546 WebBrowser *This = WEBBROWSER_THIS(iface);
548 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
550 TRACE("(%p)->(%x)\n", This, Value);
552 This->status_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
554 /* In opposition to InternetExplorer, all we should do here is
555 * inform the embedder about the status bar change. */
557 V_VT(&arg) = VT_BOOL;
558 V_BOOL(&arg) = Value;
559 call_sink(This->doc_host.cps.wbe2, DISPID_ONSTATUSBAR, &dispparams);
564 static HRESULT WINAPI WebBrowser_get_StatusText(IWebBrowser2 *iface, BSTR *StatusText)
566 WebBrowser *This = WEBBROWSER_THIS(iface);
567 FIXME("(%p)->(%p)\n", This, StatusText);
571 static HRESULT WINAPI WebBrowser_put_StatusText(IWebBrowser2 *iface, BSTR StatusText)
573 WebBrowser *This = WEBBROWSER_THIS(iface);
574 FIXME("(%p)->(%s)\n", This, debugstr_w(StatusText));
578 static HRESULT WINAPI WebBrowser_get_ToolBar(IWebBrowser2 *iface, int *Value)
580 WebBrowser *This = WEBBROWSER_THIS(iface);
582 TRACE("(%p)->(%p)\n", This, Value);
584 *Value = This->tool_bar;
588 static HRESULT WINAPI WebBrowser_put_ToolBar(IWebBrowser2 *iface, int Value)
590 WebBrowser *This = WEBBROWSER_THIS(iface);
592 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
594 TRACE("(%p)->(%x)\n", This, Value);
596 This->tool_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
598 /* In opposition to InternetExplorer, all we should do here is
599 * inform the embedder about the tool bar change. */
601 V_VT(&arg) = VT_BOOL;
602 V_BOOL(&arg) = Value;
603 call_sink(This->doc_host.cps.wbe2, DISPID_ONTOOLBAR, &dispparams);
608 static HRESULT WINAPI WebBrowser_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
610 WebBrowser *This = WEBBROWSER_THIS(iface);
612 TRACE("(%p)->(%p)\n", This, Value);
614 *Value = This->menu_bar;
618 static HRESULT WINAPI WebBrowser_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
620 WebBrowser *This = WEBBROWSER_THIS(iface);
622 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
624 TRACE("(%p)->(%x)\n", This, Value);
626 This->menu_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
628 /* In opposition to InternetExplorer, all we should do here is
629 * inform the embedder about the menu bar change. */
631 V_VT(&arg) = VT_BOOL;
632 V_BOOL(&arg) = Value;
633 call_sink(This->doc_host.cps.wbe2, DISPID_ONMENUBAR, &dispparams);
638 static HRESULT WINAPI WebBrowser_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)
640 WebBrowser *This = WEBBROWSER_THIS(iface);
641 FIXME("(%p)->(%p)\n", This, pbFullScreen);
645 static HRESULT WINAPI WebBrowser_put_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL bFullScreen)
647 WebBrowser *This = WEBBROWSER_THIS(iface);
648 FIXME("(%p)->(%x)\n", This, bFullScreen);
652 static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VARIANT *Flags,
653 VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers)
655 WebBrowser *This = WEBBROWSER_THIS(iface);
657 TRACE("(%p)->(%p %p %p %p %p)\n", This, URL, Flags, TargetFrameName, PostData, Headers);
665 if(V_VT(URL) != VT_BSTR) {
666 FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL));
670 return navigate_url(&This->doc_host, V_BSTR(URL), Flags, TargetFrameName, PostData, Headers);
673 static HRESULT WINAPI WebBrowser_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
675 WebBrowser *This = WEBBROWSER_THIS(iface);
676 FIXME("(%p)->(%d %p)\n", This, cmdID, pcmdf);
680 static HRESULT WINAPI WebBrowser_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
681 OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
683 WebBrowser *This = WEBBROWSER_THIS(iface);
684 FIXME("(%p)->(%d %d %p %p)\n", This, cmdID, cmdexecopt, pvaIn, pvaOut);
688 static HRESULT WINAPI WebBrowser_ShowBrowserBar(IWebBrowser2 *iface, VARIANT *pvaClsid,
689 VARIANT *pvarShow, VARIANT *pvarSize)
691 WebBrowser *This = WEBBROWSER_THIS(iface);
692 FIXME("(%p)->(%p %p %p)\n", This, pvaClsid, pvarShow, pvarSize);
696 static HRESULT WINAPI WebBrowser_get_ReadyState(IWebBrowser2 *iface, READYSTATE *lpReadyState)
698 WebBrowser *This = WEBBROWSER_THIS(iface);
699 FIXME("(%p)->(%p)\n", This, lpReadyState);
703 static HRESULT WINAPI WebBrowser_get_Offline(IWebBrowser2 *iface, VARIANT_BOOL *pbOffline)
705 WebBrowser *This = WEBBROWSER_THIS(iface);
707 TRACE("(%p)->(%p)\n", This, pbOffline);
709 *pbOffline = This->offline;
713 static HRESULT WINAPI WebBrowser_put_Offline(IWebBrowser2 *iface, VARIANT_BOOL bOffline)
715 WebBrowser *This = WEBBROWSER_THIS(iface);
717 TRACE("(%p)->(%x)\n", This, bOffline);
719 This->offline = bOffline ? VARIANT_TRUE : VARIANT_FALSE;
723 static HRESULT WINAPI WebBrowser_get_Silent(IWebBrowser2 *iface, VARIANT_BOOL *pbSilent)
725 WebBrowser *This = WEBBROWSER_THIS(iface);
727 TRACE("(%p)->(%p)\n", This, pbSilent);
729 *pbSilent = This->silent;
733 static HRESULT WINAPI WebBrowser_put_Silent(IWebBrowser2 *iface, VARIANT_BOOL bSilent)
735 WebBrowser *This = WEBBROWSER_THIS(iface);
737 TRACE("(%p)->(%x)\n", This, bSilent);
739 This->silent = bSilent ? VARIANT_TRUE : VARIANT_FALSE;
743 static HRESULT WINAPI WebBrowser_get_RegisterAsBrowser(IWebBrowser2 *iface,
744 VARIANT_BOOL *pbRegister)
746 WebBrowser *This = WEBBROWSER_THIS(iface);
747 FIXME("(%p)->(%p)\n", This, pbRegister);
751 static HRESULT WINAPI WebBrowser_put_RegisterAsBrowser(IWebBrowser2 *iface,
752 VARIANT_BOOL bRegister)
754 WebBrowser *This = WEBBROWSER_THIS(iface);
755 FIXME("(%p)->(%x)\n", This, bRegister);
759 static HRESULT WINAPI WebBrowser_get_RegisterAsDropTarget(IWebBrowser2 *iface,
760 VARIANT_BOOL *pbRegister)
762 WebBrowser *This = WEBBROWSER_THIS(iface);
763 FIXME("(%p)->(%p)\n", This, pbRegister);
767 static HRESULT WINAPI WebBrowser_put_RegisterAsDropTarget(IWebBrowser2 *iface,
768 VARIANT_BOOL bRegister)
770 WebBrowser *This = WEBBROWSER_THIS(iface);
771 FIXME("(%p)->(%x)\n", This, bRegister);
775 static HRESULT WINAPI WebBrowser_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
777 WebBrowser *This = WEBBROWSER_THIS(iface);
778 FIXME("(%p)->(%p)\n", This, pbRegister);
782 static HRESULT WINAPI WebBrowser_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
784 WebBrowser *This = WEBBROWSER_THIS(iface);
785 FIXME("(%p)->(%x)\n", This, bRegister);
789 static HRESULT WINAPI WebBrowser_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
791 WebBrowser *This = WEBBROWSER_THIS(iface);
793 TRACE("(%p)->(%p)\n", This, Value);
795 *Value = This->address_bar;
799 static HRESULT WINAPI WebBrowser_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
801 WebBrowser *This = WEBBROWSER_THIS(iface);
803 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
805 TRACE("(%p)->(%x)\n", This, Value);
807 This->address_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
809 /* In opposition to InternetExplorer, all we should do here is
810 * inform the embedder about the address bar change. */
812 V_VT(&arg) = VT_BOOL;
813 V_BOOL(&arg) = Value;
814 call_sink(This->doc_host.cps.wbe2, DISPID_ONADDRESSBAR, &dispparams);
819 static HRESULT WINAPI WebBrowser_get_Resizable(IWebBrowser2 *iface, VARIANT_BOOL *Value)
821 WebBrowser *This = WEBBROWSER_THIS(iface);
822 FIXME("(%p)->(%p)\n", This, Value);
826 static HRESULT WINAPI WebBrowser_put_Resizable(IWebBrowser2 *iface, VARIANT_BOOL Value)
828 WebBrowser *This = WEBBROWSER_THIS(iface);
829 FIXME("(%p)->(%x)\n", This, Value);
833 #undef WEBBROWSER_THIS
835 static const IWebBrowser2Vtbl WebBrowser2Vtbl =
837 WebBrowser_QueryInterface,
840 WebBrowser_GetTypeInfoCount,
841 WebBrowser_GetTypeInfo,
842 WebBrowser_GetIDsOfNames,
845 WebBrowser_GoForward,
852 WebBrowser_get_Application,
853 WebBrowser_get_Parent,
854 WebBrowser_get_Container,
855 WebBrowser_get_Document,
856 WebBrowser_get_TopLevelContainer,
862 WebBrowser_get_Width,
863 WebBrowser_put_Width,
864 WebBrowser_get_Height,
865 WebBrowser_put_Height,
866 WebBrowser_get_LocationName,
867 WebBrowser_get_LocationURL,
870 WebBrowser_ClientToWindow,
871 WebBrowser_PutProperty,
872 WebBrowser_GetProperty,
875 WebBrowser_get_FullName,
877 WebBrowser_get_Visible,
878 WebBrowser_put_Visible,
879 WebBrowser_get_StatusBar,
880 WebBrowser_put_StatusBar,
881 WebBrowser_get_StatusText,
882 WebBrowser_put_StatusText,
883 WebBrowser_get_ToolBar,
884 WebBrowser_put_ToolBar,
885 WebBrowser_get_MenuBar,
886 WebBrowser_put_MenuBar,
887 WebBrowser_get_FullScreen,
888 WebBrowser_put_FullScreen,
889 WebBrowser_Navigate2,
890 WebBrowser_QueryStatusWB,
892 WebBrowser_ShowBrowserBar,
893 WebBrowser_get_ReadyState,
894 WebBrowser_get_Offline,
895 WebBrowser_put_Offline,
896 WebBrowser_get_Silent,
897 WebBrowser_put_Silent,
898 WebBrowser_get_RegisterAsBrowser,
899 WebBrowser_put_RegisterAsBrowser,
900 WebBrowser_get_RegisterAsDropTarget,
901 WebBrowser_put_RegisterAsDropTarget,
902 WebBrowser_get_TheaterMode,
903 WebBrowser_put_TheaterMode,
904 WebBrowser_get_AddressBar,
905 WebBrowser_put_AddressBar,
906 WebBrowser_get_Resizable,
907 WebBrowser_put_Resizable
910 static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, void **ppv)
915 TRACE("(%p %s %p) version=%d\n", pOuter, debugstr_guid(riid), ppv, version);
917 ret = shdocvw_alloc(sizeof(WebBrowser));
919 ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
921 ret->version = version;
923 DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
925 ret->visible = VARIANT_TRUE;
926 ret->menu_bar = VARIANT_TRUE;
927 ret->address_bar = VARIANT_TRUE;
928 ret->status_bar = VARIANT_TRUE;
929 ret->tool_bar = VARIANT_TRUE;
930 ret->silent = VARIANT_FALSE;
931 ret->offline = VARIANT_FALSE;
933 WebBrowser_OleObject_Init(ret);
934 WebBrowser_ViewObject_Init(ret);
935 WebBrowser_Persist_Init(ret);
936 WebBrowser_ClassInfo_Init(ret);
937 WebBrowser_HlinkFrame_Init(ret);
939 hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv);
940 if(SUCCEEDED(hres)) {
941 SHDOCVW_LockModule();
950 HRESULT WebBrowserV1_Create(IUnknown *pOuter, REFIID riid, void **ppv)
952 return WebBrowser_Create(1, pOuter, riid, ppv);
955 HRESULT WebBrowserV2_Create(IUnknown *pOuter, REFIID riid, void **ppv)
957 return WebBrowser_Create(2, pOuter, riid, ppv);