msctf: Support advising ITfLanguageProfileNotifySink in ITfInputProcessorProfiles.
This commit is contained in:
parent
fec456b3ff
commit
619b3896ec
|
@ -52,7 +52,7 @@ typedef struct tagInputProcessorProfilesSink {
|
||||||
union {
|
union {
|
||||||
/* InputProcessorProfile Sinks */
|
/* InputProcessorProfile Sinks */
|
||||||
IUnknown *pIUnknown;
|
IUnknown *pIUnknown;
|
||||||
/* ITfLanguageProfileNotifySink *pITfLanguageProfileNotifySink; */
|
ITfLanguageProfileNotifySink *pITfLanguageProfileNotifySink;
|
||||||
} interfaces;
|
} interfaces;
|
||||||
} InputProcessorProfilesSink;
|
} InputProcessorProfilesSink;
|
||||||
|
|
||||||
|
@ -599,6 +599,7 @@ static ULONG WINAPI IPPSource_Release(ITfSource *iface)
|
||||||
static WINAPI HRESULT IPPSource_AdviseSink(ITfSource *iface,
|
static WINAPI HRESULT IPPSource_AdviseSink(ITfSource *iface,
|
||||||
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
|
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
|
||||||
{
|
{
|
||||||
|
InputProcessorProfilesSink *ipps;
|
||||||
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
|
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
|
||||||
|
|
||||||
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
|
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
|
||||||
|
@ -606,10 +607,30 @@ static WINAPI HRESULT IPPSource_AdviseSink(ITfSource *iface,
|
||||||
if (!riid || !punk || !pdwCookie)
|
if (!riid || !punk || !pdwCookie)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
if (IsEqualIID(riid, &IID_ITfLanguageProfileNotifySink))
|
||||||
|
{
|
||||||
|
ipps = HeapAlloc(GetProcessHeap(),0,sizeof(InputProcessorProfilesSink));
|
||||||
|
if (!ipps)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
if (!SUCCEEDED(IUnknown_QueryInterface(punk, riid, (LPVOID*)&ipps->interfaces.pITfLanguageProfileNotifySink)))
|
||||||
|
{
|
||||||
|
HeapFree(GetProcessHeap(),0,ipps);
|
||||||
|
return CONNECT_E_CANNOTCONNECT;
|
||||||
|
}
|
||||||
|
list_add_head(&This->LanguageProfileNotifySink,&ipps->entry);
|
||||||
|
*pdwCookie = generate_Cookie(COOKIE_MAGIC_IPPSINK, ipps);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid));
|
FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid));
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE("cookie %x\n",*pdwCookie);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static WINAPI HRESULT IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
|
static WINAPI HRESULT IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
|
||||||
{
|
{
|
||||||
InputProcessorProfilesSink *sink;
|
InputProcessorProfilesSink *sink;
|
||||||
|
|
|
@ -699,3 +699,17 @@ interface ITfClientId : IUnknown
|
||||||
[in] REFCLSID rclsid,
|
[in] REFCLSID rclsid,
|
||||||
[out] TfClientId *ptid);
|
[out] TfClientId *ptid);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
object,
|
||||||
|
uuid(43c9fe15-f494-4c17-9de2-b8a4ac350aa8),
|
||||||
|
pointer_default(unique)
|
||||||
|
]
|
||||||
|
interface ITfLanguageProfileNotifySink : IUnknown
|
||||||
|
{
|
||||||
|
HRESULT OnLanguageChange(
|
||||||
|
[in] LANGID langid,
|
||||||
|
[out] BOOL *pfAccept);
|
||||||
|
|
||||||
|
HRESULT OnLanguageChanged();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue