2002-05-05 21:40:57 +02:00
|
|
|
/*
|
2005-09-06 13:41:14 +02:00
|
|
|
* Implementation of IWebBrowser interface for WebBrowser control
|
2002-05-05 21:40:57 +02:00
|
|
|
*
|
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
2005-09-06 13:41:14 +02:00
|
|
|
* Copyright 2005 Jacek Caban
|
2002-05-05 21:40:57 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-05-05 21:40:57 +02:00
|
|
|
*/
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
#include "ieframe.h"
|
|
|
|
|
2006-04-28 20:29:07 +02:00
|
|
|
#include "exdispid.h"
|
2010-06-20 14:40:09 +02:00
|
|
|
#include "mshtml.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2011-07-29 12:18:33 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
static inline WebBrowser *impl_from_IWebBrowser2(IWebBrowser2 *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IWebBrowser2_iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
}
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid, LPVOID *ppv)
|
2005-09-06 13:41:14 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
|
|
|
|
if (ppv == NULL)
|
|
|
|
return E_POINTER;
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2010-11-13 17:47:05 +01:00
|
|
|
*ppv = &This->IWebBrowser2_iface;
|
2005-11-12 20:09:46 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
2005-09-07 11:23:47 +02:00
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
2010-11-13 17:47:05 +01:00
|
|
|
*ppv = &This->IWebBrowser2_iface;
|
2005-09-06 13:41:14 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
|
2010-11-13 17:47:05 +01:00
|
|
|
*ppv = &This->IWebBrowser2_iface;
|
2005-09-12 23:17:57 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IWebBrowserApp, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This, ppv);
|
2010-11-13 17:47:05 +01:00
|
|
|
*ppv = &This->IWebBrowser2_iface;
|
2005-09-12 23:17:57 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IWebBrowser2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This, ppv);
|
2010-11-13 17:47:05 +01:00
|
|
|
*ppv = &This->IWebBrowser2_iface;
|
2005-09-06 13:41:14 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IOleObject, riid)) {
|
2005-09-07 11:23:47 +02:00
|
|
|
TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IOleObject_iface;
|
2005-09-07 11:23:47 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IOleWindow, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IOleInPlaceObject_iface;
|
2005-09-07 11:23:47 +02:00
|
|
|
}else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IOleInPlaceObject_iface;
|
2005-09-08 13:01:57 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IOleControl, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IOleControl_iface;
|
2005-09-08 13:01:57 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IPersist, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IPersistStorage_iface;
|
2005-09-08 13:01:57 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IPersistStorage, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IPersistStorage_iface;
|
2007-10-31 05:06:58 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IPersistMemory, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IPersistMemory_iface;
|
2005-09-06 13:41:14 +02:00
|
|
|
}else if(IsEqualGUID (&IID_IPersistStreamInit, riid)) {
|
2005-09-08 13:01:57 +02:00
|
|
|
TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IPersistStreamInit_iface;
|
2005-11-12 20:09:46 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) {
|
2005-09-08 20:55:50 +02:00
|
|
|
TRACE("(%p)->(IID_IProvideClassInfo %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IProvideClassInfo2_iface;
|
2005-11-12 20:09:46 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) {
|
2005-09-08 20:55:50 +02:00
|
|
|
TRACE("(%p)->(IID_IProvideClassInfo2 %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IProvideClassInfo2_iface;
|
2005-11-12 20:09:46 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
|
2005-09-12 12:10:04 +02:00
|
|
|
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
|
2010-11-13 17:48:34 +01:00
|
|
|
*ppv = &This->doc_host.cps.IConnectionPointContainer_iface;
|
2005-11-12 20:09:46 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IViewObject, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IViewObject %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IViewObject2_iface;
|
2005-11-12 20:09:46 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IViewObject2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IViewObject2 %p)\n", This, ppv);
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IViewObject2_iface;
|
2005-12-01 11:36:52 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv);
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IOleInPlaceActiveObject_iface;
|
2006-01-26 13:29:35 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IOleCommandTarget_iface;
|
2009-01-26 10:34:11 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
|
2010-11-13 17:47:31 +01:00
|
|
|
*ppv = &This->IServiceProvider_iface;
|
2009-01-26 10:34:11 +01:00
|
|
|
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
|
2010-05-18 15:17:29 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IDataObject, riid)) {
|
2010-11-13 17:47:44 +01:00
|
|
|
*ppv = &This->IDataObject_iface;
|
2010-05-18 15:17:29 +02:00
|
|
|
TRACE("(%p)->(IID_IDataObject %p)\n", This, ppv);
|
2006-10-02 21:07:31 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IQuickActivate, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
2007-11-25 19:10:03 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IPerPropertyBrowsing, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IPerPropertyBrowsing %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}else if(IsEqualGUID(&IID_IOleCache, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleCache %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
2008-02-22 11:35:24 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IOleInPlaceSite, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleInPlaceSite %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}else if(IsEqualGUID(&IID_IObjectWithSite, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IObjectWithSite %p) returning NULL\n", This, ppv);
|
2008-11-25 11:23:56 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}else if(IsEqualGUID(&IID_IViewObjectEx, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IViewObjectEx %p) returning NULL\n", This, ppv);
|
2008-02-22 11:35:24 +01:00
|
|
|
return E_NOINTERFACE;
|
2010-09-29 14:01:36 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IOleLink, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleLink %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
2010-10-01 11:09:40 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IMarshal, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IMarshal %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
2010-07-27 18:14:54 +02:00
|
|
|
}else if(HlinkFrame_QI(&This->hlink_frame, riid, ppv)) {
|
|
|
|
return S_OK;
|
2005-09-06 13:41:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
|
2002-05-05 21:40:57 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static ULONG WINAPI WebBrowser_AddRef(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
2006-10-05 23:49:39 +02:00
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
2005-09-06 13:41:14 +02:00
|
|
|
return ref;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
2006-10-05 23:49:39 +02:00
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
2005-01-14 17:02:20 +01:00
|
|
|
|
2005-09-06 13:41:14 +02:00
|
|
|
if(!ref) {
|
2006-04-18 00:31:22 +02:00
|
|
|
if(This->doc_host.document)
|
|
|
|
IUnknown_Release(This->doc_host.document);
|
2005-11-15 13:03:25 +01:00
|
|
|
|
2006-04-18 00:41:43 +02:00
|
|
|
DocHost_Release(&This->doc_host);
|
|
|
|
|
2005-11-16 12:46:56 +01:00
|
|
|
WebBrowser_OleObject_Destroy(This);
|
|
|
|
|
2007-11-28 00:09:35 +01:00
|
|
|
heap_free(This);
|
2011-07-27 14:46:48 +02:00
|
|
|
unlock_module();
|
2005-09-06 13:41:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* IDispatch methods */
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GetTypeInfoCount(IWebBrowser2 *iface, UINT *pctinfo)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-06-20 20:19:04 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GetTypeInfo(IWebBrowser2 *iface, UINT iTInfo, LCID lcid,
|
2002-05-05 21:40:57 +02:00
|
|
|
LPTYPEINFO *ppTInfo)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-06-20 20:19:04 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %d %p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hres = get_typeinfo(&typeinfo);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
ITypeInfo_AddRef(typeinfo);
|
|
|
|
*ppTInfo = typeinfo;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
|
2002-05-05 21:40:57 +02:00
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-06-20 20:19:04 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
|
|
|
|
hres = get_typeinfo(&typeinfo);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
return ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_Invoke(IWebBrowser2 *iface, DISPID dispIdMember,
|
2002-05-05 21:40:57 +02:00
|
|
|
REFIID riid, LCID lcid, WORD wFlags,
|
|
|
|
DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-07-31 13:27:22 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2006-10-05 23:49:39 +02:00
|
|
|
TRACE("(%p)->(%d %s %d %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
2005-09-06 13:41:14 +02:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
2006-07-31 13:27:22 +02:00
|
|
|
|
|
|
|
hres = get_typeinfo(&typeinfo);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
return ITypeInfo_Invoke(typeinfo, &This->IWebBrowser2_iface, dispIdMember, wFlags, pDispParams,
|
|
|
|
pVarResult, pExepInfo, puArgErr);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* IWebBrowser methods */
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GoBack(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GoForward(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GoHome(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2007-09-09 20:13:31 +02:00
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
return go_home(&This->doc_host);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_GoSearch(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2006-04-06 07:44:59 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_Navigate(IWebBrowser2 *iface, BSTR szUrl,
|
2002-05-05 21:40:57 +02:00
|
|
|
VARIANT *Flags, VARIANT *TargetFrameName,
|
|
|
|
VARIANT *PostData, VARIANT *Headers)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-06 07:44:59 +02:00
|
|
|
|
2009-10-11 21:24:51 +02:00
|
|
|
TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(szUrl), debugstr_variant(Flags),
|
|
|
|
debugstr_variant(TargetFrameName), debugstr_variant(PostData),
|
|
|
|
debugstr_variant(Headers));
|
2006-04-06 07:44:59 +02:00
|
|
|
|
2006-10-19 23:14:57 +02:00
|
|
|
return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2009-10-11 21:24:51 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(Level));
|
2005-09-06 13:41:14 +02:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_Stop(IWebBrowser2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)\n", This);
|
2010-06-28 12:52:43 +02:00
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Application(IWebBrowser2 *iface, IDispatch **ppDisp)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2007-11-20 01:49:05 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppDisp);
|
|
|
|
|
|
|
|
if(!ppDisp)
|
|
|
|
return E_POINTER;
|
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
*ppDisp = (IDispatch*)&This->IWebBrowser2_iface;
|
2007-11-20 01:49:05 +01:00
|
|
|
IDispatch_AddRef(*ppDisp);
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Parent(IWebBrowser2 *iface, IDispatch **ppDisp)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, ppDisp);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Container(IWebBrowser2 *iface, IDispatch **ppDisp)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, ppDisp);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2010-06-20 14:40:09 +02:00
|
|
|
IDispatch *disp = NULL;
|
2005-12-06 10:57:29 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppDisp);
|
|
|
|
|
2010-06-20 14:40:09 +02:00
|
|
|
if(This->doc_host.document) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(This->doc_host.document, &IID_IDispatch, (void**)&disp);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
IDispatch *html_doc;
|
|
|
|
|
|
|
|
/* Some broken apps cast returned IDispatch to IHTMLDocument2
|
|
|
|
* without QueryInterface call */
|
|
|
|
hres = IDispatch_QueryInterface(disp, &IID_IHTMLDocument2, (void**)&html_doc);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
IDispatch_Release(disp);
|
|
|
|
disp = html_doc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-12-06 10:57:29 +01:00
|
|
|
|
2010-06-20 14:40:09 +02:00
|
|
|
*ppDisp = disp;
|
2005-12-06 10:57:29 +01:00
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pBool);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Type(IWebBrowser2 *iface, BSTR *Type)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, Type);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Left(IWebBrowser2 *iface, LONG *pl)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pl);
|
|
|
|
|
|
|
|
*pl = This->pos_rect.left;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_put_Left(IWebBrowser2 *iface, LONG Left)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
RECT rect;
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, Left);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
if(!This->inplace)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2008-03-17 22:36:56 +01:00
|
|
|
rect = This->pos_rect;
|
2006-04-14 14:43:25 +02:00
|
|
|
rect.left = Left;
|
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* We don't really change the window position here.
|
|
|
|
* We just notify the embedder that he should do so. */
|
2006-04-14 14:43:25 +02:00
|
|
|
return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Top(IWebBrowser2 *iface, LONG *pl)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pl);
|
|
|
|
|
|
|
|
*pl = This->pos_rect.top;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_put_Top(IWebBrowser2 *iface, LONG Top)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
RECT rect;
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, Top);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
if(!This->inplace)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2008-03-17 22:36:56 +01:00
|
|
|
rect = This->pos_rect;
|
2006-04-14 14:43:25 +02:00
|
|
|
rect.top = Top;
|
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* We don't really change the window position here.
|
|
|
|
* We just notify the embedder that he should do so. */
|
2006-04-14 14:43:25 +02:00
|
|
|
return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Width(IWebBrowser2 *iface, LONG *pl)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pl);
|
|
|
|
|
|
|
|
*pl = This->pos_rect.right - This->pos_rect.left;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_put_Width(IWebBrowser2 *iface, LONG Width)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
RECT rect;
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, Width);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
if(!This->inplace)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2008-03-17 22:36:56 +01:00
|
|
|
rect = This->pos_rect;
|
2006-04-14 14:43:25 +02:00
|
|
|
rect.right = rect.left+Width;
|
2008-03-17 22:36:56 +01:00
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* We don't really change the window size here.
|
|
|
|
* We just notify the embedder that he should do so. */
|
|
|
|
return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Height(IWebBrowser2 *iface, LONG *pl)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pl);
|
|
|
|
|
|
|
|
*pl = This->pos_rect.bottom - This->pos_rect.top;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_put_Height(IWebBrowser2 *iface, LONG Height)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-14 14:43:25 +02:00
|
|
|
RECT rect;
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, Height);
|
2006-04-14 14:43:25 +02:00
|
|
|
|
|
|
|
if(!This->inplace)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2008-03-17 22:36:56 +01:00
|
|
|
rect = This->pos_rect;
|
2006-04-14 14:43:25 +02:00
|
|
|
rect.bottom = rect.top+Height;
|
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* We don't really change the window size here.
|
|
|
|
* We just notify the embedder that he should do so. */
|
2006-04-14 14:43:25 +02:00
|
|
|
return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, LocationName);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-03-06 15:53:31 +01:00
|
|
|
|
2010-12-17 03:28:06 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, LocationURL);
|
2006-03-06 15:53:31 +01:00
|
|
|
|
2010-12-17 03:28:06 +01:00
|
|
|
return get_location_url(&This->doc_host, LocationURL);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-03-13 13:16:41 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pBool);
|
|
|
|
|
|
|
|
*pBool = This->doc_host.busy;
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_Quit(IWebBrowser2 *iface)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2007-11-20 01:49:20 +01:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* It's a InternetExplorer specific method, we have nothing to do here. */
|
|
|
|
return E_FAIL;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
static HRESULT WINAPI WebBrowser_ClientToWindow(IWebBrowser2 *iface, int *pcx, int *pcy)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%p %p)\n", This, pcx, pcy);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2009-10-11 21:24:51 +02:00
|
|
|
FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty), debugstr_variant(&vtValue));
|
2005-09-12 23:17:57 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2009-10-11 21:24:51 +02:00
|
|
|
FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty), debugstr_variant(pvtValue));
|
2005-09-12 23:17:57 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
|
|
|
|
{
|
2009-12-29 18:06:06 +01:00
|
|
|
static const WCHAR sName[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b',
|
2009-12-04 12:49:29 +01:00
|
|
|
' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0};
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2009-12-04 12:49:29 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, Name);
|
|
|
|
|
|
|
|
*Name = SysAllocString(sName);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 23:04:35 +01:00
|
|
|
static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
|
2005-09-12 23:17:57 +02:00
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-28 20:53:52 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pHWND);
|
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* WebBrowser control never has a frame window (in opposition to InternetExplorer) */
|
2006-04-28 20:53:52 +02:00
|
|
|
*pHWND = 0;
|
|
|
|
return E_FAIL;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_FullName(IWebBrowser2 *iface, BSTR *FullName)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, FullName);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_Path(IWebBrowser2 *iface, BSTR *Path)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, Path);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_Visible(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-28 20:29:07 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pBool);
|
|
|
|
|
|
|
|
*pBool = This->visible;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-28 20:29:07 +02:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, Value);
|
|
|
|
|
|
|
|
This->visible = Value;
|
|
|
|
|
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = Value;
|
2006-05-17 18:25:33 +02:00
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONVISIBLE, &dispparams);
|
2006-04-28 20:29:07 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-29 13:34:38 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pBool);
|
|
|
|
|
|
|
|
*pBool = This->status_bar;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-29 13:34:38 +02:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, Value);
|
|
|
|
|
2006-07-24 23:10:00 +02:00
|
|
|
This->status_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
|
2006-04-29 13:34:38 +02:00
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the status bar change. */
|
|
|
|
|
2006-04-29 13:34:38 +02:00
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = Value;
|
2006-05-17 18:25:33 +02:00
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONSTATUSBAR, &dispparams);
|
2006-04-29 13:34:38 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_StatusText(IWebBrowser2 *iface, BSTR *StatusText)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, StatusText);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_StatusText(IWebBrowser2 *iface, BSTR StatusText)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(StatusText));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_ToolBar(IWebBrowser2 *iface, int *Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-29 13:35:29 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, Value);
|
|
|
|
|
|
|
|
*Value = This->tool_bar;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_ToolBar(IWebBrowser2 *iface, int Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-29 13:35:29 +02:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, Value);
|
|
|
|
|
|
|
|
This->tool_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
|
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the tool bar change. */
|
|
|
|
|
2006-04-29 13:35:29 +02:00
|
|
|
V_VT(&arg) = VT_BOOL;
|
2008-06-08 21:33:27 +02:00
|
|
|
V_BOOL(&arg) = This->tool_bar;
|
2006-05-17 18:25:33 +02:00
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONTOOLBAR, &dispparams);
|
2006-04-29 13:35:29 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-28 23:45:36 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, Value);
|
|
|
|
|
|
|
|
*Value = This->menu_bar;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-28 23:45:36 +02:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, Value);
|
|
|
|
|
2006-07-24 23:10:00 +02:00
|
|
|
This->menu_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
|
2006-04-28 23:45:36 +02:00
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the menu bar change. */
|
|
|
|
|
2006-04-28 23:45:36 +02:00
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = Value;
|
2006-05-17 18:25:33 +02:00
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONMENUBAR, &dispparams);
|
2006-04-28 23:45:36 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2007-09-23 22:37:01 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pbFullScreen);
|
|
|
|
|
|
|
|
*pbFullScreen = This->full_screen;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL bFullScreen)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-01-14 16:26:23 +01:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the fullscreen change. */
|
2007-09-23 22:37:01 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, bFullScreen);
|
|
|
|
|
|
|
|
This->full_screen = bFullScreen ? VARIANT_TRUE : VARIANT_FALSE;
|
2008-01-14 16:26:23 +01:00
|
|
|
|
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = bFullScreen;
|
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONFULLSCREEN, &dispparams);
|
|
|
|
|
2007-09-23 22:37:01 +02:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VARIANT *Flags,
|
|
|
|
VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2009-08-14 19:44:11 +02:00
|
|
|
LPCWSTR url;
|
2005-11-15 13:03:25 +01:00
|
|
|
|
2009-10-11 21:24:51 +02:00
|
|
|
TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_variant(URL), debugstr_variant(Flags),
|
|
|
|
debugstr_variant(TargetFrameName), debugstr_variant(PostData), debugstr_variant(Headers));
|
2005-11-15 13:03:25 +01:00
|
|
|
|
|
|
|
if(!This->client)
|
|
|
|
return E_FAIL;
|
|
|
|
|
2005-11-28 10:40:52 +01:00
|
|
|
if(!URL)
|
|
|
|
return S_OK;
|
2006-02-15 11:53:21 +01:00
|
|
|
|
2009-08-14 19:44:11 +02:00
|
|
|
switch (V_VT(URL))
|
|
|
|
{
|
|
|
|
case VT_BSTR:
|
|
|
|
url = V_BSTR(URL);
|
|
|
|
break;
|
|
|
|
case VT_BSTR|VT_BYREF:
|
|
|
|
url = *V_BSTRREF(URL);
|
|
|
|
break;
|
|
|
|
default:
|
2006-10-19 23:14:00 +02:00
|
|
|
FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL));
|
2005-11-28 10:40:52 +01:00
|
|
|
return E_INVALIDARG;
|
2005-11-15 13:03:25 +01:00
|
|
|
}
|
|
|
|
|
2009-08-14 19:44:11 +02:00
|
|
|
return navigate_url(&This->doc_host, url, Flags, TargetFrameName, PostData, Headers);
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2011-03-01 21:25:41 +01:00
|
|
|
IOleCommandTarget *target = NULL;
|
|
|
|
OLECMD ole_command[1];
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %p)\n", This, cmdID, pcmdf);
|
|
|
|
|
|
|
|
if (!pcmdf)
|
|
|
|
return E_POINTER;
|
|
|
|
ole_command[0].cmdID = cmdID;
|
|
|
|
ole_command[0].cmdf = *pcmdf;
|
|
|
|
|
|
|
|
if (This->container)
|
|
|
|
{
|
|
|
|
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (LPVOID*)&target);
|
|
|
|
if(FAILED(hres))
|
|
|
|
target = NULL;
|
|
|
|
}
|
|
|
|
if (!target && This->doc_host.document)
|
|
|
|
{
|
|
|
|
hres = IOleContainer_QueryInterface(This->doc_host.document, &IID_IOleCommandTarget, (LPVOID*)&target);
|
|
|
|
if(FAILED(hres))
|
|
|
|
target = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!target)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
hres = IOleCommandTarget_QueryStatus(target, NULL, 1, ole_command, NULL);
|
|
|
|
if (SUCCEEDED(hres))
|
|
|
|
*pcmdf = ole_command[0].cmdf;
|
|
|
|
if (hres == OLECMDERR_E_NOTSUPPORTED)
|
|
|
|
{
|
|
|
|
*pcmdf = 0;
|
|
|
|
hres = S_OK;
|
|
|
|
}
|
|
|
|
IOleCommandTarget_Release(target);
|
|
|
|
|
|
|
|
return hres;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
|
|
|
|
OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2011-03-01 21:25:41 +01:00
|
|
|
IOleCommandTarget *target = NULL;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %d %s %p)\n", This, cmdID, cmdexecopt, debugstr_variant(pvaIn), pvaOut);
|
|
|
|
|
|
|
|
if(This->container)
|
|
|
|
{
|
|
|
|
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (LPVOID*)&target);
|
|
|
|
if(FAILED(hres))
|
|
|
|
target = NULL;
|
|
|
|
}
|
|
|
|
if(!target && This->doc_host.document)
|
|
|
|
{
|
|
|
|
hres = IOleContainer_QueryInterface(This->doc_host.document, &IID_IOleCommandTarget, (LPVOID*)&target);
|
|
|
|
if(FAILED(hres))
|
|
|
|
target = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!target)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
hres = IOleCommandTarget_Exec(target, NULL, cmdID, cmdexecopt, pvaIn, pvaOut);
|
|
|
|
IOleCommandTarget_Release(target);
|
|
|
|
|
|
|
|
return hres;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_ShowBrowserBar(IWebBrowser2 *iface, VARIANT *pvaClsid,
|
|
|
|
VARIANT *pvarShow, VARIANT *pvarSize)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2009-10-11 21:24:51 +02:00
|
|
|
FIXME("(%p)->(%s %s %s)\n", This, debugstr_variant(pvaClsid), debugstr_variant(pvarShow),
|
|
|
|
debugstr_variant(pvarSize));
|
2005-09-12 23:17:57 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_ReadyState(IWebBrowser2 *iface, READYSTATE *lpReadyState)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-03-06 09:58:33 +01:00
|
|
|
|
2009-08-30 01:02:34 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, lpReadyState);
|
|
|
|
|
|
|
|
*lpReadyState = This->doc_host.ready_state;
|
2008-03-06 09:58:33 +01:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_Offline(IWebBrowser2 *iface, VARIANT_BOOL *pbOffline)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-11-05 17:46:13 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pbOffline);
|
|
|
|
|
2007-03-09 16:52:16 +01:00
|
|
|
*pbOffline = This->doc_host.offline;
|
2006-11-05 17:46:13 +01:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_Offline(IWebBrowser2 *iface, VARIANT_BOOL bOffline)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-11-05 17:46:13 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, bOffline);
|
|
|
|
|
2007-03-09 16:52:16 +01:00
|
|
|
This->doc_host.offline = bOffline ? VARIANT_TRUE : VARIANT_FALSE;
|
2006-11-05 17:46:13 +01:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_Silent(IWebBrowser2 *iface, VARIANT_BOOL *pbSilent)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-09-21 18:07:04 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pbSilent);
|
|
|
|
|
2007-03-09 16:52:16 +01:00
|
|
|
*pbSilent = This->doc_host.silent;
|
2006-09-21 18:07:04 +02:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_Silent(IWebBrowser2 *iface, VARIANT_BOOL bSilent)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-09-21 18:07:04 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, bSilent);
|
|
|
|
|
2007-03-09 16:52:16 +01:00
|
|
|
This->doc_host.silent = bSilent ? VARIANT_TRUE : VARIANT_FALSE;
|
2006-09-21 18:07:04 +02:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_RegisterAsBrowser(IWebBrowser2 *iface,
|
|
|
|
VARIANT_BOOL *pbRegister)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-05-12 16:22:10 +02:00
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pbRegister);
|
2008-05-12 16:22:10 +02:00
|
|
|
|
|
|
|
*pbRegister = This->register_browser;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_RegisterAsBrowser(IWebBrowser2 *iface,
|
|
|
|
VARIANT_BOOL bRegister)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-05-12 16:22:10 +02:00
|
|
|
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%x)\n", This, bRegister);
|
2008-05-12 16:22:10 +02:00
|
|
|
|
|
|
|
This->register_browser = bRegister ? VARIANT_TRUE : VARIANT_FALSE;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_RegisterAsDropTarget(IWebBrowser2 *iface,
|
|
|
|
VARIANT_BOOL *pbRegister)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pbRegister);
|
2008-02-21 13:05:49 +01:00
|
|
|
*pbRegister=0;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_RegisterAsDropTarget(IWebBrowser2 *iface,
|
|
|
|
VARIANT_BOOL bRegister)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2005-09-12 23:17:57 +02:00
|
|
|
FIXME("(%p)->(%x)\n", This, bRegister);
|
2006-09-29 03:00:09 +02:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-02-22 11:34:06 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pbRegister);
|
|
|
|
|
|
|
|
*pbRegister = This->theater_mode;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-02-22 11:34:06 +01:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, bRegister);
|
|
|
|
|
|
|
|
This->theater_mode = bRegister ? VARIANT_TRUE : VARIANT_FALSE;
|
|
|
|
|
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the theater mode change. */
|
|
|
|
|
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = bRegister;
|
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONTHEATERMODE, &dispparams);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-29 13:33:05 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, Value);
|
|
|
|
|
|
|
|
*Value = This->address_bar;
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2006-04-29 13:33:05 +02:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, Value);
|
|
|
|
|
2006-07-24 23:10:00 +02:00
|
|
|
This->address_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
|
2006-04-29 13:33:05 +02:00
|
|
|
|
2006-04-30 23:48:05 +02:00
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the address bar change. */
|
|
|
|
|
2006-04-29 13:33:05 +02:00
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = Value;
|
2006-05-17 18:25:33 +02:00
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_ONADDRESSBAR, &dispparams);
|
2006-04-29 13:33:05 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_get_Resizable(IWebBrowser2 *iface, VARIANT_BOOL *Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2007-09-23 22:57:58 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, Value);
|
|
|
|
|
|
|
|
/* It's InternetExplorer object's method. We have nothing to do here. */
|
2005-09-12 23:17:57 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WebBrowser_put_Resizable(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
|
|
|
{
|
2010-11-13 17:47:05 +01:00
|
|
|
WebBrowser *This = impl_from_IWebBrowser2(iface);
|
2008-01-14 16:26:36 +01:00
|
|
|
VARIANTARG arg;
|
|
|
|
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
|
2007-09-23 22:57:58 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, Value);
|
|
|
|
|
2008-01-14 16:26:36 +01:00
|
|
|
/* In opposition to InternetExplorer, all we should do here is
|
|
|
|
* inform the embedder about the resizable change. */
|
|
|
|
|
|
|
|
V_VT(&arg) = VT_BOOL;
|
|
|
|
V_BOOL(&arg) = Value;
|
|
|
|
call_sink(This->doc_host.cps.wbe2, DISPID_WINDOWSETRESIZABLE, &dispparams);
|
|
|
|
|
2007-09-23 22:57:58 +02:00
|
|
|
return S_OK;
|
2005-09-12 23:17:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IWebBrowser2Vtbl WebBrowser2Vtbl =
|
2005-09-06 13:41:14 +02:00
|
|
|
{
|
|
|
|
WebBrowser_QueryInterface,
|
|
|
|
WebBrowser_AddRef,
|
|
|
|
WebBrowser_Release,
|
|
|
|
WebBrowser_GetTypeInfoCount,
|
|
|
|
WebBrowser_GetTypeInfo,
|
|
|
|
WebBrowser_GetIDsOfNames,
|
|
|
|
WebBrowser_Invoke,
|
|
|
|
WebBrowser_GoBack,
|
|
|
|
WebBrowser_GoForward,
|
|
|
|
WebBrowser_GoHome,
|
|
|
|
WebBrowser_GoSearch,
|
|
|
|
WebBrowser_Navigate,
|
|
|
|
WebBrowser_Refresh,
|
|
|
|
WebBrowser_Refresh2,
|
|
|
|
WebBrowser_Stop,
|
|
|
|
WebBrowser_get_Application,
|
|
|
|
WebBrowser_get_Parent,
|
|
|
|
WebBrowser_get_Container,
|
|
|
|
WebBrowser_get_Document,
|
|
|
|
WebBrowser_get_TopLevelContainer,
|
|
|
|
WebBrowser_get_Type,
|
|
|
|
WebBrowser_get_Left,
|
|
|
|
WebBrowser_put_Left,
|
|
|
|
WebBrowser_get_Top,
|
|
|
|
WebBrowser_put_Top,
|
|
|
|
WebBrowser_get_Width,
|
|
|
|
WebBrowser_put_Width,
|
|
|
|
WebBrowser_get_Height,
|
|
|
|
WebBrowser_put_Height,
|
|
|
|
WebBrowser_get_LocationName,
|
|
|
|
WebBrowser_get_LocationURL,
|
2005-09-12 23:17:57 +02:00
|
|
|
WebBrowser_get_Busy,
|
|
|
|
WebBrowser_Quit,
|
|
|
|
WebBrowser_ClientToWindow,
|
|
|
|
WebBrowser_PutProperty,
|
|
|
|
WebBrowser_GetProperty,
|
|
|
|
WebBrowser_get_Name,
|
|
|
|
WebBrowser_get_HWND,
|
|
|
|
WebBrowser_get_FullName,
|
|
|
|
WebBrowser_get_Path,
|
|
|
|
WebBrowser_get_Visible,
|
|
|
|
WebBrowser_put_Visible,
|
|
|
|
WebBrowser_get_StatusBar,
|
|
|
|
WebBrowser_put_StatusBar,
|
|
|
|
WebBrowser_get_StatusText,
|
|
|
|
WebBrowser_put_StatusText,
|
|
|
|
WebBrowser_get_ToolBar,
|
|
|
|
WebBrowser_put_ToolBar,
|
|
|
|
WebBrowser_get_MenuBar,
|
|
|
|
WebBrowser_put_MenuBar,
|
|
|
|
WebBrowser_get_FullScreen,
|
|
|
|
WebBrowser_put_FullScreen,
|
|
|
|
WebBrowser_Navigate2,
|
|
|
|
WebBrowser_QueryStatusWB,
|
|
|
|
WebBrowser_ExecWB,
|
|
|
|
WebBrowser_ShowBrowserBar,
|
|
|
|
WebBrowser_get_ReadyState,
|
|
|
|
WebBrowser_get_Offline,
|
|
|
|
WebBrowser_put_Offline,
|
|
|
|
WebBrowser_get_Silent,
|
|
|
|
WebBrowser_put_Silent,
|
|
|
|
WebBrowser_get_RegisterAsBrowser,
|
|
|
|
WebBrowser_put_RegisterAsBrowser,
|
|
|
|
WebBrowser_get_RegisterAsDropTarget,
|
|
|
|
WebBrowser_put_RegisterAsDropTarget,
|
|
|
|
WebBrowser_get_TheaterMode,
|
|
|
|
WebBrowser_put_TheaterMode,
|
|
|
|
WebBrowser_get_AddressBar,
|
|
|
|
WebBrowser_put_AddressBar,
|
|
|
|
WebBrowser_get_Resizable,
|
|
|
|
WebBrowser_put_Resizable
|
2002-05-05 21:40:57 +02:00
|
|
|
};
|
|
|
|
|
2010-11-13 17:47:31 +01:00
|
|
|
static inline WebBrowser *impl_from_IServiceProvider(IServiceProvider *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IServiceProvider_iface);
|
2010-11-13 17:47:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WBServiceProvider_QueryInterface(IServiceProvider *iface,
|
2009-01-26 10:34:11 +01:00
|
|
|
REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
2010-11-13 17:47:31 +01:00
|
|
|
WebBrowser *This = impl_from_IServiceProvider(iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
|
2009-01-26 10:34:11 +01:00
|
|
|
}
|
|
|
|
|
2010-11-13 17:47:31 +01:00
|
|
|
static ULONG WINAPI WBServiceProvider_AddRef(IServiceProvider *iface)
|
2009-01-26 10:34:11 +01:00
|
|
|
{
|
2010-11-13 17:47:31 +01:00
|
|
|
WebBrowser *This = impl_from_IServiceProvider(iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
|
2009-01-26 10:34:11 +01:00
|
|
|
}
|
|
|
|
|
2010-11-13 17:47:31 +01:00
|
|
|
static ULONG WINAPI WBServiceProvider_Release(IServiceProvider *iface)
|
2009-01-26 10:34:11 +01:00
|
|
|
{
|
2010-11-13 17:47:31 +01:00
|
|
|
WebBrowser *This = impl_from_IServiceProvider(iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
return IWebBrowser_Release(&This->IWebBrowser2_iface);
|
2009-01-26 10:34:11 +01:00
|
|
|
}
|
|
|
|
|
2010-11-13 17:47:31 +01:00
|
|
|
static HRESULT STDMETHODCALLTYPE WBServiceProvider_QueryService(IServiceProvider *iface,
|
2009-01-26 10:34:11 +01:00
|
|
|
REFGUID guidService, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-11-13 17:47:31 +01:00
|
|
|
WebBrowser *This = impl_from_IServiceProvider(iface);
|
2009-01-26 10:34:11 +01:00
|
|
|
|
|
|
|
if(*ppv)
|
|
|
|
ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IBrowserService2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IBrowserService2 return E_FAIL)\n", This);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s, %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IServiceProviderVtbl ServiceProviderVtbl =
|
|
|
|
{
|
2010-11-13 17:47:31 +01:00
|
|
|
WBServiceProvider_QueryInterface,
|
|
|
|
WBServiceProvider_AddRef,
|
|
|
|
WBServiceProvider_Release,
|
|
|
|
WBServiceProvider_QueryService
|
2009-01-26 10:34:11 +01:00
|
|
|
};
|
|
|
|
|
2010-11-13 17:48:34 +01:00
|
|
|
static inline WebBrowser *impl_from_DocHost(DocHost *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, doc_host);
|
2010-11-13 17:48:34 +01:00
|
|
|
}
|
2010-11-12 14:30:03 +01:00
|
|
|
|
2011-01-07 19:03:23 +01:00
|
|
|
static ULONG WebBrowser_addref(DocHost *iface)
|
|
|
|
{
|
|
|
|
WebBrowser *This = impl_from_DocHost(iface);
|
|
|
|
return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WebBrowser_release(DocHost *iface)
|
|
|
|
{
|
|
|
|
WebBrowser *This = impl_from_DocHost(iface);
|
|
|
|
return IWebBrowser2_Release(&This->IWebBrowser2_iface);
|
|
|
|
}
|
|
|
|
|
2010-07-29 10:28:02 +02:00
|
|
|
static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
|
|
|
|
{
|
|
|
|
GetClientRect(This->frame_hwnd, rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text)
|
|
|
|
{
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-11-12 14:30:03 +01:00
|
|
|
static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
|
|
|
|
VARIANT *out)
|
|
|
|
{
|
2010-11-13 17:48:34 +01:00
|
|
|
WebBrowser *This = impl_from_DocHost(doc_host);
|
2010-11-12 14:30:03 +01:00
|
|
|
IOleCommandTarget *cmdtrg = NULL;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
if(This->client) {
|
|
|
|
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
|
|
|
|
if(FAILED(hres))
|
|
|
|
cmdtrg = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!cmdtrg && This->container) {
|
|
|
|
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (void**)&cmdtrg);
|
|
|
|
if(FAILED(hres))
|
|
|
|
cmdtrg = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!cmdtrg)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
hres = IOleCommandTarget_Exec(cmdtrg, cmd_group, cmdid, execopt, in, out);
|
|
|
|
IOleCommandTarget_Release(cmdtrg);
|
|
|
|
if(FAILED(hres))
|
|
|
|
FIXME("Exec failed\n");
|
|
|
|
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2010-07-29 10:28:02 +02:00
|
|
|
static const IDocHostContainerVtbl DocHostContainerVtbl = {
|
2011-01-07 19:03:23 +01:00
|
|
|
WebBrowser_addref,
|
|
|
|
WebBrowser_release,
|
2010-07-29 10:28:02 +02:00
|
|
|
DocHostContainer_GetDocObjRect,
|
|
|
|
DocHostContainer_SetStatusText,
|
2010-11-12 14:30:03 +01:00
|
|
|
DocHostContainer_SetURL,
|
|
|
|
DocHostContainer_exec
|
2010-07-29 10:28:02 +02:00
|
|
|
};
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
static HRESULT create_webbrowser(int version, IUnknown *outer, REFIID riid, void **ppv)
|
2005-09-06 13:41:14 +02:00
|
|
|
{
|
|
|
|
WebBrowser *ret;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
TRACE("(%p %s %p) version=%d\n", outer, debugstr_guid(riid), ppv, version);
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2010-03-13 16:43:06 +01:00
|
|
|
ret = heap_alloc_zero(sizeof(WebBrowser));
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
ret->IWebBrowser2_iface.lpVtbl = &WebBrowser2Vtbl;
|
2010-11-13 17:47:31 +01:00
|
|
|
ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
|
2010-03-13 16:43:06 +01:00
|
|
|
ret->ref = 1;
|
2006-05-23 20:03:30 +02:00
|
|
|
ret->version = version;
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
DocHost_Init(&ret->doc_host, (IDispatch*)&ret->IWebBrowser2_iface, &DocHostContainerVtbl);
|
2006-04-18 00:24:59 +02:00
|
|
|
|
2006-04-28 20:29:07 +02:00
|
|
|
ret->visible = VARIANT_TRUE;
|
2006-04-28 23:45:36 +02:00
|
|
|
ret->menu_bar = VARIANT_TRUE;
|
2006-04-29 13:33:05 +02:00
|
|
|
ret->address_bar = VARIANT_TRUE;
|
2006-04-29 13:34:38 +02:00
|
|
|
ret->status_bar = VARIANT_TRUE;
|
2006-04-29 13:35:29 +02:00
|
|
|
ret->tool_bar = VARIANT_TRUE;
|
2006-04-28 20:29:07 +02:00
|
|
|
|
2005-09-06 13:41:14 +02:00
|
|
|
WebBrowser_OleObject_Init(ret);
|
2005-11-12 20:09:46 +01:00
|
|
|
WebBrowser_ViewObject_Init(ret);
|
2005-09-08 13:01:57 +02:00
|
|
|
WebBrowser_Persist_Init(ret);
|
2005-09-08 20:55:50 +02:00
|
|
|
WebBrowser_ClassInfo_Init(ret);
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
HlinkFrame_Init(&ret->hlink_frame, (IUnknown*)&ret->IWebBrowser2_iface, &ret->doc_host);
|
2010-07-27 18:14:54 +02:00
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
lock_module();
|
2010-03-13 16:43:06 +01:00
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
hres = IWebBrowser_QueryInterface(&ret->IWebBrowser2_iface, riid, ppv);
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2010-11-13 17:47:05 +01:00
|
|
|
IWebBrowser2_Release(&ret->IWebBrowser2_iface);
|
2005-09-06 13:41:14 +02:00
|
|
|
return hres;
|
|
|
|
}
|
2006-05-23 20:03:30 +02:00
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
HRESULT WINAPI WebBrowserV1_Create(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
|
2006-05-23 20:03:30 +02:00
|
|
|
{
|
2011-07-27 14:46:48 +02:00
|
|
|
return create_webbrowser(1, pOuter, riid, ppv);
|
2006-05-23 20:03:30 +02:00
|
|
|
}
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
HRESULT WINAPI WebBrowser_Create(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
|
2006-05-23 20:03:30 +02:00
|
|
|
{
|
2011-07-27 14:46:48 +02:00
|
|
|
return create_webbrowser(2, pOuter, riid, ppv);
|
2006-05-23 20:03:30 +02:00
|
|
|
}
|