flash.text.imeIIMEClient Interface for IME (input method editor) clients. Interface for IME (input method editor) clients. Components based on the flash.text.engine package must implement this interface to support editing text inline using an IME. This interface is not used with TextField objects. TextLayoutFramework (TLF) uses this interface to support inline IME, so clients using TLF do not need to implement this interface.

To support inline IME, set the imeClient property of an ImeEvent.IME_START_COMPOSITION event to an object which implements this interface.

The following terms are often used in the IME related API:

  • A conversation is the interchange between the IME and the application. During a conversation, a composition is updated one or more times and then confirmed by the user.
  • A composition identifies the text entered by the user through the IME; including associated input state information such as the selected range and the extent of any clauses.
  • A clause is a range of the composition possibly sharing semantic information, such as indicating whether the input is in a selected or converted state. A composition contains zero or more clauses.
flash.text.ime.CompositionAttributeRangeflash.events.IMEEvent.imeClienttextInput Dispatched when the user enters text.flash.events.TextEvent.TEXT_INPUTflash.events.TextEvent Dispatched when the user enters text. For IME (input method editor) clients, the receiver should insert the string contained in the event object's text property at the current insertion point. imeStartComposition Dispatched when the user begins to use an IME (input method editor).flash.events.IMEEvent.IME_START_COMPOSITIONflash.events.IMEEvent Dispatched when the user begins to use an IME (input method editor). confirmComposition Use this callback to end the inline editing session and confirm the text.textStringnull the final state of the text in the inline session (the confirmed text). preserveSelectionBooleanfalse when true, you should not reset the current selection to the end of the confirmed text. Use this callback to end the inline editing session and confirm the text. getTextBounds The IME uses this method to query the bounding box of the text currently edited with the IME client.The bounding box of the specified range of text, or null if one or both of the indexes are invalid. This method returns the same value if startIndex is greater or less than endIndex. The same value should be returned whether or not startIndex is greater or less than endIndex. flash.geom:RectanglestartIndexintAn integer that specifies the starting location of the range of text from the bounding box you are measuring. endIndexintOptional; an integer that specifies the ending location of the range of text from the bounding box you are measuring. The IME uses this method to query the bounding box of the text currently edited with the IME client. Use this method to place the candidate window and set the mouse cursor in the IME client when the mouse is over the text field or other component that supports IME. getTextInRange Gets the specified range of text from the component.The requested text, or null if no text is available in the requested range or if either or both of the indexes are invalid. The same value should be returned independant of whether startIndex is greater or less than endIndex. StringstartIndexintan integer that specifies the starting location of the range of text to be retrieved. endIndexintan integer that specifies the ending location of the range of text to be retrieved. Gets the specified range of text from the component. This method is called during IME reconversion. selectRange Sets the range of selected text in the component.anchorIndexintThe zero-based index value of the character at the anchor end of the selection activeIndexintThe zero-based index value of the character at the active end of the selection. Sets the range of selected text in the component. If either of the arguments is out of bounds the selection should not be changed. updateComposition Callback for updating the contents of the inline editing session.textString Contains the text of the inline edit session from the IME. attributes Contains an array of composition clauses with adornment info. compositionStartIndexint Start of the inline session relative to the start of the text object. compositionEndIndexint End of the inline session relative to the start of the text object. Callback for updating the contents of the inline editing session. This method is called whenever the text being edited with the IME has changed and its contents are used by the client to redraw the entire inline editing session. compositionEndIndex The zero-based character index value of the end of the current edit session text (such as all text in the inline session that is not confirmed to the document).int The zero-based character index value of the end of the current edit session text (such as all text in the inline session that is not confirmed to the document). compositionStartIndex The zero-based character index value of the start of the current edit session text (such as all text in the inline session that is not confirmed to the document).int The zero-based character index value of the start of the current edit session text (such as all text in the inline session that is not confirmed to the document). selectionActiveIndex The zero-based character index value of the last character in the current selection.int The zero-based character index value of the last character in the current selection. selectionAnchorIndex The zero-based character index value of the first character in the current selection.int The zero-based character index value of the first character in the current selection. verticalTextLayout Indicates whether the text in the component is vertical or not.Boolean Indicates whether the text in the component is vertical or not. This property directs the positioning of the candidate window (such as beside vertical text or below horizontal text).
CompositionAttributeRange The CompositionAttributeRange class represents a range of composition attributes for use with IME (input method editor) events.Object The CompositionAttributeRange class represents a range of composition attributes for use with IME (input method editor) events. For example, when editing text in the IME, the text is divided by the IME into composition ranges. These composition ranges are flagged as selected (such as currently being lengthened, shortened, or edited), and/or converted (meaning the range went through the IME dictionary lookup, already).

By convention, the client should adorn these composition ranges with underlining or highlighting according to the flags.

For example:

!converted = thick gray underline (raw text) !selected && converted = thin black underline selected && converted = thick black underline
flash.text.ime.IIMEClientCompositionAttributeRange Creates a CompositionAttributeRange object.relativeStartint The zero based index of the first character included in the character range. relativeEndint The zero based index of the last character included in the character range. selectedBoolean Defines the current composition clause as active or not. convertedBoolean Defines the current clause as processed by the IME and waiting for user confirmation. Constructor for CompositionAttributeRange objects. Creates a CompositionAttributeRange object. converted A property defining the current clause has been processed by the IME and the clause is waiting to be accepted or confirmed by the user.Boolean A property defining the current clause has been processed by the IME and the clause is waiting to be accepted or confirmed by the user. relativeEnd The position of the end of the composition clause, relative to the beginning of the inline edit session.int The position of the end of the composition clause, relative to the beginning of the inline edit session. For example, 0 equals the start of the text the IME reads (however, text might exist before that position in the edit field). relativeStart The relative start position from the beginning of the current inline editing session.int The relative start position from the beginning of the current inline editing session. For example, 0 equals the start of the text the IME reads (however, text might exist before that position in the edit field). selected A property defining the current composition clause is active and lengthened or shortened or edited with the IME while the neighboring clauses are not changing.Boolean A property defining the current composition clause is active and lengthened or shortened or edited with the IME while the neighboring clauses are not changing.