Commit b84e112d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

msctf: Added ITfInputProcessorProfileMgr interface stub implementation.

parent 8d1b66be
...@@ -64,7 +64,7 @@ typedef struct tagInputProcessorProfilesSink { ...@@ -64,7 +64,7 @@ typedef struct tagInputProcessorProfilesSink {
typedef struct tagInputProcessorProfiles { typedef struct tagInputProcessorProfiles {
ITfInputProcessorProfiles ITfInputProcessorProfiles_iface; ITfInputProcessorProfiles ITfInputProcessorProfiles_iface;
ITfSource ITfSource_iface; ITfSource ITfSource_iface;
/* const ITfInputProcessorProfileMgrVtbl *InputProcessorProfileMgrVtbl; */ ITfInputProcessorProfileMgr ITfInputProcessorProfileMgr_iface;
/* const ITfInputProcessorProfilesExVtbl *InputProcessorProfilesExVtbl; */ /* const ITfInputProcessorProfilesExVtbl *InputProcessorProfilesExVtbl; */
/* const ITfInputProcessorProfileSubstituteLayoutVtbl *InputProcessorProfileSubstituteLayoutVtbl; */ /* const ITfInputProcessorProfileSubstituteLayoutVtbl *InputProcessorProfileSubstituteLayoutVtbl; */
LONG refCount; LONG refCount;
...@@ -171,28 +171,31 @@ static void add_userkey( REFCLSID rclsid, LANGID langid, ...@@ -171,28 +171,31 @@ static void add_userkey( REFCLSID rclsid, LANGID langid,
RegCloseKey(key); RegCloseKey(key);
} }
static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, void **ppv)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface); InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles))
{ {
*ppvOut = &This->ITfInputProcessorProfiles_iface; *ppv = &This->ITfInputProcessorProfiles_iface;
}
else if (IsEqualIID(iid, &IID_ITfInputProcessorProfileMgr))
{
*ppv = &This->ITfInputProcessorProfileMgr_iface;
} }
else if (IsEqualIID(iid, &IID_ITfSource)) else if (IsEqualIID(iid, &IID_ITfSource))
{ {
*ppvOut = &This->ITfSource_iface; *ppv = &This->ITfSource_iface;
} }
else
if (*ppvOut)
{ {
ITfInputProcessorProfiles_AddRef(iface); *ppv = NULL;
return S_OK; WARN("unsupported interface: %s\n", debugstr_guid(iid));
return E_NOINTERFACE;
} }
WARN("unsupported interface: %s\n", debugstr_guid(iid)); ITfInputProcessorProfiles_AddRef(iface);
return E_NOINTERFACE; return S_OK;
} }
static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface) static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface)
...@@ -685,6 +688,114 @@ static const ITfInputProcessorProfilesVtbl InputProcessorProfilesVtbl = ...@@ -685,6 +688,114 @@ static const ITfInputProcessorProfilesVtbl InputProcessorProfilesVtbl =
InputProcessorProfiles_SubstituteKeyboardLayout InputProcessorProfiles_SubstituteKeyboardLayout
}; };
static inline InputProcessorProfiles *impl_from_ITfInputProcessorProfileMgr(ITfInputProcessorProfileMgr *iface)
{
return CONTAINING_RECORD(iface, InputProcessorProfiles, ITfInputProcessorProfileMgr_iface);
}
static HRESULT WINAPI InputProcessorProfileMgr_QueryInterface(ITfInputProcessorProfileMgr *iface, REFIID riid, void **ppv)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
return ITfInputProcessorProfiles_QueryInterface(&This->ITfInputProcessorProfiles_iface, riid, ppv);
}
static ULONG WINAPI InputProcessorProfileMgr_AddRef(ITfInputProcessorProfileMgr *iface)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
return ITfInputProcessorProfiles_AddRef(&This->ITfInputProcessorProfiles_iface);
}
static ULONG WINAPI InputProcessorProfileMgr_Release(ITfInputProcessorProfileMgr *iface)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
return ITfInputProcessorProfiles_Release(&This->ITfInputProcessorProfiles_iface);
}
static HRESULT WINAPI InputProcessorProfileMgr_ActivateProfile(ITfInputProcessorProfileMgr *iface, DWORD dwProfileType,
LANGID langid, REFCLSID clsid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%d %x %s %s %p %x)\n", This, dwProfileType, langid, debugstr_guid(clsid),
debugstr_guid(guidProfile), hkl, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_DeactivateProfile(ITfInputProcessorProfileMgr *iface, DWORD dwProfileType,
LANGID langid, REFCLSID clsid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%d %x %s %s %p %x)\n", This, dwProfileType, langid, debugstr_guid(clsid),
debugstr_guid(guidProfile), hkl, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_GetProfile(ITfInputProcessorProfileMgr *iface, DWORD dwProfileType,
LANGID langid, REFCLSID clsid, REFGUID guidProfile, HKL hkl, TF_INPUTPROCESSORPROFILE *pProfile)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%d %x %s %s %p %p)\n", This, dwProfileType, langid, debugstr_guid(clsid),
debugstr_guid(guidProfile), hkl, pProfile);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_EnumProfiles(ITfInputProcessorProfileMgr *iface, LANGID langid,
IEnumTfInputProcessorProfiles **ppEnum)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%x %p)\n", This, langid, ppEnum);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_ReleaseInputProcessor(ITfInputProcessorProfileMgr *iface, REFCLSID rclsid,
DWORD dwFlags)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%s %x)\n", This, debugstr_guid(rclsid), dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_RegisterProfile(ITfInputProcessorProfileMgr *iface, REFCLSID rclsid,
LANGID langid, REFGUID guidProfile, const WCHAR *pchDesc, ULONG cchDesc, const WCHAR *pchIconFile,
ULONG cchFile, ULONG uIconIndex, HKL hklsubstitute, DWORD dwPreferredLayout, BOOL bEnabledByDefault,
DWORD dwFlags)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%s %x %s %s %d %s %u %u %p %x %x %x)\n", This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile),
debugstr_w(pchDesc), cchDesc, debugstr_w(pchIconFile), cchFile, uIconIndex, hklsubstitute, dwPreferredLayout,
bEnabledByDefault, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_UnregisterProfile(ITfInputProcessorProfileMgr *iface, REFCLSID rclsid,
LANGID langid, REFGUID guidProfile, DWORD dwFlags)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%s %x %s %x)\n", This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile), dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfileMgr_GetActiveProfile(ITfInputProcessorProfileMgr *iface, REFGUID catid,
TF_INPUTPROCESSORPROFILE *pProfile)
{
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(catid), pProfile);
return E_NOTIMPL;
}
static const ITfInputProcessorProfileMgrVtbl InputProcessorProfileMgrVtbl = {
InputProcessorProfileMgr_QueryInterface,
InputProcessorProfileMgr_AddRef,
InputProcessorProfileMgr_Release,
InputProcessorProfileMgr_ActivateProfile,
InputProcessorProfileMgr_DeactivateProfile,
InputProcessorProfileMgr_GetProfile,
InputProcessorProfileMgr_EnumProfiles,
InputProcessorProfileMgr_ReleaseInputProcessor,
InputProcessorProfileMgr_RegisterProfile,
InputProcessorProfileMgr_UnregisterProfile,
InputProcessorProfileMgr_GetActiveProfile
};
/***************************************************** /*****************************************************
* ITfSource functions * ITfSource functions
*****************************************************/ *****************************************************/
...@@ -782,6 +893,7 @@ HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut ...@@ -782,6 +893,7 @@ HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut
This->ITfInputProcessorProfiles_iface.lpVtbl= &InputProcessorProfilesVtbl; This->ITfInputProcessorProfiles_iface.lpVtbl= &InputProcessorProfilesVtbl;
This->ITfSource_iface.lpVtbl = &InputProcessorProfilesSourceVtbl; This->ITfSource_iface.lpVtbl = &InputProcessorProfilesSourceVtbl;
This->ITfInputProcessorProfileMgr_iface.lpVtbl = &InputProcessorProfileMgrVtbl;
This->refCount = 1; This->refCount = 1;
This->currentLanguage = GetUserDefaultLCID(); This->currentLanguage = GetUserDefaultLCID();
......
...@@ -2186,6 +2186,18 @@ static void test_AssociateFocus(void) ...@@ -2186,6 +2186,18 @@ static void test_AssociateFocus(void)
sink_check_ok(&test_OnPopContext,"OnPopContext"); sink_check_ok(&test_OnPopContext,"OnPopContext");
} }
static void test_QI(void)
{
ITfInputProcessorProfileMgr *ipp_mgr;
HRESULT hres;
/* A trivial test, probably worth moving once more will be added. */
hres = ITfInputProcessorProfiles_QueryInterface(g_ipp, &IID_ITfInputProcessorProfileMgr, (void**)&ipp_mgr);
ok(hres == S_OK, "Could not get ITfInputProcessorProfileMgr iface: %08x\n", hres);
ITfInputProcessorProfileMgr_Release(ipp_mgr);
}
START_TEST(inputprocessor) START_TEST(inputprocessor)
{ {
if (SUCCEEDED(initialize())) if (SUCCEEDED(initialize()))
...@@ -2212,6 +2224,7 @@ START_TEST(inputprocessor) ...@@ -2212,6 +2224,7 @@ START_TEST(inputprocessor)
test_ThreadMgrUnadviseSinks(); test_ThreadMgrUnadviseSinks();
test_UnregisterCategory(); test_UnregisterCategory();
test_Unregister(); test_Unregister();
test_QI();
} }
else else
skip("Unable to create InputProcessor\n"); skip("Unable to create InputProcessor\n");
......
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