Interface IIMClient
interface IIMClient
Extends com.amazon.apmf.IStandard
Provides callbacks to receive the editing requests and callbacks made by the keyboard service.
Methods
setComposingText()
Sets the style for the specified composing text. Typically, the editor renders the text with an underline style. The new composing text overwrites any existing composing text.voidsetComposingText(stringtext)
Parameters
text
string — Required
The composing text.
setAttributedComposingText()
Sets the specified attribues for the composing text. The editor then renders the text with attributes. The new composing text overwrite any existing composing text if any.voidsetAttributedComposingText(IAttributedText*attrText)
Parameters
attrText
IAttributedText* — Required
Composing text with attributes.
commitText()
Commits the specified text to the text editor. The commit text will dismiss the composing text if any, and commit the string into text editor.voidcommitText(stringtext)
Parameters
text
string — Required
The commit text
setComposingRegion()
Sets the composing region to the specified range. Setting the range commits the existing composing text and sets a new composing text with the specified range.voidsetComposingRegion(i32bytesBefore,i32bytesAfter)
Parameters
bytesBefore
i32 — Required
The number of bytes of text before the cursor.
bytesAfter
i32 — Required
The number bytes of text after the cursor.
finishComposingText()
void finishComposingText()
Commits the current composing text.
getSurroundingText()
Gets the text before and after the cursor to use for contextual word prediction. The text editor only returns as much surrounding text as is necessary to complete the predicion up to the maxium amount of text specified. This is typically a paragraph of text. Note that the editor might not have contextual capability or might return empty surrounding text.SurroundingText*getSurroundingText(i32maxBytesBefore,i32maxBytesAfter)
Parameters
maxBytesBefore
i32 — Required
The maximum length of text, in bytes, before cursor (typically 1K).
maxBytesAfter
i32 — Required
The maximum length of text, in bytes, after cursor (typically 1K).
Returns
SurroundingText*
An instance of SurroundingText.
deleteSurroundingText()
Deletes the specified amount of text before and after the cursor.voiddeleteSurroundingText(i32bytesBefore,i32bytesAfter)
Parameters
bytesBefore
i32 — Required
The length of text, in bytes, before cursor.
bytesAfter
i32 — Required
The length of text, in bytes, after cursor.
setSelection()
Sets the selection to the specified range. If the range is zero-length, it removes any existing selection and sets the cursor to the positions specified byvoidsetSelection(i32bytesSelStart,i32bytesSelEnd)
bytesSelStart and bytesSelEnd.
Parameters
bytesSelStart
i32 — Required
The start position of the selection.
bytesSelEnd
i32 — Required
The end position of the selection.
performEditorAction()
Perform the the specified editor action. Typically, you will pass the value of the inputAction field in your EditorInfo instance. The keyboard service might also define a private action code which has been agreed upon between the client app and keyboard, and might use this method for certain input interactions.voidperformEditorAction(InputActionaction)
Parameters
action
InputAction — Required
The action to perform in the client app editor.

