2002-05-05 21:40:57 +02:00
|
|
|
/*
|
2005-09-08 20:55:50 +02:00
|
|
|
* Implementation of IProvideClassInfo interfaces for WebBrowser control
|
2002-05-05 21:40:57 +02:00
|
|
|
*
|
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2002-05-05 21:40:57 +02:00
|
|
|
#include <string.h>
|
2002-12-05 21:33:07 +01:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2002-12-05 21:33:07 +01:00
|
|
|
#include "winbase.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
#include "shdocvw.h"
|
2002-12-05 21:33:07 +01:00
|
|
|
#include "wine/debug.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
|
|
|
|
|
|
|
/**********************************************************************
|
2005-09-08 20:55:50 +02:00
|
|
|
* Implement the IProvideClassInfo2 interface
|
2002-05-05 21:40:57 +02:00
|
|
|
*/
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
#define CLASSINFO_THIS(iface) DEFINE_THIS(WebBrowser, ProvideClassInfo, iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideClassInfo2 *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
WebBrowser *This = CLASSINFO_THIS(iface);
|
|
|
|
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideClassInfo2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
WebBrowser *This = CLASSINFO_THIS(iface);
|
|
|
|
return IWebBrowser_AddRef(WEBBROWSER(This));
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static ULONG WINAPI ProvideClassInfo_Release(IProvideClassInfo2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
WebBrowser *This = CLASSINFO_THIS(iface);
|
|
|
|
return IWebBrowser_Release(WEBBROWSER(This));
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo2 *iface, LPTYPEINFO *ppTI)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
WebBrowser *This = CLASSINFO_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppTI);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the IID for generic default event callbacks. This IID will
|
|
|
|
* in theory be used to later query for an IConnectionPoint to connect
|
2004-02-09 23:07:42 +01:00
|
|
|
* an event sink (callback implementation in the OLE control site)
|
2002-05-05 21:40:57 +02:00
|
|
|
* to this control.
|
|
|
|
*/
|
2005-09-08 20:55:50 +02:00
|
|
|
static HRESULT WINAPI ProvideClassInfo_GetGUID(IProvideClassInfo2 *iface,
|
|
|
|
DWORD dwGuidKind, GUID *pGUID)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
WebBrowser *This = CLASSINFO_THIS(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%ld %p)\n", This, dwGuidKind, pGUID);
|
2002-05-05 21:40:57 +02:00
|
|
|
|
|
|
|
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
|
|
|
|
{
|
|
|
|
FIXME ("Requested unsupported GUID type: %ld\n", dwGuidKind);
|
|
|
|
return E_FAIL; /* Is there a better return type here? */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Returning IPropertyNotifySink interface, but should really
|
|
|
|
* return a more generic event set (???) dispinterface.
|
|
|
|
* However, this hack, allows a control site to return with success
|
|
|
|
* (MFC's COleControlSite falls back to older IProvideClassInfo interface
|
|
|
|
* if GetGUID() fails to return a non-NULL GUID).
|
|
|
|
*/
|
|
|
|
memcpy(pGUID, &IID_IPropertyNotifySink, sizeof(GUID));
|
|
|
|
FIXME("Wrongly returning IPropertyNotifySink interface %s\n",
|
|
|
|
debugstr_guid(pGUID));
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
#undef CLASSINFO_THIS
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static const IProvideClassInfo2Vtbl ProvideClassInfoVtbl =
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
ProvideClassInfo_QueryInterface,
|
|
|
|
ProvideClassInfo_AddRef,
|
|
|
|
ProvideClassInfo_Release,
|
|
|
|
ProvideClassInfo_GetClassInfo,
|
|
|
|
ProvideClassInfo_GetGUID
|
2002-05-05 21:40:57 +02:00
|
|
|
};
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
void WebBrowser_ClassInfo_Init(WebBrowser *This)
|
|
|
|
{
|
|
|
|
This->lpProvideClassInfoVtbl = &ProvideClassInfoVtbl;
|
|
|
|
}
|