The interfaces in this category allow you to be called back when certain events happen on another interface. These callbacks are generally referred to as 'event sinks'.
Interface
How to Obtain
ITfSource
QI on ITfThreadMgr, ITfContext, ITfCompartment, ITfInputProcessorProfiles, ITfDocumentMgr, or ITfLangBarItem
ITfSourceSingle
QI on ITfThreadMgr or ITfContext
TSF can call your application or text service back when certain events occur. Many event sinks are installed by a two-step process:
You will get back a cookie that you will need to pass back to ITfSource::UnadviseSink() when it's time to detach from the event source (e.g., when the host or target object is about to be destroyed, or the text service is uninitializing).
Your application or text service must implement the target interface; these interfaces are typically implemented on the main object (i.e., the object that implements either ITextStoreACP or ITfTextInputProcessor for applications or text services, respectively).
Target Interface
Hosting Interface
ITfActiveLanguageProfileNotifySink
ITfThreadMgr
ITfCompartmentEventSink
ITfCompartment
ITfContextKeyEventSink
ITfContext
ITfDisplayAttributeNotifySink
ITfEditTransactionSink
ITfKeyTraceEventSink
ITfLangBarItemSink
ITfLangBarItem
ITfLanguageProfileNotifySink
ITfInputProcessorProfiles
ITfPreservedKeyNotifySink
ITfStatusSink
ITfSystemLangBarItemSink
ITfTextEditSink
ITfTextLayoutSink
ITfThreadFocusSink
ITfThreadMgrEventSink
ITfTransitoryExtensionSink
ITfDocumentMgr
ITfUIElementSink
ITfUIElementMgr
Some event sources can only have a single sink attached. Attaching an single event sink is similar to installing a regular event sink, except that you QueryInterface() for ITfSourceSingle instead of ITfSource; one then attaches the sink by calling ITfSourceSingle::AdviseSingleSink().
ITfCleanupContextSink
ITfCleanupContextDurationSink
Some event sinks are attached by calling specific methods. The following table describes the installation method for these sinks:
Installation Method
ITfMouseSink
ITfMouseTracker::AdviseMouseSink
ITfCompositionSink
ITfContextComposition::StartComposition
ITfLangBarEventSink
ITfLangBarMgr::AdviseEventSink
ITfKeyEventSink
ITfKeystrokeMgr::AdviseKeyEventSink