2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(ieframe
);
25 static inline InternetExplorer
*impl_from_IWebBrowser2(IWebBrowser2
*iface
)
27 return CONTAINING_RECORD(iface
, InternetExplorer
, IWebBrowser2_iface
);
30 static HRESULT WINAPI
InternetExplorer_QueryInterface(IWebBrowser2
*iface
, REFIID riid
, LPVOID
*ppv
)
32 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
36 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
37 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
38 *ppv
= &This
->IWebBrowser2_iface
;
39 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
40 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
41 *ppv
= &This
->IWebBrowser2_iface
;
42 }else if(IsEqualGUID(&IID_IWebBrowser
, riid
)) {
43 TRACE("(%p)->(IID_IWebBrowser %p)\n", This
, ppv
);
44 *ppv
= &This
->IWebBrowser2_iface
;
45 }else if(IsEqualGUID(&IID_IWebBrowserApp
, riid
)) {
46 TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This
, ppv
);
47 *ppv
= &This
->IWebBrowser2_iface
;
48 }else if(IsEqualGUID(&IID_IWebBrowser2
, riid
)) {
49 TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This
, ppv
);
50 *ppv
= &This
->IWebBrowser2_iface
;
51 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
52 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This
, ppv
);
53 *ppv
= &This
->doc_host
.cps
.IConnectionPointContainer_iface
;
54 }else if(IsEqualGUID(&IID_IExternalConnection
, riid
)) {
55 TRACE("(%p)->(IID_IExternalConnection %p)\n", This
, ppv
);
56 *ppv
= &This
->IExternalConnection_iface
;
57 }else if(IsEqualGUID(&IID_IServiceProvider
, riid
)) {
58 TRACE("(%p)->(IID_IServiceProvider %p)\n", This
, ppv
);
59 *ppv
= &This
->IServiceProvider_iface
;
60 }else if(HlinkFrame_QI(&This
->hlink_frame
, riid
, ppv
)) {
65 IUnknown_AddRef((IUnknown
*)*ppv
);
69 WARN("(%p)->(%s %p) interface not supported\n", This
, debugstr_guid(riid
), ppv
);
73 static ULONG WINAPI
InternetExplorer_AddRef(IWebBrowser2
*iface
)
75 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
76 LONG ref
= InterlockedIncrement(&This
->ref
);
77 TRACE("(%p) ref=%d\n", This
, ref
);
81 static ULONG WINAPI
InternetExplorer_Release(IWebBrowser2
*iface
)
83 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
84 LONG ref
= InterlockedDecrement(&This
->ref
);
86 TRACE("(%p) ref=%d\n", This
, ref
);
89 deactivate_document(&This
->doc_host
);
90 DocHost_Release(&This
->doc_host
);
93 DestroyWindow(This
->frame_hwnd
);
94 list_remove(&This
->entry
);
103 static HRESULT WINAPI
InternetExplorer_GetTypeInfoCount(IWebBrowser2
*iface
, UINT
*pctinfo
)
105 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
106 FIXME("(%p)->(%p)\n", This
, pctinfo
);
110 static HRESULT WINAPI
InternetExplorer_GetTypeInfo(IWebBrowser2
*iface
, UINT iTInfo
, LCID lcid
,
113 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
114 FIXME("(%p)->(%d %d %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
118 static HRESULT WINAPI
InternetExplorer_GetIDsOfNames(IWebBrowser2
*iface
, REFIID riid
,
119 LPOLESTR
*rgszNames
, UINT cNames
,
120 LCID lcid
, DISPID
*rgDispId
)
122 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
123 FIXME("(%p)->(%s %p %d %d %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
128 static HRESULT WINAPI
InternetExplorer_Invoke(IWebBrowser2
*iface
, DISPID dispIdMember
,
129 REFIID riid
, LCID lcid
, WORD wFlags
,
130 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
131 EXCEPINFO
*pExepInfo
, UINT
*puArgErr
)
133 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
134 FIXME("(%p)->(%d %s %d %08x %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
135 lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
139 static HRESULT WINAPI
InternetExplorer_GoBack(IWebBrowser2
*iface
)
141 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
142 TRACE("(%p)\n", This
);
143 return go_back(&This
->doc_host
);
146 static HRESULT WINAPI
InternetExplorer_GoForward(IWebBrowser2
*iface
)
148 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
149 TRACE("(%p)\n", This
);
150 return go_forward(&This
->doc_host
);
153 static HRESULT WINAPI
InternetExplorer_GoHome(IWebBrowser2
*iface
)
155 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
156 TRACE("(%p)\n", This
);
157 return go_home(&This
->doc_host
);
160 static HRESULT WINAPI
InternetExplorer_GoSearch(IWebBrowser2
*iface
)
162 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
163 FIXME("(%p)\n", This
);
167 static HRESULT WINAPI
InternetExplorer_Navigate(IWebBrowser2
*iface
, BSTR szUrl
,
168 VARIANT
*Flags
, VARIANT
*TargetFrameName
,
169 VARIANT
*PostData
, VARIANT
*Headers
)
171 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
173 TRACE("(%p)->(%s %s %s %s %s)\n", This
, debugstr_w(szUrl
), debugstr_variant(Flags
),
174 debugstr_variant(TargetFrameName
), debugstr_variant(PostData
), debugstr_variant(Headers
));
176 return navigate_url(&This
->doc_host
, szUrl
, Flags
, TargetFrameName
, PostData
, Headers
);
179 static HRESULT WINAPI
InternetExplorer_Refresh(IWebBrowser2
*iface
)
181 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
183 TRACE("(%p)\n", This
);
185 return refresh_document(&This
->doc_host
, NULL
);
188 static HRESULT WINAPI
InternetExplorer_Refresh2(IWebBrowser2
*iface
, VARIANT
*Level
)
190 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
192 TRACE("(%p)->(%s)\n", This
, debugstr_variant(Level
));
194 return refresh_document(&This
->doc_host
, Level
);
197 static HRESULT WINAPI
InternetExplorer_Stop(IWebBrowser2
*iface
)
199 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
200 FIXME("(%p)\n", This
);
204 static HRESULT WINAPI
InternetExplorer_get_Application(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
206 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
207 FIXME("(%p)->(%p)\n", This
, ppDisp
);
211 static HRESULT WINAPI
InternetExplorer_get_Parent(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
213 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
214 FIXME("(%p)->(%p)\n", This
, ppDisp
);
218 static HRESULT WINAPI
InternetExplorer_get_Container(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
220 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
221 FIXME("(%p)->(%p)\n", This
, ppDisp
);
225 static HRESULT WINAPI
InternetExplorer_get_Document(IWebBrowser2
*iface
, IDispatch
**ppDisp
)
227 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
228 FIXME("(%p)->(%p)\n", This
, ppDisp
);
232 static HRESULT WINAPI
InternetExplorer_get_TopLevelContainer(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
234 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
235 FIXME("(%p)->(%p)\n", This
, pBool
);
239 static HRESULT WINAPI
InternetExplorer_get_Type(IWebBrowser2
*iface
, BSTR
*Type
)
241 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
242 FIXME("(%p)->(%p)\n", This
, Type
);
246 static HRESULT WINAPI
InternetExplorer_get_Left(IWebBrowser2
*iface
, LONG
*pl
)
248 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
249 FIXME("(%p)->(%p)\n", This
, pl
);
253 static HRESULT WINAPI
InternetExplorer_put_Left(IWebBrowser2
*iface
, LONG Left
)
255 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
256 FIXME("(%p)->(%d)\n", This
, Left
);
260 static HRESULT WINAPI
InternetExplorer_get_Top(IWebBrowser2
*iface
, LONG
*pl
)
262 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
263 FIXME("(%p)->(%p)\n", This
, pl
);
267 static HRESULT WINAPI
InternetExplorer_put_Top(IWebBrowser2
*iface
, LONG Top
)
269 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
270 FIXME("(%p)->(%d)\n", This
, Top
);
274 static HRESULT WINAPI
InternetExplorer_get_Width(IWebBrowser2
*iface
, LONG
*pl
)
276 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
277 FIXME("(%p)->(%p)\n", This
, pl
);
281 static HRESULT WINAPI
InternetExplorer_put_Width(IWebBrowser2
*iface
, LONG Width
)
283 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
284 FIXME("(%p)->(%d)\n", This
, Width
);
288 static HRESULT WINAPI
InternetExplorer_get_Height(IWebBrowser2
*iface
, LONG
*pl
)
290 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
291 FIXME("(%p)->(%p)\n", This
, pl
);
295 static HRESULT WINAPI
InternetExplorer_put_Height(IWebBrowser2
*iface
, LONG Height
)
297 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
298 FIXME("(%p)->(%d)\n", This
, Height
);
302 static HRESULT WINAPI
InternetExplorer_get_LocationName(IWebBrowser2
*iface
, BSTR
*LocationName
)
304 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
305 FIXME("(%p)->(%p)\n", This
, LocationName
);
309 static HRESULT WINAPI
InternetExplorer_get_LocationURL(IWebBrowser2
*iface
, BSTR
*LocationURL
)
311 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
313 TRACE("(%p)->(%p)\n", This
, LocationURL
);
315 return get_location_url(&This
->doc_host
, LocationURL
);
318 static HRESULT WINAPI
InternetExplorer_get_Busy(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
320 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
321 FIXME("(%p)->(%p)\n", This
, pBool
);
325 static HRESULT WINAPI
InternetExplorer_Quit(IWebBrowser2
*iface
)
327 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
328 FIXME("(%p)\n", This
);
332 static HRESULT WINAPI
InternetExplorer_ClientToWindow(IWebBrowser2
*iface
, int *pcx
, int *pcy
)
334 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
335 FIXME("(%p)->(%p %p)\n", This
, pcx
, pcy
);
339 static HRESULT WINAPI
InternetExplorer_PutProperty(IWebBrowser2
*iface
, BSTR szProperty
, VARIANT vtValue
)
341 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
342 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(szProperty
), debugstr_variant(&vtValue
));
346 static HRESULT WINAPI
InternetExplorer_GetProperty(IWebBrowser2
*iface
, BSTR szProperty
, VARIANT
*pvtValue
)
348 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
349 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(szProperty
), pvtValue
);
353 static HRESULT WINAPI
InternetExplorer_get_Name(IWebBrowser2
*iface
, BSTR
*Name
)
355 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
356 FIXME("(%p)->(%p)\n", This
, Name
);
360 static HRESULT WINAPI
InternetExplorer_get_HWND(IWebBrowser2
*iface
, SHANDLE_PTR
*pHWND
)
362 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
364 TRACE("(%p)->(%p)\n", This
, pHWND
);
366 *pHWND
= (SHANDLE_PTR
)This
->frame_hwnd
;
370 static HRESULT WINAPI
InternetExplorer_get_FullName(IWebBrowser2
*iface
, BSTR
*FullName
)
372 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
373 FIXME("(%p)->(%p)\n", This
, FullName
);
377 static HRESULT WINAPI
InternetExplorer_get_Path(IWebBrowser2
*iface
, BSTR
*Path
)
379 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
380 FIXME("(%p)->(%p)\n", This
, Path
);
384 static HRESULT WINAPI
InternetExplorer_get_Visible(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
386 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
388 TRACE("(%p)->(%p)\n", This
, pBool
);
390 *pBool
= IsWindowVisible(This
->frame_hwnd
) ? VARIANT_TRUE
: VARIANT_FALSE
;
394 static HRESULT WINAPI
InternetExplorer_put_Visible(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
396 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
397 TRACE("(%p)->(%x)\n", This
, Value
);
399 ShowWindow(This
->frame_hwnd
, Value
? SW_SHOW
: SW_HIDE
);
404 static HRESULT WINAPI
InternetExplorer_get_StatusBar(IWebBrowser2
*iface
, VARIANT_BOOL
*pBool
)
406 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
407 FIXME("(%p)->(%p)\n", This
, pBool
);
411 static HRESULT WINAPI
InternetExplorer_put_StatusBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
413 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
414 FIXME("(%p)->(%x)\n", This
, Value
);
418 static HRESULT WINAPI
InternetExplorer_get_StatusText(IWebBrowser2
*iface
, BSTR
*StatusText
)
420 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
421 FIXME("(%p)->(%p)\n", This
, StatusText
);
425 static HRESULT WINAPI
InternetExplorer_put_StatusText(IWebBrowser2
*iface
, BSTR StatusText
)
427 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
429 TRACE("(%p)->(%s)\n", This
, debugstr_w(StatusText
));
431 return update_ie_statustext(This
, StatusText
);
434 static HRESULT WINAPI
InternetExplorer_get_ToolBar(IWebBrowser2
*iface
, int *Value
)
436 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
437 FIXME("(%p)->(%p)\n", This
, Value
);
441 static HRESULT WINAPI
InternetExplorer_put_ToolBar(IWebBrowser2
*iface
, int Value
)
443 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
444 FIXME("(%p)->(%d)\n", This
, Value
);
448 static HRESULT WINAPI
InternetExplorer_get_MenuBar(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
450 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
451 FIXME("(%p)->(%p)\n", This
, Value
);
455 static HRESULT WINAPI
InternetExplorer_put_MenuBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
457 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
460 TRACE("(%p)->(%x)\n", This
, Value
);
465 if(!SetMenu(This
->frame_hwnd
, menu
))
466 return HRESULT_FROM_WIN32(GetLastError());
471 static HRESULT WINAPI
InternetExplorer_get_FullScreen(IWebBrowser2
*iface
, VARIANT_BOOL
*pbFullScreen
)
473 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
474 FIXME("(%p)->(%p)\n", This
, pbFullScreen
);
478 static HRESULT WINAPI
InternetExplorer_put_FullScreen(IWebBrowser2
*iface
, VARIANT_BOOL bFullScreen
)
480 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
481 FIXME("(%p)->(%x)\n", This
, bFullScreen
);
485 static HRESULT WINAPI
InternetExplorer_Navigate2(IWebBrowser2
*iface
, VARIANT
*URL
, VARIANT
*Flags
,
486 VARIANT
*TargetFrameName
, VARIANT
*PostData
, VARIANT
*Headers
)
488 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
490 TRACE("(%p)->(%s %s %s %s %s)\n", This
, debugstr_variant(URL
), debugstr_variant(Flags
),
491 debugstr_variant(TargetFrameName
), debugstr_variant(PostData
), debugstr_variant(Headers
));
496 if(V_VT(URL
) != VT_BSTR
) {
497 FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL
));
501 return navigate_url(&This
->doc_host
, V_BSTR(URL
), Flags
, TargetFrameName
, PostData
, Headers
);
504 static HRESULT WINAPI
InternetExplorer_QueryStatusWB(IWebBrowser2
*iface
, OLECMDID cmdID
, OLECMDF
*pcmdf
)
506 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
507 FIXME("(%p)->(%d %p)\n", This
, cmdID
, pcmdf
);
511 static HRESULT WINAPI
InternetExplorer_ExecWB(IWebBrowser2
*iface
, OLECMDID cmdID
,
512 OLECMDEXECOPT cmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
514 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
515 FIXME("(%p)->(%d %d %s %p)\n", This
, cmdID
, cmdexecopt
, debugstr_variant(pvaIn
), pvaOut
);
519 static HRESULT WINAPI
InternetExplorer_ShowBrowserBar(IWebBrowser2
*iface
, VARIANT
*pvaClsid
,
520 VARIANT
*pvarShow
, VARIANT
*pvarSize
)
522 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
523 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_variant(pvaClsid
), debugstr_variant(pvarShow
),
524 debugstr_variant(pvarSize
));
528 static HRESULT WINAPI
InternetExplorer_get_ReadyState(IWebBrowser2
*iface
, READYSTATE
*lpReadyState
)
530 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
531 FIXME("(%p)->(%p)\n", This
, lpReadyState
);
535 static HRESULT WINAPI
InternetExplorer_get_Offline(IWebBrowser2
*iface
, VARIANT_BOOL
*pbOffline
)
537 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
538 FIXME("(%p)->(%p)\n", This
, pbOffline
);
542 static HRESULT WINAPI
InternetExplorer_put_Offline(IWebBrowser2
*iface
, VARIANT_BOOL bOffline
)
544 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
545 FIXME("(%p)->(%x)\n", This
, bOffline
);
549 static HRESULT WINAPI
InternetExplorer_get_Silent(IWebBrowser2
*iface
, VARIANT_BOOL
*pbSilent
)
551 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
552 FIXME("(%p)->(%p)\n", This
, pbSilent
);
556 static HRESULT WINAPI
InternetExplorer_put_Silent(IWebBrowser2
*iface
, VARIANT_BOOL bSilent
)
558 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
559 FIXME("(%p)->(%x)\n", This
, bSilent
);
563 static HRESULT WINAPI
InternetExplorer_get_RegisterAsBrowser(IWebBrowser2
*iface
,
564 VARIANT_BOOL
*pbRegister
)
566 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
567 FIXME("(%p)->(%p)\n", This
, pbRegister
);
571 static HRESULT WINAPI
InternetExplorer_put_RegisterAsBrowser(IWebBrowser2
*iface
,
572 VARIANT_BOOL bRegister
)
574 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
575 FIXME("(%p)->(%x)\n", This
, bRegister
);
579 static HRESULT WINAPI
InternetExplorer_get_RegisterAsDropTarget(IWebBrowser2
*iface
,
580 VARIANT_BOOL
*pbRegister
)
582 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
583 FIXME("(%p)->(%p)\n", This
, pbRegister
);
587 static HRESULT WINAPI
InternetExplorer_put_RegisterAsDropTarget(IWebBrowser2
*iface
,
588 VARIANT_BOOL bRegister
)
590 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
591 FIXME("(%p)->(%x)\n", This
, bRegister
);
595 static HRESULT WINAPI
InternetExplorer_get_TheaterMode(IWebBrowser2
*iface
, VARIANT_BOOL
*pbRegister
)
597 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
598 FIXME("(%p)->(%p)\n", This
, pbRegister
);
602 static HRESULT WINAPI
InternetExplorer_put_TheaterMode(IWebBrowser2
*iface
, VARIANT_BOOL bRegister
)
604 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
605 FIXME("(%p)->(%x)\n", This
, bRegister
);
609 static HRESULT WINAPI
InternetExplorer_get_AddressBar(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
611 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
612 FIXME("(%p)->(%p)\n", This
, Value
);
616 static HRESULT WINAPI
InternetExplorer_put_AddressBar(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
618 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
619 FIXME("(%p)->(%x)\n", This
, Value
);
623 static HRESULT WINAPI
InternetExplorer_get_Resizable(IWebBrowser2
*iface
, VARIANT_BOOL
*Value
)
625 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
626 FIXME("(%p)->(%p)\n", This
, Value
);
630 static HRESULT WINAPI
InternetExplorer_put_Resizable(IWebBrowser2
*iface
, VARIANT_BOOL Value
)
632 InternetExplorer
*This
= impl_from_IWebBrowser2(iface
);
633 FIXME("(%p)->(%x)\n", This
, Value
);
637 static const IWebBrowser2Vtbl InternetExplorerVtbl
=
639 InternetExplorer_QueryInterface
,
640 InternetExplorer_AddRef
,
641 InternetExplorer_Release
,
642 InternetExplorer_GetTypeInfoCount
,
643 InternetExplorer_GetTypeInfo
,
644 InternetExplorer_GetIDsOfNames
,
645 InternetExplorer_Invoke
,
646 InternetExplorer_GoBack
,
647 InternetExplorer_GoForward
,
648 InternetExplorer_GoHome
,
649 InternetExplorer_GoSearch
,
650 InternetExplorer_Navigate
,
651 InternetExplorer_Refresh
,
652 InternetExplorer_Refresh2
,
653 InternetExplorer_Stop
,
654 InternetExplorer_get_Application
,
655 InternetExplorer_get_Parent
,
656 InternetExplorer_get_Container
,
657 InternetExplorer_get_Document
,
658 InternetExplorer_get_TopLevelContainer
,
659 InternetExplorer_get_Type
,
660 InternetExplorer_get_Left
,
661 InternetExplorer_put_Left
,
662 InternetExplorer_get_Top
,
663 InternetExplorer_put_Top
,
664 InternetExplorer_get_Width
,
665 InternetExplorer_put_Width
,
666 InternetExplorer_get_Height
,
667 InternetExplorer_put_Height
,
668 InternetExplorer_get_LocationName
,
669 InternetExplorer_get_LocationURL
,
670 InternetExplorer_get_Busy
,
671 InternetExplorer_Quit
,
672 InternetExplorer_ClientToWindow
,
673 InternetExplorer_PutProperty
,
674 InternetExplorer_GetProperty
,
675 InternetExplorer_get_Name
,
676 InternetExplorer_get_HWND
,
677 InternetExplorer_get_FullName
,
678 InternetExplorer_get_Path
,
679 InternetExplorer_get_Visible
,
680 InternetExplorer_put_Visible
,
681 InternetExplorer_get_StatusBar
,
682 InternetExplorer_put_StatusBar
,
683 InternetExplorer_get_StatusText
,
684 InternetExplorer_put_StatusText
,
685 InternetExplorer_get_ToolBar
,
686 InternetExplorer_put_ToolBar
,
687 InternetExplorer_get_MenuBar
,
688 InternetExplorer_put_MenuBar
,
689 InternetExplorer_get_FullScreen
,
690 InternetExplorer_put_FullScreen
,
691 InternetExplorer_Navigate2
,
692 InternetExplorer_QueryStatusWB
,
693 InternetExplorer_ExecWB
,
694 InternetExplorer_ShowBrowserBar
,
695 InternetExplorer_get_ReadyState
,
696 InternetExplorer_get_Offline
,
697 InternetExplorer_put_Offline
,
698 InternetExplorer_get_Silent
,
699 InternetExplorer_put_Silent
,
700 InternetExplorer_get_RegisterAsBrowser
,
701 InternetExplorer_put_RegisterAsBrowser
,
702 InternetExplorer_get_RegisterAsDropTarget
,
703 InternetExplorer_put_RegisterAsDropTarget
,
704 InternetExplorer_get_TheaterMode
,
705 InternetExplorer_put_TheaterMode
,
706 InternetExplorer_get_AddressBar
,
707 InternetExplorer_put_AddressBar
,
708 InternetExplorer_get_Resizable
,
709 InternetExplorer_put_Resizable
712 static inline InternetExplorer
*impl_from_IExternalConnection(IExternalConnection
*iface
)
714 return CONTAINING_RECORD(iface
, InternetExplorer
, IExternalConnection_iface
);
718 * Document may keep references to InternetExplorer object causing circular references.
719 * We keep track of external references and release the document object when all
720 * external references are released. A visible main window is also considered as
721 * an external reference.
723 DWORD
release_extern_ref(InternetExplorer
*This
, BOOL last_closes
)
725 LONG ref
= InterlockedDecrement(&This
->extern_ref
);
727 TRACE("ref = %d\n", ref
);
733 WARN("Last external connection released with FALSE last_closes.\n");
737 deactivate_document(&This
->doc_host
);
741 static HRESULT WINAPI
ExternalConnection_QueryInterface(IExternalConnection
*iface
, REFIID riid
, void **ppv
)
743 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
744 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppv
);
747 static ULONG WINAPI
ExternalConnection_AddRef(IExternalConnection
*iface
)
749 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
750 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
753 static ULONG WINAPI
ExternalConnection_Release(IExternalConnection
*iface
)
755 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
756 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
759 static DWORD WINAPI
ExternalConnection_AddConnection(IExternalConnection
*iface
, DWORD extconn
, DWORD reserved
)
761 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
763 TRACE("(%p)->(%x %x)\n", This
, extconn
, reserved
);
765 if(extconn
!= EXTCONN_STRONG
)
768 return InterlockedIncrement(&This
->extern_ref
);
771 static DWORD WINAPI
ExternalConnection_ReleaseConnection(IExternalConnection
*iface
, DWORD extconn
,
772 DWORD reserved
, BOOL fLastReleaseCloses
)
774 InternetExplorer
*This
= impl_from_IExternalConnection(iface
);
776 TRACE("(%p)->(%x %x %x)\n", This
, extconn
, reserved
, fLastReleaseCloses
);
778 if(extconn
!= EXTCONN_STRONG
)
781 return release_extern_ref(This
, fLastReleaseCloses
);
784 static const IExternalConnectionVtbl ExternalConnectionVtbl
= {
785 ExternalConnection_QueryInterface
,
786 ExternalConnection_AddRef
,
787 ExternalConnection_Release
,
788 ExternalConnection_AddConnection
,
789 ExternalConnection_ReleaseConnection
792 static inline InternetExplorer
*impl_from_IServiceProvider(IServiceProvider
*iface
)
794 return CONTAINING_RECORD(iface
, InternetExplorer
, IServiceProvider_iface
);
797 static HRESULT WINAPI
IEServiceProvider_QueryInterface(IServiceProvider
*iface
,
798 REFIID riid
, LPVOID
*ppv
)
800 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
801 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppv
);
804 static ULONG WINAPI
IEServiceProvider_AddRef(IServiceProvider
*iface
)
806 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
807 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
810 static ULONG WINAPI
IEServiceProvider_Release(IServiceProvider
*iface
)
812 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
813 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
816 static HRESULT WINAPI
IEServiceProvider_QueryService(IServiceProvider
*iface
,
817 REFGUID guidService
, REFIID riid
, void **ppv
)
819 InternetExplorer
*This
= impl_from_IServiceProvider(iface
);
821 if(IsEqualGUID(&SID_SHTMLWindow
, riid
)) {
822 TRACE("(%p)->(SID_SHTMLWindow)\n", This
);
823 return IHTMLWindow2_QueryInterface(&This
->doc_host
.html_window
.IHTMLWindow2_iface
, riid
, ppv
);
826 FIXME("(%p)->(%s, %s %p)\n", This
, debugstr_guid(guidService
), debugstr_guid(riid
), ppv
);
828 return E_NOINTERFACE
;
831 static const IServiceProviderVtbl ServiceProviderVtbl
=
833 IEServiceProvider_QueryInterface
,
834 IEServiceProvider_AddRef
,
835 IEServiceProvider_Release
,
836 IEServiceProvider_QueryService
839 void InternetExplorer_WebBrowser_Init(InternetExplorer
*This
)
841 This
->IWebBrowser2_iface
.lpVtbl
= &InternetExplorerVtbl
;
842 This
->IExternalConnection_iface
.lpVtbl
= &ExternalConnectionVtbl
;
843 This
->IServiceProvider_iface
.lpVtbl
= &ServiceProviderVtbl
;