From 9f077e5546ec2e80d918d4c60d2c8b2670fe737f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 8 Aug 2005 11:07:48 +0000 Subject: [PATCH] Added stub implementation of IOleControl. --- dlls/mshtml/htmldoc.c | 3 ++ dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/oleobj.c | 67 ++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 142751bef12..55d2d5209e8 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -102,6 +102,9 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { TRACE("(%p)->(IID_IOleCommandTarget, %p)\n", This, ppvObject); *ppvObject = CMDTARGET(This); + }else if(IsEqualGUID(&IID_IOleControl, riid)) { + TRACE("(%p)->(IID_IOleControl, %p)\n", This, ppvObject); + *ppvObject = CONTROL(This); } if(*ppvObject) { diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d79ea4753e4..5e558ff261a 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -40,6 +40,7 @@ typedef struct { const IOleInPlaceObjectWindowlessVtbl *lpOleInPlaceObjectWindowlessVtbl; const IServiceProviderVtbl *lpServiceProviderVtbl; const IOleCommandTargetVtbl *lpOleCommandTargetVtbl; + const IOleControlVtbl *lpOleControlVtbl; LONG ref; @@ -84,6 +85,7 @@ struct NSContainer { #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl) #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl) #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl) +#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl) #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index b02ea2d1eb6..b01f0f03134 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -764,6 +764,8 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID return OLECMDERR_E_UNKNOWNGROUP; } +#undef CMDTARGET_THIS + static const IOleCommandTargetVtbl OleCommandTargetVtbl = { OleCommandTarget_QueryInterface, OleCommandTarget_AddRef, @@ -772,11 +774,76 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = { OleCommandTarget_Exec }; +/********************************************************** + * IOleControl implementation + */ + +#define CONTROL_THIS(iface) DEFINE_THIS(HTMLDocument, OleControl, iface) + +static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv) +{ + HTMLDocument *This = CONTROL_THIS(iface); + return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv); +} + +static ULONG WINAPI OleControl_AddRef(IOleControl *iface) +{ + HTMLDocument *This = CONTROL_THIS(iface); + return IHTMLDocument2_AddRef(HTMLDOC(This)); +} + +static ULONG WINAPI OleControl_Release(IOleControl *iface) +{ + HTMLDocument *This = CONTROL_THIS(iface); + return IHTMLDocument_Release(HTMLDOC(This)); +} + +static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI) +{ + HTMLDocument *This = CONTROL_THIS(iface); + FIXME("(%p)->(%p)\n", This, pCI); + return E_NOTIMPL; +} + +static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *pMsg) +{ + HTMLDocument *This = CONTROL_THIS(iface); + FIXME("(%p)->(%p)\n", This, pMsg); + return E_NOTIMPL; +} + +static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID) +{ + HTMLDocument *This = CONTROL_THIS(iface); + FIXME("(%p)->(%ld)\n", This, dispID); + return E_NOTIMPL; +} + +static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze) +{ + HTMLDocument *This = CONTROL_THIS(iface); + FIXME("(%p)->(%x)\n", This, bFreeze); + return E_NOTIMPL; +} + +#undef CONTROL_THIS + +static const IOleControlVtbl OleControlVtbl = { + OleControl_QueryInterface, + OleControl_AddRef, + OleControl_Release, + OleControl_GetControlInfo, + OleControl_OnMnemonic, + OleControl_OnAmbientPropertyChange, + OleControl_FreezeEvents +}; + void HTMLDocument_OleObj_Init(HTMLDocument *This) { This->lpOleObjectVtbl = &OleObjectVtbl; This->lpOleDocumentVtbl = &OleDocumentVtbl; This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl; + This->lpOleControlVtbl = &OleControlVtbl; This->client = NULL; This->hostui = NULL;