Commit 85210d46 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msctf: Added stub ITextStoreACPServices support for context ITextStoreACPSink.

parent 80c91976
......@@ -66,6 +66,7 @@ typedef struct tagContext {
/* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */
ITfSourceSingle ITfSourceSingle_iface;
ITextStoreACPSink ITextStoreACPSink_iface;
ITextStoreACPServices ITextStoreACPServices_iface;
LONG refCount;
BOOL connected;
......@@ -121,6 +122,11 @@ static inline Context *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
return CONTAINING_RECORD(iface, Context, ITextStoreACPSink_iface);
}
static inline Context *impl_from_ITextStoreACPServices(ITextStoreACPServices *iface)
{
return CONTAINING_RECORD(iface, Context, ITextStoreACPServices_iface);
}
static void free_sink(ContextSink *sink)
{
IUnknown_Release(sink->interfaces.pIUnknown);
......@@ -791,6 +797,8 @@ static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface,
{
*ppvOut = &This->ITextStoreACPSink_iface;
}
else if (IsEqualIID(iid, &IID_ITextStoreACPServices))
*ppvOut = &This->ITextStoreACPServices_iface;
if (*ppvOut)
{
......@@ -963,6 +971,74 @@ static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl =
TextStoreACPSink_OnEndEditTransaction
};
static HRESULT WINAPI TextStoreACPServices_QueryInterface(ITextStoreACPServices *iface, REFIID riid, void **obj)
{
Context *This = impl_from_ITextStoreACPServices(iface);
return ITextStoreACPSink_QueryInterface(&This->ITextStoreACPSink_iface, riid, obj);
}
static ULONG WINAPI TextStoreACPServices_AddRef(ITextStoreACPServices *iface)
{
Context *This = impl_from_ITextStoreACPServices(iface);
return ITextStoreACPSink_AddRef(&This->ITextStoreACPSink_iface);
}
static ULONG WINAPI TextStoreACPServices_Release(ITextStoreACPServices *iface)
{
Context *This = impl_from_ITextStoreACPServices(iface);
return ITextStoreACPSink_Release(&This->ITextStoreACPSink_iface);
}
static HRESULT WINAPI TextStoreACPServices_Serialize(ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range,
TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream)
{
Context *This = impl_from_ITextStoreACPServices(iface);
FIXME("stub: %p %p %p %p %p\n", This, prop, range, header, stream);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPServices_Unserialize(ITextStoreACPServices *iface, ITfProperty *prop,
const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader)
{
Context *This = impl_from_ITextStoreACPServices(iface);
FIXME("stub: %p %p %p %p %p\n", This, prop, header, stream, loader);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty(ITextStoreACPServices *iface, ITfProperty *prop)
{
Context *This = impl_from_ITextStoreACPServices(iface);
FIXME("stub: %p %p\n", This, prop);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPServices_CreateRange(ITextStoreACPServices *iface,
LONG start, LONG end, ITfRangeACP **range)
{
Context *This = impl_from_ITextStoreACPServices(iface);
FIXME("stub: %p %d %d %p\n", This, start, end, range);
return S_OK;
}
static const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl =
{
TextStoreACPServices_QueryInterface,
TextStoreACPServices_AddRef,
TextStoreACPServices_Release,
TextStoreACPServices_Serialize,
TextStoreACPServices_Unserialize,
TextStoreACPServices_ForceLoadProperty,
TextStoreACPServices_CreateRange
};
HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
{
Context *This;
......@@ -986,6 +1062,7 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr
This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl;
This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl;
This->ITextStoreACPSink_iface.lpVtbl = &TextStoreACPSinkVtbl;
This->ITextStoreACPServices_iface.lpVtbl = &TextStoreACPServicesVtbl;
This->refCount = 1;
This->tidOwner = tidOwner;
This->connected = FALSE;
......
......@@ -226,12 +226,18 @@ static ULONG WINAPI TextStoreACP_Release(ITextStoreACP *iface)
static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface,
REFIID riid, IUnknown *punk, DWORD dwMask)
{
ITextStoreACPServices *services;
HRESULT hr;
sink_fire_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink,(LPVOID*)(&ACPSink));
hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink, (void**)&ACPSink);
ok(SUCCEEDED(hr),"Unable to QueryInterface on sink\n");
hr = ITextStoreACPSink_QueryInterface(ACPSink, &IID_ITextStoreACPServices, (void**)&services);
ok(hr == S_OK, "got 0x%08x\n", hr);
ITextStoreACPServices_Release(services);
return S_OK;
}
......
......@@ -97,6 +97,8 @@ interface ITfReadOnlyProperty;
interface IEnumTfLanguageProfiles;
interface ITfCompositionView;
interface ITfKeyEventSink;
interface ITfPersistentPropertyLoaderACP;
interface ITfRangeACP;
cpp_quote("#if 0")
typedef [uuid(4f5d560f-5ab5-4dde-8c4d-404592857ab0)] UINT_PTR HKL;
......@@ -352,6 +354,34 @@ interface ITfRangeBackup : IUnknown
[
object,
uuid(aa80e901-2021-11d2-93e0-0060b067b86e),
pointer_default(unique)
]
interface ITextStoreACPServices : IUnknown
{
HRESULT Serialize(
[in] ITfProperty *prop,
[in] ITfRange *range,
[out] TF_PERSISTENT_PROPERTY_HEADER_ACP *header,
[in] IStream *stream);
HRESULT Unserialize(
[in] ITfProperty *prop,
[in] const TF_PERSISTENT_PROPERTY_HEADER_ACP *header,
[in] IStream *stream,
[in] ITfPersistentPropertyLoaderACP *loader);
HRESULT ForceLoadProperty(
[in] ITfProperty *prop);
HRESULT CreateRange(
[in] LONG start,
[in] LONG end,
[out] ITfRangeACP **range);
}
[
object,
uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e),
pointer_default(unique)
]
......
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