Interface ITextInputControllerDelegate
interface ITextInputControllerDelegate
Extends com.amazon.apmf.IStandard
This interface defines a set of delegate functions that can be used with the ITextInputController interface.
By implementing this interface and providing it to the IKeyboardManager, the client can achieve delegated functionality
for text input operations. The delegate functions allow for customization and extension of the text input behavior,
enabling the client to handle various aspects of text editing, such as setting and retrieving attributed text,
inserting and removing text, managing text selection, and responding to keyboard events.
Methods
setAttributedText()
Sets the attributed text of thevoidsetAttributedText(com.amazon.kepler.uitoolkit.graphics.IAttributedText*attributedText,IKeyboardManager*keyboardManager)
ITextInputController.
Parameters
attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required
Pointer to IAttributedText object to set the text of ITextInputController.
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
getAttributedText()
Returns the current attributed text displayed on thecom.amazon.kepler.uitoolkit.graphics.IAttributedText*getAttributedText(IKeyboardManager*keyboardManager)
ITextInputController.
Parameters
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
Returns
com.amazon.kepler.uitoolkit.graphics.IAttributedText*
Pointer to IAttributedText object of the ITextInputController.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
insert()
Inserts text into the current position.voidinsert(com.amazon.kepler.uitoolkit.graphics.IAttributedText*attributedText,IKeyboardManager*keyboardManager)
Parameters
attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required
Pointer to IAttributedText object to set the text of ITextInputController.
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
remove()
Removes the selected characters, otherwise if no characters are selected remove one character next or previous depending on the input parameter.voidremove(boolnextCharacter,IKeyboardManager*keyboardManager)
Parameters
nextCharacter
bool — Required
If false, then remove the previous character of the current position, otherwise remove the next character.
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
replace()
Replaces the selected characters if selected, otherwise replaces the entire text ofvoidreplace(com.amazon.kepler.uitoolkit.graphics.IAttributedText*attributedText,IKeyboardManager*keyboardManager)
ITextInputController with the new attributed text.
Parameters
attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required
Pointer to IAttributedText object to replace the old text of ITextInputController.
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
isSecure()
Returns true if theboolisSecure(IKeyboardManager*keyboardManager)
ITextInputController text is secure.
Parameters
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
Returns
bool
bool true if the text is secure, else false.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
invalidate()
Invalidates the current state ofvoidinvalidate(IKeyboardManager*keyboardManager)
ITextInputController to trigger a repaint.
Parameters
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
begin()
Returns the starting position of the current selection.u32begin(IKeyboardManager*keyboardManager)
Parameters
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
Returns
u32
Begin of the current selection.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
end()
Returns the ending position of the current selection.u32end(IKeyboardManager*keyboardManager)
Parameters
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
Returns
u32
End of the current selection.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
setPosition()
Sets the position and an empty selection.voidsetPosition(u32position,IKeyboardManager*keyboardManager)
Parameters
position
u32 — Required
New position.
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
getPosition()
Gets the position and an empty selection.u32getPosition(IKeyboardManager*keyboardManager)
Parameters
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
Returns
u32
Current position of the cursor.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.
setSelection()
Sets the text selection bounds using the start and end indices. The default selection is 0,0. It is like text highlighting.voidsetSelection(u32start,u32end,IKeyboardManager*keyboardManager)
Parameters
start
u32 — Required
Index to start the selection from.
end
u32 — Required
Index to stop the selection at.
keyboardManager
IKeyboardManager* — Required
Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.
To acquire the instance of ITextInputController, developers will need
to query this interface using tryQueryInterface on IKeyboardManager instance.

