diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index b56d55878e8..d997cda70ab 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -87,7 +87,7 @@ typedef struct tagACLMulti { /* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */ /* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */ /* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */ - /* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */ + ITfUIElementMgr ITfUIElementMgr_iface; ITfSourceSingle ITfSourceSingle_iface; LONG refCount; @@ -157,6 +157,11 @@ static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink * return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEventSink_iface); } +static inline ThreadMgr *impl_from_ITfUIElementMgr(ITfUIElementMgr *iface) +{ + return CONTAINING_RECORD(iface, ThreadMgr, ITfUIElementMgr_iface); +} + static inline ThreadMgr *impl_from_ITfSourceSingle(ITfSourceSingle *iface) { return CONTAINING_RECORD(iface, ThreadMgr, ITfSourceSingle_iface); @@ -282,6 +287,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgrEx *iface, REFIID iid { *ppvOut = This->CompartmentMgr; } + else if (IsEqualIID(iid, &IID_ITfUIElementMgr)) + { + *ppvOut = &This->ITfUIElementMgr_iface; + } else if (IsEqualIID(iid, &IID_ITfSourceSingle)) { *ppvOut = &This->ITfSourceSingle_iface; @@ -1238,6 +1247,86 @@ static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSinkVtbl = ThreadMgrEventSink_OnPopContext }; +/***************************************************** + * ITfUIElementMgr functions + *****************************************************/ +static HRESULT WINAPI UIElementMgr_QueryInterface(ITfUIElementMgr *iface, REFIID iid, void **ppvOut) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, *ppvOut); +} + +static ULONG WINAPI UIElementMgr_AddRef(ITfUIElementMgr *iface) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); +} + +static ULONG WINAPI UIElementMgr_Release(ITfUIElementMgr *iface) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); +} + +static HRESULT WINAPI UIElementMgr_BeginUIElement(ITfUIElementMgr *iface, ITfUIElement *element, + BOOL *show, DWORD *id) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_UpdateUIElement(ITfUIElementMgr *iface, DWORD id) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_EndUIElement(ITfUIElementMgr *iface, DWORD id) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_GetUIElement(ITfUIElementMgr *iface, DWORD id, + ITfUIElement **element) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_EnumUIElements(ITfUIElementMgr *iface, + IEnumTfUIElements **enum_elements) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static const ITfUIElementMgrVtbl ThreadMgrUIElementMgrVtbl = +{ + UIElementMgr_QueryInterface, + UIElementMgr_AddRef, + UIElementMgr_Release, + + UIElementMgr_BeginUIElement, + UIElementMgr_UpdateUIElement, + UIElementMgr_EndUIElement, + UIElementMgr_GetUIElement, + UIElementMgr_EnumUIElements +}; + /***************************************************** * ITfSourceSingle functions *****************************************************/ @@ -1309,6 +1398,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) This->ITfMessagePump_iface.lpVtbl = &MessagePumpVtbl; This->ITfClientId_iface.lpVtbl = &ClientIdVtbl; This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSinkVtbl; + This->ITfUIElementMgr_iface.lpVtbl = &ThreadMgrUIElementMgrVtbl; This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl; This->refCount = 1; TlsSetValue(tlsIndex,This); diff --git a/include/msctf.idl b/include/msctf.idl index 0fe2d718b5d..0cfaacff0db 100644 --- a/include/msctf.idl +++ b/include/msctf.idl @@ -1654,6 +1654,76 @@ interface IEnumTfDocumentMgrs : IUnknown [in] ULONG ulCount); } +[ + object, + local, + uuid(ea1ea137-19df-11d7-a6d2-00065b84435c), + pointer_default(unique) +] +interface ITfUIElement : IUnknown +{ + HRESULT GetDescription( + [out] BSTR *description); + + HRESULT GetGUID( + [out] GUID *guid); + + HRESULT Show( + [in] BOOL show); + + HRESULT IsShown( + [out] BOOL *show); +} + +[ + object, + local, + uuid(887aa91e-acba-4931-84da-3c5208cf543f), + pointer_default(unique) +] +interface IEnumTfUIElements : IUnknown +{ + HRESULT Clone( + [out] IEnumTfUIElements **enum_elements); + + HRESULT Next( + [in] ULONG count, + [out, size_is(count), length_is(fetched)] ITfUIElement **element, + [out] ULONG fetched); + + HRESULT Reset(); + + HRESULT Skip( + [in] ULONG count); +} + +[ + object, + local, + uuid(ea1ea135-19df-11d7-a6d2-00065b84435c), + pointer_default(unique) +] +interface ITfUIElementMgr : IUnknown +{ + HRESULT BeginUIElement( + [in] ITfUIElement *element, + [in, out] BOOL *show, + [out] DWORD *id); + + HRESULT UpdateUIElement( + [in] DWORD id); + + HRESULT EndUIElement( + [in] DWORD id); + + HRESULT GetUIElement( + [in] DWORD id, + [out] ITfUIElement **element); + + HRESULT EnumUIElements( + [out] IEnumTfUIElements **enum_elements); +} + [ object, uuid(73131f9c-56a9-49dd-b0ee-d046633f7528),