Commit 2fe3b64f authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msctf: Stub implementation of ITfCategoryMgr.

parent 3680bdcc
...@@ -6,6 +6,7 @@ MODULE = msctf.dll ...@@ -6,6 +6,7 @@ MODULE = msctf.dll
IMPORTS = uuid ole32 user32 advapi32 kernel32 ntdll IMPORTS = uuid ole32 user32 advapi32 kernel32 ntdll
C_SRCS = \ C_SRCS = \
categorymgr.c \
context.c \ context.c \
documentmgr.c \ documentmgr.c \
inputprocessor.c \ inputprocessor.c \
......
/*
* ITfCategoryMgr implementation
*
* Copyright 2009 Aric Stewart, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "wine/unicode.h"
#include "msctf.h"
#include "msctf_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
typedef struct tagCategoryMgr {
const ITfCategoryMgrVtbl *CategoryMgrVtbl;
LONG refCount;
} CategoryMgr;
static void CategoryMgr_Destructor(CategoryMgr *This)
{
TRACE("destroying %p\n", This);
HeapFree(GetProcessHeap(),0,This);
}
static HRESULT WINAPI CategoryMgr_QueryInterface(ITfCategoryMgr *iface, REFIID iid, LPVOID *ppvOut)
{
CategoryMgr *This = (CategoryMgr *)iface;
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr))
{
*ppvOut = This;
}
if (*ppvOut)
{
IUnknown_AddRef(iface);
return S_OK;
}
WARN("unsupported interface: %s\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
static ULONG WINAPI CategoryMgr_AddRef(ITfCategoryMgr *iface)
{
CategoryMgr *This = (CategoryMgr *)iface;
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI CategoryMgr_Release(ITfCategoryMgr *iface)
{
CategoryMgr *This = (CategoryMgr *)iface;
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
if (ret == 0)
CategoryMgr_Destructor(This);
return ret;
}
/*****************************************************
* ITfCategoryMgr functions
*****************************************************/
static HRESULT WINAPI CategoryMgr_RegisterCategory ( ITfCategoryMgr *iface,
REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_UnregisterCategory ( ITfCategoryMgr *iface,
REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem ( ITfCategoryMgr *iface,
REFGUID rguid, IEnumGUID **ppEnum)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_EnumItemsInCategory ( ITfCategoryMgr *iface,
REFGUID rcatid, IEnumGUID **ppEnum)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_FindClosestCategory ( ITfCategoryMgr *iface,
REFGUID rguid, GUID *pcatid, const GUID **ppcatidList, ULONG ulCount)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_RegisterGUIDDescription (
ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid,
const WCHAR *pchDesc, ULONG cch)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription (
ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_GetGUIDDescription ( ITfCategoryMgr *iface,
REFGUID rguid, BSTR *pbstrDesc)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD ( ITfCategoryMgr *iface,
REFCLSID rclsid, REFGUID rguid, DWORD dw)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD ( ITfCategoryMgr *iface,
REFCLSID rclsid, REFGUID rguid)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_GetGUIDDWORD ( ITfCategoryMgr *iface,
REFGUID rguid, DWORD *pdw)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_RegisterGUID ( ITfCategoryMgr *iface,
REFGUID rguid, TfGuidAtom *pguidatom
)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_GetGUID ( ITfCategoryMgr *iface,
TfGuidAtom guidatom, GUID *pguid)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom ( ITfCategoryMgr *iface,
TfGuidAtom guidatom, REFGUID rguid, BOOL *pfEqual)
{
CategoryMgr *This = (CategoryMgr*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static const ITfCategoryMgrVtbl CategoryMgr_CategoryMgrVtbl =
{
CategoryMgr_QueryInterface,
CategoryMgr_AddRef,
CategoryMgr_Release,
CategoryMgr_RegisterCategory,
CategoryMgr_UnregisterCategory,
CategoryMgr_EnumCategoriesInItem,
CategoryMgr_EnumItemsInCategory,
CategoryMgr_FindClosestCategory,
CategoryMgr_RegisterGUIDDescription,
CategoryMgr_UnregisterGUIDDescription,
CategoryMgr_GetGUIDDescription,
CategoryMgr_RegisterGUIDDWORD,
CategoryMgr_UnregisterGUIDDWORD,
CategoryMgr_GetGUIDDWORD,
CategoryMgr_RegisterGUID,
CategoryMgr_GetGUID,
CategoryMgr_IsEqualTfGuidAtom
};
HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
{
CategoryMgr *This;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(CategoryMgr));
if (This == NULL)
return E_OUTOFMEMORY;
This->CategoryMgrVtbl= &CategoryMgr_CategoryMgrVtbl;
This->refCount = 1;
TRACE("returning %p\n", This);
*ppOut = (IUnknown *)This;
return S_OK;
}
...@@ -55,6 +55,7 @@ static const struct { ...@@ -55,6 +55,7 @@ static const struct {
} ClassesTable[] = { } ClassesTable[] = {
{&CLSID_TF_ThreadMgr, ThreadMgr_Constructor}, {&CLSID_TF_ThreadMgr, ThreadMgr_Constructor},
{&CLSID_TF_InputProcessorProfiles, InputProcessorProfiles_Constructor}, {&CLSID_TF_InputProcessorProfiles, InputProcessorProfiles_Constructor},
{&CLSID_TF_CategoryMgr, CategoryMgr_Constructor},
{NULL, NULL} {NULL, NULL}
}; };
......
...@@ -26,6 +26,7 @@ extern HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); ...@@ -26,6 +26,7 @@ extern HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut);
extern HRESULT DocumentMgr_Constructor(ITfDocumentMgr **ppOut); extern HRESULT DocumentMgr_Constructor(ITfDocumentMgr **ppOut);
extern HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **ppOut, TfEditCookie *pecTextStore); extern HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **ppOut, TfEditCookie *pecTextStore);
extern HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); extern HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut);
extern HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut);
extern const WCHAR szwSystemTIPKey[]; extern const WCHAR szwSystemTIPKey[];
#endif /* __WINE_MSCTF_I_H */ #endif /* __WINE_MSCTF_I_H */
...@@ -455,6 +455,13 @@ static struct regsvr_coclass const coclass_list[] = { ...@@ -455,6 +455,13 @@ static struct regsvr_coclass const coclass_list[] = {
"msctf.dll", "msctf.dll",
"Apartment" "Apartment"
}, },
{
&CLSID_TF_CategoryMgr,
"TF_CategoryMgr",
NULL,
"msctf.dll",
"Apartment"
},
{ NULL } /* list terminator */ { NULL } /* list terminator */
}; };
......
...@@ -111,3 +111,4 @@ DEFINE_GUID(CLSID_SynchronizeContainer, 0x0000032d,0x0000,0x0000,0xc0,0x00,0x0 ...@@ -111,3 +111,4 @@ DEFINE_GUID(CLSID_SynchronizeContainer, 0x0000032d,0x0000,0x0000,0xc0,0x00,0x0
DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
DEFINE_GUID(CLSID_TF_ThreadMgr, 0x529a9e6b,0x6587,0x4f23,0xab,0x9e,0x9c,0x7d,0x68,0x3e,0x3c,0x50); DEFINE_GUID(CLSID_TF_ThreadMgr, 0x529a9e6b,0x6587,0x4f23,0xab,0x9e,0x9c,0x7d,0x68,0x3e,0x3c,0x50);
DEFINE_GUID(CLSID_TF_InputProcessorProfiles, 0x33c53a50,0xf456,0x4884,0xb0,0x49,0x85,0xfd,0x64,0x3e,0xcf,0xed); DEFINE_GUID(CLSID_TF_InputProcessorProfiles, 0x33c53a50,0xf456,0x4884,0xb0,0x49,0x85,0xfd,0x64,0x3e,0xcf,0xed);
DEFINE_GUID(CLSID_TF_CategoryMgr, 0xA4B544A1,0x438D,0x4B41,0x93,0x25,0x86,0x95,0x23,0xE2,0xD6,0xC7);
...@@ -26,9 +26,11 @@ import "textstor.idl"; ...@@ -26,9 +26,11 @@ import "textstor.idl";
cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)") cpp_quote("#define TF_E_STACKFULL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0501)")
cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;") cpp_quote("EXTERN_C const CLSID CLSID_TF_ThreadMgr;")
cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;") cpp_quote("EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles;")
cpp_quote("EXTERN_C const CLSID CLSID_TF_CategoryMgr;")
typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie; typedef [uuid(7213778c-7bb0-4270-b050-6189ee594e97)] DWORD TfEditCookie;
typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId; typedef [uuid(de403c21-89fd-4f85-8b87-64584d063fbc)] DWORD TfClientId;
typedef [uuid(88a9c478-f3ec-4763-8345-cd9250443f8d)] DWORD TfGuidAtom;
interface ITfDocumentMgr; interface ITfDocumentMgr;
interface ITfContext; interface ITfContext;
...@@ -340,3 +342,62 @@ interface ITfInputProcessorProfiles : IUnknown ...@@ -340,3 +342,62 @@ interface ITfInputProcessorProfiles : IUnknown
[in] REFGUID guidProfile, [in] REFGUID guidProfile,
[in] HKL hKL); [in] HKL hKL);
}; };
[
object,
local,
uuid(c3acefb5-f69d-4905-938f-fcadcf4be830),
pointer_default(unique)
]
interface ITfCategoryMgr : IUnknown
{
HRESULT RegisterCategory([in] REFCLSID rclsid,
[in] REFGUID rcatid,
[in] REFGUID rguid);
HRESULT UnregisterCategory([in] REFCLSID rclsid,
[in] REFGUID rcatid,
[in] REFGUID rguid);
HRESULT EnumCategoriesInItem([in] REFGUID rguid,
[out] IEnumGUID **ppEnum);
HRESULT EnumItemsInCategory([in] REFGUID rcatid,
[out] IEnumGUID **ppEnum);
HRESULT FindClosestCategory([in] REFGUID rguid,
[out] GUID *pcatid,
[in, size_is(ulCount)] const GUID **ppcatidList,
[in] ULONG ulCount);
HRESULT RegisterGUIDDescription([in] REFCLSID rclsid,
[in] REFGUID rguid,
[in, size_is(cch)] const WCHAR *pchDesc,
[in] ULONG cch);
HRESULT UnregisterGUIDDescription([in] REFCLSID rclsid,
[in] REFGUID rguid);
HRESULT GetGUIDDescription([in] REFGUID rguid,
[out] BSTR *pbstrDesc);
HRESULT RegisterGUIDDWORD([in] REFCLSID rclsid,
[in] REFGUID rguid,
[in] DWORD dw);
HRESULT UnregisterGUIDDWORD([in] REFCLSID rclsid,
[in] REFGUID rguid);
HRESULT GetGUIDDWORD([in] REFGUID rguid,
[out] DWORD *pdw);
HRESULT RegisterGUID([in] REFGUID rguid,
[out] TfGuidAtom *pguidatom);
HRESULT GetGUID([in] TfGuidAtom guidatom,
[out] GUID *pguid);
HRESULT IsEqualTfGuidAtom([in] TfGuidAtom guidatom,
[in] REFGUID rguid,
[out] BOOL *pfEqual);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment