ITfInputScope interface (inputscope.h)
The ITfInputScope interface is used by the text input processors to get the InputScope value that represents a document context associated with a window. The input scope provides rules to help speech and handwriting recognition. For instance, if a text box on a form is used to enter an address, the input scope for that text box can be set to recognize and accept only those characters that are valid for an address.
The interface ID is IID_ITfInputScope.
The document context is used by the speech and handwriting recognition engine and is set by a text input processor by calling the SetInputScope method. A TSF-aware application does not call SetInputScope directly, but rather implements either ITextStoreACP or ITfContextOwner to get a pointer to ITfInputScope.
To get the pointer to the ITfInputScope interface, the text input processor or TSF-aware application calls ITfContext::GetAppProperty, passing in GUID_PROP_INPUTSCOPE and a pointer to the ITFReadOnlyProperty interface, as in the following example.
extern const GUID GUID_PROP_INPUTSCOPE;
//
// The TIP can call this to get the input scope of the document mgr.
//
HRESULT GetInputScope(ITfContext *pic, ITfRange *pRange, TfEditCookie ec, ITfInutScope **ppiscope){
ITFReadOnlyProperty *prop;
HRESULT hr;
If (SUCCEEDED(hr = pic->GetAppProperty(GUID_PROP_INPUTSCOPE, &prop))
{ VARIANT var;
If (SUCCEEDED(hr = prop->GetValue(ec, pRange, &var)))
{ hr = var.punkVal->QueryInterface(IID_ITfInputScope, (void **)ppiscope);
}
prop->Release();
}
return hr
}
Inheritance
The ITfInputScope interface inherits from the IUnknown interface. ITfInputScope also has these types of members:
Methods
The ITfInputScope interface has these methods.
ITfInputScope::GetInputScopes ITfInputScope::GetInputScopes method |
ITfInputScope::GetPhrase ITfInputScope::GetPhrase method |
ITfInputScope::GetRegularExpression ITfInputScope::GetRegularExpression method |
ITfInputScope::GetSRGS ITfInputScope::GetSRGS method |
ITfInputScope::GetXML ITfInputScope::GetXML method |
Remarks
To use this interface with window-less controls, an application has two options.
- Make the application TSF-aware: A TSF-aware application must implement either ITextStoreACP or ITfContextOwner to get a pointer to ITfInputScope.
- SetInputScopes This is not recommended, but if the application is not TSF-aware, there is no other way to maintain the association between the input scope and the application. In this case, the application must call SetInputScopes whenever focus changes among window-less controls.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2003 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | inputscope.h |