The class TTypingConfigurationHandle provides the ChooseConfiguration function you use to determine what typing configuration to use to process text input. ChooseConfiguration has two implementations--one chooses a configuration based on a TLanguageStyle and the other chooses a configuration based on the script to which a particular set of characters belongs.
To select a configuration based on a language style:
Processing typing input
Your interactor can process typing input using the mechanism provided by the Typing framework class TTypingStore. TTypingStore is an abstract class that can be used during typing to provide a lightweight representation of the text being edited. Its main responsibility is to issue the commands that modify the text representation object for the text element.
The Text Editing framework provides concrete implementations of this class that are used by the classes derived from TTypingInteractor:
TDocumentTypingInteractor uses a TDocumentTextTypingStore to process typing input, while TSimpleTypingInteractor uses a TSimpleTextTypingStore. Both classes use TTypingCommand to perform the actual modifications to the text representation underlying the text component.
The following is a simplified version of the process used by editable text components to handle input text:
The abstract protocol for supporting an input method within a text editor is provided by the Input Method framework class TInputMethodTextPresentation. A text editor must provide an implementation of this class and pass it to the input method via the typing configuration handle.
This section describes the Text Editing framework implementation of TInputMethodTextPresentation and related classes. For a more general description of TInputMethodTextPresentation, see "Input Method framework" on page 186.
The input method presentation provides visual feedback to the end user while typing occurs by applying styles to the input text. These styles are superposed on the text; they are not really part of the text being editing. These styles can be managed by applying the styles directly to the text and then removing them before the typing interaction is completed, or by using a filter that specifies the styles to apply to the text and maintains the styles independently from the text object itself. The Text Editing framework provides classes that filter the text, as shown in this figure:
TTextInputMethodTextPresentation implements the abstract protocol in TInputMethodTextPresentation, using the text component's typing interactor to handle typing input and using the component's view to access text selections and manage the styles on text input with an input method.
TTextView uses these classes to manage text while it is being processed by an input method:
Supporting input methods
In addition to using the typing configuration to process text input, your text editing applications need to provide support for using input methods. The typing configuration provides the conversion from non-ideographic characters to ideographic characters; the text editor's typing interaction mechanism provides the means for presenting text as it is being converted and for allowing the end user to adjust the converted text.
Functions that access the text delegate to the underlying text instance, and then return a text instance with the filter styles attached as if they were really applied to the text.
NOTE
TFilteredText provides read-only access to the underlying text.
See "Input Method framework" on page 186 for more information on TInputMethodTextPresentation and on input methods in general.