A Tour through TSF: TSF Managers

The next stop on the tour is an extended visit through the TSF manager interfaces. Since TSF implements a lot of interfaces, I decided to break them up into separate posts. 

I've also included a (very brief) description of how a text service (or application) would obtain an instance of each interface.  By default, an instance of the interface is returned by the method listed.  Some interfaces are obtained by calling QueryInterface() on the specified interface, other interfaces are passed as parameters to specified methods, and yet others are obtained by calling CoCreateInstance() with a particular CLSID.

 This post describes the 'top-level' interfaces in TSF.  You either create them directly, or you obtain them either when your application initializes TSF, or when your text service is activated.

Interface

How to Obtain

ITfCategoryMgr

CoCreateInstance(CLSID_TF_CategoryMgr)

ITfDisplayAttributeMgr

CoCreateInstance(CLSID_TF_DisplayAttributeMgr)

ITfDocumentMgr

Application:  ITfThreadMgr::CreateDocumentMgr

Text Service:             ITfThreadMgr::GetFocus

ITfThreadMgrEventSink::OnInitDocumentMgr

ITfThreadMgrEventSink::OnSetFocus

ITfThreadMgrEventSink::OnUninitDocumentMgr

ItfInputProcessorProfileMgr

QI on ITfInputProcessorProfiles

ITfInputProcessorProfiles

CoCreateInstance(CLSID_TF_InputProcessorProfiles)

ITfInputProcessorProfilesEx

QI on ITfInputProcessorProfiles

ITfInputProcessorProfileSubstituteLayout

QI on ITfInputProcessorProfiles

ITfThreadMgr

Application: CoCreateInstance(CLSID_TF_ThreadMgr)

Text Service: Passed to ITfTextInputProcessor::Activate

ITfThreadMgrEx

QI on ITfThreadMgr

ITfClientId

QI on ITfThreadMgr

ITfConfigureSystemKeystrokeFeed

QI on ITfThreadMgr

ITfKeystrokeMgr

QI on ITfThreadMgr

ITfLangBarItemMgr

QI on ITfThreadMgr

ITfMessagePump

QI on ITfThreadMgr

ITfUIElementMgr

QI on ITfThreadMgr

 

Update (7/3):  I incorrectly listed ItfInputProcessorProfileMgr as an interface that could be directly created.  Gael pointed out that this was incorrect, and I've updated the table to list the correct method.