Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::TextInputManipulator Class Reference

The text input manipulator handles key gestures used with TextBox nodes to move the cursor, select text, and delete text, and provides the basics of text editing capabilities in Kanzi. More...

#include <kanzi/core.ui/input/text_input_manipulator.hpp>

Inheritance diagram for kanzi::TextInputManipulator:
[legend]

Classes

class  CursorMovedMessageArguments
 Message arguments used by the CursorMovedMessage. More...
 
class  InputMethodActionMessageArguments
 Message argument used by the InputMethodActionMessage. More...
 
class  InputMethodAvailableChangedMessageArguments
 Message argument used by the InputMethodAvailableChangedMessage. More...
 
class  InputMethodsDisconnectedMessageArguments
 Message argument used by the InputMethodsDisconnectedMessage. More...
 
class  InputTypeChangedMessageArguments
 Message argument used by the InputTypeChangedMessage. More...
 
class  ReadOnlyStateChangedMessageArguments
 Message argument used by the ReadOnlyStateChangedMessage. More...
 
class  SelectionChangedMessageArguments
 Message arguments used by the SelectionChangedMessage. More...
 
class  TextChangedMessageArguments
 Message argument used by the TextChangedMessage. More...
 
class  TextCompositionStateMessageArguments
 Message argument used by the CompositionTextChangedMessage, CompositionTextCommittedMessage and TextCompositionCanceledMessage. More...
 

Public Types

enum  SelectionState { SelectionState::NoSelection, SelectionState::Started, SelectionState::Updated, SelectionState::Cleared }
 States of text selection. More...
 
- Public Types inherited from kanzi::InputManipulator
enum  EventRoutingMode { RoutingBubbling, RoutingTunneling }
 Enumeration for the available input event routing modes. More...
 
enum  ManipulatorType { ManipulatorType::TouchInputHandler, ManipulatorType::KeyInputHandler }
 Enumeration for the input manipulator type. More...
 
enum  State {
  StateReady, StatePossible, StateBegin, StateChange,
  StateEnd, StateFail, StateDelayed, StateCanceled
}
 Enumeration for possible input manipulator states during touch, mouse, or key input sequence. More...
 
using TouchEventRoutingMode = EventRoutingMode
 Enumeration for the available touch event routing modes. More...
 
using TouchPointsConstIterator = TouchPointsContainer::const_iterator
 
using TouchPointsContainer = vector< TouchPoint * >
 
- Public Types inherited from kanzi::PropertyObject
typedef PropertyStorageContainer::const_iterator PropertyStorageConstIterator
 
typedef vector< PropertyStoragePtrPropertyStorageContainer
 
typedef PropertyStorageContainer::iterator PropertyStorageIterator
 
typedef intrusive_ptr< AbstractPropertyTypeDescriptor::PropertyStoragePropertyStoragePtr
 
typedef PropertyStorageContainer::reverse_iterator PropertyStorageReverseIterator
 

Public Member Functions

void activateInput ()
 Activates the input on an input manipulator. More...
 
void deactivateInput ()
 Deactivates the input on an input manipulator. More...
 
void ensureInputMethodsAvailable ()
 Ensures that the connected input methods are available. More...
 
TextKeyNavigationDirection getTextKeyNavigationDirection () const
 Returns the direction of key navigation. More...
 
void setEchoMode (EchoMode echoMode)
 Sets the echo mode to use to format the display text of the text buffer of the input manipulator. More...
 
void setInputLayout (TextInputLayout &layout)
 
void setInputMethodAction (InputMethodAction action)
 Sets the input method action of the text input methods. More...
 
void setInputType (InputType inputType)
 Sets the input type of the input methods. More...
 
void setPasswordMaskingCharacter (string_view passwordMask)
 Sets the password masking character of the text buffer of the input manipulator. More...
 
void setReadOnly (bool readOnly)
 Sets whether the user input can modify the text of a TextInputManipulator. More...
 
void setTextKeyNavigationDirection (TextKeyNavigationDirection direction)
 Sets the direction of key navigation. More...
 
Content handling
size_t getMaximumTextLength () const
 Returns the maximum text buffer length constraint. More...
 
void setMaximumTextLength (size_t maxLength)
 Sets the maximum text length constraint. More...
 
void setText (string_view text)
 Sets the UTF-8 text. More...
 
void insertText (size_t position, string_view text)
 Moves the cursor to a given position and inserts text to that position. More...
 
void deleteText (size_t begin, size_t end)
 Moves the cursor to position begin and erases from a text buffer UTF-8 characters between positions begin and end. More...
 
void deleteAtCursor ()
 Deletes a character using delete. More...
 
void backspaceAtCursor ()
 Deletes a character using backspace. More...
 
void deleteWordAtCursor ()
 Deletes the characters between the cursor position and the word boundary that follows the cursor. More...
 
void backspaceWordAtCursor ()
 Deletes the characters between the cursor position and the closest word boundary using backspace. More...
 
Cursor positioning
size_t getCursorPosition () const
 Returns the position of the cursor. More...
 
void setCursorPosition (size_t position)
 Sets the position of the cursor in the text buffer of a TextInputConcept. More...
 
void moveCursorForward (size_t characterCount)
 Moves the cursor forward by a given number of characters in the text buffer of a TextInputConcept. More...
 
void moveCursorForward ()
 Moves the cursor forward by one character. More...
 
void moveCursorBackward (size_t characterCount)
 Moves the cursor backward by a given number of characters in the text buffer of a TextInputConcept. More...
 
void moveCursorBackward ()
 Moves the cursor backward by one character. More...
 
void moveCursorToEnd ()
 Moves the cursor to the end of the text buffer of a TextInputConcept. More...
 
void moveCursorHome ()
 Moves the cursor to the beginning of the text buffer of a TextInputConcept. More...
 
void moveCursorToNextWord ()
 Moves the cursor to the next word. More...
 
void moveCursorToPreviousWord ()
 Moves the cursor to the previous word. More...
 
Text selection
bool hasSelection () const
 Checks whether any text is selected. More...
 
void selectText (size_t start, size_t end)
 Selects the text between the given start and end positions. More...
 
size_t getSelectionStart () const
 Returns the starting point of the selected text. More...
 
void setSelectionStart (size_t position)
 Sets the start of the text selection at the position given as argument. More...
 
size_t getSelectionEnd () const
 Returns the ending point of the selected text. More...
 
void setSelectionEnd (size_t position)
 Sets the end of the text selection at the position given as argument. More...
 
void clearSelection ()
 Clears the text selection. More...
 
void selectAll ()
 Selects all content in a Text Box node. More...
 
void moveSelectionStartForward (size_t characterCount)
 Moves the start of text selection forward by a given characterCount in the text buffer of a Text Box node. More...
 
void moveSelectionStartBackward (size_t characterCount)
 Moves the end of text selection a given characterCount backward in the text buffer of a Text Box node. More...
 
void moveSelectionEndForward (size_t characterCount)
 Moves the end of text selection a given characterCount forward in the text buffer of a Text Box node. More...
 
void moveSelectionEndBackward (size_t characterCount)
 Moves the end of text selection a given characterCount backward in the text buffer of a Text Box node. More...
 
void moveSelectionStartForward ()
 Moves the start of the text selection forward by one character. More...
 
void moveSelectionStartBackward ()
 Moves the start of the text selection backward by one character. More...
 
void moveSelectionEndForward ()
 Moves the end of the text selection forward by one character. More...
 
void moveSelectionEndBackward ()
 Moves the end of the text selection backward by one character. More...
 
void moveSelectionStartToNextWord ()
 Moves the start of the text selection forward to the next word. More...
 
void moveSelectionStartToPreviousWord ()
 Moves the start of the text selection backward to the previous word. More...
 
void moveSelectionEndToNextWord ()
 Moves the end of the text selection forward to the next word. More...
 
void moveSelectionEndToPreviousWord ()
 Moves the end of the text selection backward to the previous word. More...
 
Automatic manipulation of the endpoint of text selection

Kanzi provides text selection methods that automatically choose the text selection endpoint to update.

When you select text in a Text Box node by double-tapping or by calling the selectText() or selectTextAtCursor() methods, the active selection endpoint is set to the selection end position. When you modify the selection using the methods listed below, the selection end position changes. When you modify the selection end position, and that passes over the selection start position, Kanzi makes the selection start position the active selection endpoint. Kanzi continues to update the selection start position until the selection start position passes over the selection end position, at which point Kanzi makes the active selection endpoint the selection end position.

void moveSelectionEndpointBackward (size_t steps)
 Moves the endpoint of the active text selection backward with steps passed as argument. More...
 
void moveSelectionEndpointBackward ()
 Overload of moveSelectionEndpointBackward(), moves the endpoint of the active text selection one step backward. More...
 
void moveSelectionEndpointForward (size_t steps)
 Moves the endpoint of the active text selection forward by steps passed as argument. More...
 
void moveSelectionEndpointForward ()
 Overload of moveSelectionEndpointForward(), moves the endpoint of the active text selection one step forward. More...
 
void moveSelectionEndpointToPreviousWord ()
 Moves the endpoint of the active text selection backward to the previous word boundary. More...
 
void moveSelectionEndpointToNextWord ()
 Moves the endpoint of the active text selection forward to the previous word boundary. More...
 
void moveSelectionEndpointToFront ()
 Moves the active selection end-point to the beginning of the text string. More...
 
void moveSelectionEndpointToBack ()
 Moves the endpoint of the active text selection to the end of the text string. More...
 
- Public Member Functions inherited from kanzi::InputManipulator
void attach (Node &node)
 Attaches an input manipulator to a node. More...
 
void cancel ()
 Notify manipulator of touch canceling. More...
 
void detach ()
 Detaches an input manipulator. More...
 
NodegetAttachedNode () const
 Gets the node to which the input manipulator is attached. More...
 
InputManipulatorgetDependantManipulator () const
 Gets the dependant input manipulator. More...
 
EventRoutingMode getEventRoutingMode ()
 Returns the current input event routing mode. More...
 
InputManipulatorWeakPtr getFailManipulator () const
 Gets the fail manipulator. More...
 
State getState () const
 Get the state of an input manipulator. More...
 
KZ_DEPRECATED TouchEventRoutingMode getTouchEventRoutingMode ()
 Returns the current touch event routing mode. More...
 
ManipulatorType getType () const
 Returns the type of the input manipulator. More...
 
bool isActive () const
 Checks whether an input manipulator is in active state. More...
 
bool isAttached () const
 Tells whether the input manipulator is attached to a node. More...
 
bool isCancelable () const
 Returns whether an input manipulator is in a cancelable state. More...
 
bool isResettable () const
 Returns whether an input manipulator is in a resettable state. More...
 
void requireToFail (InputManipulatorWeakPtr manipulatorToFail)
 Sets the input manipulator that must fail before Kanzi can recognize this input manipulator. More...
 
void reset ()
 Reset the manipulator. More...
 
void setEventRoutingMode (EventRoutingMode mode)
 Sets the input event routing mode that you want the input manager to use when distributing the input event data to manipulators. More...
 
void setReferenceNode (NodeWeakPtr referenceNode)
 Override the attached node as the hit test reference node. More...
 
void setState (State state)
 Set the state of an input manipulator. More...
 
KZ_DEPRECATED void setTouchEventRoutingMode (TouchEventRoutingMode mode)
 Sets the touch event routing mode that you want the input manager to use when distributing the touch points to input manipulators. More...
 
 ~InputManipulator () override
 Destructor. More...
 
- Public Member Functions inherited from kanzi::Object
AppliedStyleEntrySharedPtr applyObjectStyle (kanzi::StyleSharedPtr style)
 Applies a style to an object. More...
 
void applyObjectStyles ()
 Apply all styles for an object node. More...
 
DomaingetDomain () const
 Returns the domain the object belongs to. More...
 
const MetaclassgetDynamicMetaclass () const override
 Returns the metaclass of the dynamic type of the object. More...
 
MainLoopSchedulergetMainLoopScheduler () const
 Returns the MainLoopScheduler instance of the associated Domain. More...
 
detail::MessageDispatcher * getMessageDispatcher () const
 Returns the message dispatcher of the object. More...
 
ResourceManagergetResourceManager () const
 Returns the resource manager of the object. More...
 
ScriptingContextSharedPtr getScriptingContext () const
 Gets the scripting context of the object. More...
 
 Object (Domain *domain)
 
void setScriptingContext (ScriptingContextSharedPtr context)
 Sets the scripting context of the object. More...
 
void unapplyObjectStyle (AppliedStyleEntrySharedPtr appliedStyleEntry)
 
void unapplyObjectStyles ()
 Unapplies and removes all applied styles. More...
 
 ~Object () override
 
- Public Member Functions inherited from kanzi::MetaObject
bool isTypeOf (const Metaclass *objectType) const
 Determines if the type of this object is the given type or derived from it. More...
 
virtual ~MetaObject ()
 
- Public Member Functions inherited from kanzi::PropertyObject
template<typename DataType >
void addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 
template<typename DataType >
void addPropertyModifierWithoutNotifyingHandlers (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 Adds a property modifier without notifying handlers. More...
 
template<typename DataType >
void addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner)
 
template<typename DataType >
void addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *ownerPointer)
 
template<typename DataType >
void addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, AbstractPropertyTypeDescriptor::ValueSourceOwner *owner)
 
PropertyStorageContainer::iterator beginPropertyStorage ()
 Returns the begin iterator to the internal property storage container. More...
 
PropertyStorageContainer::const_iterator beginPropertyStorage () const
 Returns the begin iterator to the internal property storage container. More...
 
void clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag)
 
void copyLocalValue (const PropertyObject &other, AbstractPropertyType propertyType)
 Copies local value of single property from another object. More...
 
void copyLocalValues (const PropertyObject &other)
 Copies all local values from another object. More...
 
PropertyStorageContainer::iterator endPropertyStorage ()
 Returns the end iterator to the internal property storage container. More...
 
PropertyStorageContainer::const_iterator endPropertyStorage () const
 Returns the end iterator to the internal property storage container. More...
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getAbstractPropertyBase (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalProperty (const PropertyType< DataType > &propertyType) const
 Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More...
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalPropertyBase (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value. More...
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getProperty (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property type. More...
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getPropertyBase (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property disregarding modifiers. More...
 
template<typename DataType >
size_t getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType) const
 Gets number of current notification handlers for given property type. More...
 
bool hasBaseValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value, disregarding modifiers. More...
 
bool hasLocalValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a local value set for the property. More...
 
bool hasNonClassValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a value of any precedence higher than class default value set for the property. More...
 
bool hasValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value. More...
 
bool isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const
 
virtual void onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason)
 Virtual function to handle property change notifications. More...
 
 PropertyObject ()
 
void removeKzbProperties (flat_set< AbstractPropertyType > *keepProperties)
 Remove all KZB properties that are not included in a given set. More...
 
void removeKzbProperties ()
 Remove all KZB properties. More...
 
template<typename DataType >
void removeLocalPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *ownerPointer)
 
void removeLocalValue (AbstractPropertyType propertyType)
 Removes the local value associated with the property. More...
 
template<typename DataType >
void removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 
template<typename DataType >
void removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner)
 
template<typename DataType >
void removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *ownerPointer)
 
template<typename DataType >
void setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value)
 
template<typename DataType >
void setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value)
 Sets the local value of a property type. More...
 
void setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag)
 
KZ_DEPRECATED void validatePropertyModifiers (AbstractPropertyType propertyType)
 Validates property modifiers and notifies handlers. More...
 
void validatePropertyModifiersAndNotifyHandlers (AbstractPropertyType propertyType)
 Validates property modifiers and notifies handlers. More...
 
virtual ~PropertyObject ()
 
- Public Member Functions inherited from kanzi::InputMethodListener
void cancelTextComposition ()
 Tells the input method, which provides the text composition, to cancel the text composition. More...
 
void commitCompositionText ()
 Commits the composition text. More...
 
bool isComposingText () const
 Returns the text composition state of the input method listener. More...
 
bool isInputMethodAvailable (InputMethod &source) const
 Returns whether the input method is available. More...
 
void onCompositionTextCommitted (InputMethod &source)
 The input method source tells the input method listener to add the composition text received by previous calls of onCompositionTextUpdated() into the cached text. More...
 
void onCompositionTextUpdated (InputMethod &source, string_view text)
 The input method source tells the input method listener to update the composition text. More...
 
void onCursorMoved (InputMethod &source, size_t position)
 The input method source tells the input method listener to update the cursor position. More...
 
void onExecuteInputMethodAction (InputMethod &source)
 The input method source tells the input method listener to execute the input method action. More...
 
void onInputMethodAvailable (InputMethod &source, bool available)
 The input method source informs its active input method listener about the available state. More...
 
bool onInputMethodDisconnected (InputMethod &source)
 The input method source tells its active input method listener that it disconnected itself from the input method listener. More...
 
void onInputTypeChanged (InputMethod &source, InputType inputType)
 The input method source tells the input method listener to update its input type. More...
 
void onSelectionChanged (InputMethod &source, size_t start, size_t end)
 The input method source tells the input method listener to update the cursor positions at the start and end of the text selection. More...
 
void onTextAdded (InputMethod &source, size_t position, string_view text)
 The input method source tells the input method listener to add a text to its cached text. More...
 
void onTextChanged (InputMethod &source, string_view text)
 The input method source tells the input method listener to replace its cached text with the content passed in the text argument. More...
 
void onTextCompositionCanceled (InputMethod &source)
 The input method source tells the input method listener to cancel the text composition, and remove the composition text from the content. More...
 
void onTextCompositionStarted (InputMethod &source)
 The input method source tells the input method listener to enter the text composition state at the current cursor position. More...
 
void onTextDeleted (InputMethod &source, size_t start, size_t end)
 The input method source tells the input method listener to remove the text between the start and end positions. More...
 
virtual ~InputMethodListener ()
 Destructor. More...
 
const TextEditBuffergetText () const
 Returns the text buffer that holds edited UTF-8 content. More...
 
InputType getInputType () const
 Returns the input type used by the text input methods. More...
 
InputMethodAction getInputMethodAction () const
 Returns the input method action of the text input methods. More...
 
bool isReadOnly () const
 Returns whether the text of the TextEditBuffer of an InputMethodListener is unaffected by user input. More...
 

Static Public Member Functions

static TextInputManipulatorSharedPtr create (Domain *domain, string_view name="")
 Creates a TextInputManipulator instance. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::Object
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Default implementation that returns empty editor info. More...
 
- Static Public Member Functions inherited from kanzi::MetaObject
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Default implementation that returns empty editor info. More...
 

Static Public Attributes

Messages
static MessageType< TextChangedMessageArgumentsTextChangedMessage
 Kanzi dispatches this message to the attached node when the user changes the text content by adding or removing characters, when committing the IME composition text, or when the entire text is replaced. More...
 
static MessageType< CursorMovedMessageArgumentsCursorMovedMessage
 Kanzi dispatches this message to the attached node when the user changes the cursor position by navigating with the arrow keys. More...
 
static MessageType< SelectionChangedMessageArgumentsSelectionChangedMessage
 Kanzi dispatches this message to the attached node when the user changes the text selection by navigating with the arrow keys. More...
 
static MessageType< ReadOnlyStateChangedMessageArgumentsReadOnlyStateChangedMessage
 Kanzi dispatches this message to the attached node when the user changes the read-only state. More...
 
static MessageType< InputTypeChangedMessageArgumentsInputTypeChangedMessage
 Kanzi dispatches this message to the attached node when the input method updates the input type. More...
 
static MessageType< InputMethodActionMessageArgumentsInputMethodActionMessage
 Kanzi dispatches this message to the attached node when the input action event is handled. More...
 
static MessageType< TextCompositionStateMessageArgumentsCompositionTextChangedMessage
 Kanzi dispatches this message to the attached node when the input method updates the composition text. More...
 
static MessageType< TextCompositionStateMessageArgumentsCompositionTextCommittedMessage
 Kanzi dispatches this message to the attached node when the input method commits the composition text. More...
 
static MessageType< TextCompositionStateMessageArgumentsTextCompositionCanceledMessage
 Kanzi dispatches this message to the attached node when the input method cancels the text composition. More...
 
static MessageType< InputMethodsDisconnectedMessageArgumentsInputMethodsDisconnectedMessage
 Kanzi dispatches this message to the attached node when the input methods of the input manipulator are disconnected. More...
 
static MessageType< InputMethodAvailableChangedMessageArgumentsInputMethodAvailableChangedMessage
 Kanzi dispatches this message to the attached node when the availability of an input method of the input manipulator changes. More...
 

Protected Member Functions

void handleControlLeftArrowGesture ()
 Handles the Control + Left Arrow key gesture. More...
 
void handleControlRightArrowGesture ()
 Handles the Control + Right Arrow key gesture. More...
 
void handleLeftArrowGesture ()
 Handles the Left Arrow key gesture. More...
 
void handleRightArrowGesture ()
 Handles the Right Arrow key gesture. More...
 
void handleShiftControlLeftArrowGesture ()
 Handles the Shift + Control + Left Arrow key gesture. More...
 
void handleShiftControlRightArrowGesture ()
 Handles the Shift + Control + Right Arrow key gesture. More...
 
void handleShiftLeftArrowGesture ()
 Handles the Shift + Left Arrow key gesture. More...
 
void handleShiftRightArrowGesture ()
 Handles the Shift + Right Arrow key gesture. More...
 
bool moveCursorTo (size_t position)
 Moves the cursor to the position given as argument. More...
 
void notifyCursorMoved ()
 Dispatches a CursorMovedMessage to the attached node. More...
 
void notifyInputTypeChanged ()
 Dispatches an InputTypeChangedMessage to the attached node. More...
 
bool notifyKeyInput (const KeyEvent &event) override
 Overrides InputManipulator::notifyKeyInput(). More...
 
void notifyReadOnlyStateChanged ()
 Dispatches a ReadOnlyStateChangedMessage to the attached node. More...
 
void notifySelectionChanged ()
 Dispatches a SelectionChangedMessage to the attached node. More...
 
void notifyTextChanged ()
 Dispatches a TextChangedMessage to the attached node. More...
 
void onCancel () override
 Overrides InputManipulator::onCancel(). More...
 
bool onCompositionTextCommittedOverride (InputMethod &source) override
 Overrides InputMethodListener::onCompositionTextCommittedOverride. More...
 
bool onCompositionTextUpdatedOverride (InputMethod &source, string_view text) override
 Overrides InputMethodListener::onCompositionTextUpdatedOverride. More...
 
bool onCursorMovedOverride (InputMethod &source, size_t position) override
 Overrides InputMethodListener::onCursorMovedOverride. More...
 
void onExecuteInputMethodActionOverride (InputMethod &) override
 Overrides InputMethodListener::onExecuteInputMethodActionOverride. More...
 
void onInputMethodAvailableOverride (InputMethod &source, bool available) override
 Overrides InputMethodListener::onInputMethodAvailableOverride. More...
 
bool onInputMethodDisconnectedOverride (InputMethod &source) override
 Overrides InputMethodListener::onInputMethodDisconnectedOverride. More...
 
void onInputTypeChangedOverride (InputMethod &source, InputType inputType) override
 Overrides InputMethodListener::onInputTypeChangedOverride. More...
 
void onKeyPressGesture (KeyGestureInfo &) override
 Overrides InputManipulator::onKeyPressGesture(). More...
 
void onKeyReleaseGesture (KeyGestureInfo &) override
 Overrides InputManipulator::onKeyPressGesture(). More...
 
void onPartialKeyPressGesture (KeyGestureInfo &) override
 Overrides InputManipulator::onPartialKeyPressGesture(). More...
 
void onReset () override
 Overrides InputManipulator::onReset(). More...
 
bool onSelectionChangedOverride (InputMethod &source, size_t start, size_t end) override
 Overrides InputMethodListener::onSelectionChanged. More...
 
bool onTextAddedOverride (InputMethod &source, size_t position, string_view text) override
 Overrides InputMethodListener::onTextAddedOverride. More...
 
bool onTextChangedOverride (InputMethod &source, string_view text) override
 Overrides InputMethodListener::onTextChangedOverride. More...
 
void onTextCompositionCanceledOverride (InputMethod &source) override
 Overrides InputMethodListener::onTextCompositionCanceledOverride. More...
 
bool onTextCompositionStartedOverride (InputMethod &source) override
 Overrides InputMethodListener::onTextCompositionStartedOverride. More...
 
bool onTextDeletedOverride (InputMethod &source, size_t start, size_t end) override
 Overrides InputMethodListener::onTextDeletedOverride. More...
 
 TextInputManipulator (Domain *domain)
 Constructor. More...
 
void updateSelectionState ()
 Updates the state of text selection. More...
 
- Protected Member Functions inherited from kanzi::InputManipulator
void addHitTestArguments (MessageArguments &message, const TouchPoint &touchPoint)
 Add hit test information arguments to the message from the touch point. More...
 
bool detectKeyGesture (const KeyEvent &event, KeyGestureInfo &gesture)
 Detects key gestures from the event that you pass as an argument. More...
 
Node2DfindNearestParent2D ()
 Find the 2D manipulator node for this input manipulator. More...
 
InputManagergetInputManager () const
 Get the attached input manager of an input manipulator. More...
 
 InputManipulator (Domain *domain, ManipulatorType type=ManipulatorType::TouchInputHandler)
 Constructor. More...
 
virtual bool isCancelableOverride () const
 Overridable check for the cancelable status of an input manipulator. More...
 
virtual bool isResettableOverride () const
 Overridable check for the resettable status of an input manipulator. More...
 
void markTouchPointConsumed (const TouchPoint &touchPoint)
 Marks the passed touch point handled. More...
 
virtual void notifyTouchInside (const TouchInfo &touchInfo)
 Notify an input manipulator about touch events that occur inside the subtree of the input manipulator. More...
 
virtual void notifyTouchOutside (const TouchInfo &touchInfo)
 Notify an input manipulator about touch events that occur outside the subtree of the input manipulator. More...
 
virtual void onAttach ()
 Attach function for input manipulators. More...
 
virtual void onDetach ()
 Detach function for input manipulators. More...
 
virtual void onFail ()
 Fail function for input manipulators. More...
 
- Protected Member Functions inherited from kanzi::Object
void initialize ()
 
void onCopy (const Object &other)
 
- Protected Member Functions inherited from kanzi::MetaObject
void initialize ()
 
 MetaObject ()
 
- Protected Member Functions inherited from kanzi::PropertyObject
AbstractPropertyTypeDescriptor::ValueSourceEntryacquireLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor, PropertyStoragePtr &propertyStorage)
 Acquires a local value source entry that is free for the assignment of a value. More...
 
AbstractPropertyTypeDescriptor::ModifierStorageacquireModifierStorage (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 
AbstractPropertyTypeDescriptor::NotificationStorageacquireNotificationStorage (AbstractPropertyTypeDescriptor &descriptor)
 
PropertyStoragePtr acquirePropertyStorage (AbstractPropertyTypeDescriptor &descriptor)
 
template<typename DataType >
void addPropertyModifierBase (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner, bool notify)
 Adds a property modifier entry to the property modifier stack and validates them. More...
 
void addPropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, PropertyValuePrecedence precedence, void *ownerPointer)
 Internally adds a property value source. More...
 
void addPropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, PropertyValuePrecedence precedence, AbstractPropertyTypeDescriptor::ValueSourceOwner *owner)
 Internally adds a property value source. More...
 
AbstractPropertyTypeDescriptor::ValueSourceEntryconstructLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 
PropertyStoragePtr constructPropertyStorage (AbstractPropertyTypeDescriptor &descriptor)
 
void copyLocalValue (const AbstractPropertyTypeDescriptor::PropertyStorage &otherPropertyStorage)
 Copy local value from property storage. More...
 
AbstractPropertyTypeDescriptor::ModifierStoragefindModifierStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::NotificationStoragefindNotificationStorage (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::PropertyStoragefindPropertyStorage (AbstractPropertyTypeDescriptor &descriptor) const
 Gets the property storage for given property type descriptor. More...
 
PropertyStoragePtr findPropertyStoragePtr (AbstractPropertyTypeDescriptor &descriptor) const
 Gets property storage intrusive pointer which you can use to hold a reference until the end of the operation. More...
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByNameAndDataType (string_view name, PropertyDataType dataType) const
 Finds a property type descriptor by name and data type. More...
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByQualifiedNameAndDataType (string_view qualifiedName, PropertyDataType dataType) const
 Like findPropertyTypeDescriptorByNameAndDataType, but only searches by matching with qualified names. More...
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByUnqualifiedNameAndDataType (string_view unqualifiedName, PropertyDataType dataType) const
 Like findPropertyTypeDescriptorByNameAndDataType, but only searches by matching with unqualified names. More...
 
AbstractPropertyTypeDescriptor::ValueSourcegetClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetFinalValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetNonClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetTopValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 Gets the top-level value source for a given property descriptor. More...
 
virtual void notifyPropertyHandlers (PropertyStoragePtr &storagePtr, PropertyNotificationReason reason)
 Notifies all property handlers on a property storage. More...
 
void onCopy (const PropertyObject &other)
 
void removeLocalValue (AbstractPropertyTypeDescriptor &descriptor, PropertyStoragePtr &propertyStorage)
 Removes a local value from the given property storage. More...
 
void removePropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, void *owner)
 Removes a property value source. More...
 
void validatePropertyModifiers (PropertyStoragePtr &propertyStorage)
 Validates property modifiers without notifying handlers. More...
 
void validatePropertyModifiersAndNotifyHandlers (PropertyStoragePtr &propertyStorage)
 Validates property modifiers and notifies handlers. More...
 
- Protected Member Functions inherited from kanzi::InputMethodListener
void connectInputMethods (Node &attachedNode)
 Connects the input methods to this listener. More...
 
void disconnectInputMethods ()
 Disconnects the input methods from this listener. More...
 
 InputMethodListener (Domain *domain)
 Constructor. More...
 
bool isComposingText (InputMethod &inputMethod) const
 Checks whether the inputMethod is in the text composition state. More...
 
template<typename Method , typename... Arguments>
void updateInputMethods (InputMethod *excludeInputMethod, Method method, const Arguments &...arguments)
 Calls a method of each input method with the arguments passed. More...
 

Additional Inherited Members

- Protected Types inherited from kanzi::Object
typedef vector< AppliedStyleEntrySharedPtrAppliedStyleContainer
 Applied style container. More...
 
- Static Protected Member Functions inherited from kanzi::InputManipulator
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Protected Attributes inherited from kanzi::Object
AppliedStyleContainer m_appliedStyles
 Listing of applied styles applied to this object. More...
 
- Protected Attributes inherited from kanzi::InputMethodListener
InputMethodWeakPtr m_composingInputMethod
 The input method that provides the text composition. More...
 
TextEditBuffer m_editBuffer
 The buffer where the text input is stored. More...
 
InputMethodAction m_inputMethodAction
 The label of the input action. More...
 
vector< pair< InputMethodSharedPtr, bool > > m_inputMethods
 The input method instances with which the input method listener interacts. More...
 
InputType m_inputType
 The input type. More...
 
bool m_isReadOnly
 The read-only state. More...
 

Detailed Description

The text input manipulator handles key gestures used with TextBox nodes to move the cursor, select text, and delete text, and provides the basics of text editing capabilities in Kanzi.

For example, you can enable the application user to:

  • Insert, replace, and erase text.
  • Manipulate the cursor.
  • Select text.

To move the cursor in a TextBox node the text input manipulator uses the Left Arrow, Right Arrow, Home, and End navigation keys, and the Control key modifier.

To modify the text selection in a TextBox node the text input manipulator uses the Left Arrow, Right Arrow, Home, and End navigation keys, and the Control and Shift key modifiers.

The text input manipulator recognizes only one navigation key gesture at a time. When Kanzi recognizes a key-pressed gesture for a navigation key, the manipulator grabs the key input and blocks any key input until Kanzi recognizes the key-released gesture for the pressed navigation key.

When the user presses a navigation key, Kanzi dispatches a message dedicated to that navigation key. When the user holds down a key, Kanzi uses the key-hold and key-repeat gestures to create the text cursor or text selection cursor messages for each navigation key. To configure the key-hold and key-repeat gestures, use the setKeyHoldTimeout() and setKeyRepeatInterval() methods. When focus changes, Kanzi cancels the manipulator, but the cancellation does not result in a separate text cursor or text selection cursor cancel message. You can cancel a key-pressed gesture for a text cursor or text selection navigation key with the cancel() method.

Since
Kanzi 3.9.0

Member Enumeration Documentation

States of text selection.

Enumerator
NoSelection 

Specifies the state where no text is selected.

Started 

Specifies the state where selecting text starts.

Updated 

Specifies the state where the text selection is updated.

Cleared 

Specifies the state where the text selection is cleared.

Constructor & Destructor Documentation

kanzi::TextInputManipulator::TextInputManipulator ( Domain domain)
explicitprotected

Constructor.

Member Function Documentation

static PropertyTypeEditorInfoSharedPtr kanzi::TextInputManipulator::makeEditorInfo ( )
inlinestatic
static TextInputManipulatorSharedPtr kanzi::TextInputManipulator::create ( Domain domain,
string_view  name = "" 
)
inlinestatic

Creates a TextInputManipulator instance.

Parameters
domainThe domain to which the TextInputManipulator instance belongs.
nameThe name of the input manipulator.
void kanzi::TextInputManipulator::setInputLayout ( TextInputLayout layout)
size_t kanzi::TextInputManipulator::getMaximumTextLength ( ) const

Returns the maximum text buffer length constraint.

Returns
The maximum length of the text buffer. If this value is 0, the length of the text buffer is not constrained.
void kanzi::TextInputManipulator::setMaximumTextLength ( size_t  maxLength)

Sets the maximum text length constraint.

Parameters
maxLengthThe maximum allowed text length as UTF-8 characters for an input text buffer. To remove the constraint, use 0.
See also
getMaximumTextLength()
void kanzi::TextInputManipulator::setText ( string_view  text)

Sets the UTF-8 text.

Parameters
textThe text to set as content.
void kanzi::TextInputManipulator::insertText ( size_t  position,
string_view  text 
)

Moves the cursor to a given position and inserts text to that position.

After inserting the text, the cursor is in the end of the inserted text.

Parameters
positionThe position to which you want to insert the text.
textThe text to insert.
See also
setText()
void kanzi::TextInputManipulator::deleteText ( size_t  begin,
size_t  end 
)

Moves the cursor to position begin and erases from a text buffer UTF-8 characters between positions begin and end.

Position begin must be smaller than position end.

Parameters
beginThe position of the first UTF-8 character to erase.
endThe position of the first UTF-8 character to not erase.
void kanzi::TextInputManipulator::deleteAtCursor ( )

Deletes a character using delete.

For example, in text that uses a left-to-right script this function deletes the character on the right side of the cursor.

See also
deleteText(), backspaceAtCursor()
void kanzi::TextInputManipulator::backspaceAtCursor ( )

Deletes a character using backspace.

For example, in text that uses a left-to-right script this function deletes the character on the left side of the cursor.

See also
deleteText(), deleteAtCursor()
void kanzi::TextInputManipulator::deleteWordAtCursor ( )

Deletes the characters between the cursor position and the word boundary that follows the cursor.

Functionally equivalent to the Control + Delete keys.

void kanzi::TextInputManipulator::backspaceWordAtCursor ( )

Deletes the characters between the cursor position and the closest word boundary using backspace.

For example, in text that uses a left-to-right script this function deletes the characters between the cursor and the word boundary on its left side. Functionally equivalent to the Control + Backspace keys.

size_t kanzi::TextInputManipulator::getCursorPosition ( ) const

Returns the position of the cursor.

Returns
The cursor position. If any text is selected, the cursor position marks the end point of the selected text.
void kanzi::TextInputManipulator::setCursorPosition ( size_t  position)

Sets the position of the cursor in the text buffer of a TextInputConcept.

If any text is selected, the method clears the selected text.

Parameters
positionThe new position of the cursor.
void kanzi::TextInputManipulator::moveCursorForward ( size_t  characterCount)

Moves the cursor forward by a given number of characters in the text buffer of a TextInputConcept.

Parameters
characterCountThe number of characters by which to move the cursor forward.
See also
moveCursorToEnd(), moveCursorHome(), setCursorPosition(), moveCursorForward(), moveCursorBackward(), moveCursorToNextWord(), moveCursorToPreviousWord()
void kanzi::TextInputManipulator::moveCursorForward ( )

Moves the cursor forward by one character.

See also
setCursorPosition(), moveCursorBackward(), moveCursorToNextWord(), moveCursorToPreviousWord()
void kanzi::TextInputManipulator::moveCursorBackward ( size_t  characterCount)

Moves the cursor backward by a given number of characters in the text buffer of a TextInputConcept.

Parameters
characterCountThe number of characters by which to move the cursor backward.
See also
moveCursorToEnd(), moveCursorHome(), setCursorPosition(), moveCursorForward(), moveCursorBackward(), moveCursorToNextWord(), moveCursorToPreviousWord()
void kanzi::TextInputManipulator::moveCursorBackward ( )

Moves the cursor backward by one character.

See also
setCursorPosition(), moveCursorForward(), moveCursorToNextWord(), moveCursorToPreviousWord()
void kanzi::TextInputManipulator::moveCursorToEnd ( )

Moves the cursor to the end of the text buffer of a TextInputConcept.

See also
moveCursorHome(), setCursorPosition(), moveCursorForward(), moveCursorBackward(), moveCursorToNextWord(), moveCursorToPreviousWord()
void kanzi::TextInputManipulator::moveCursorHome ( )

Moves the cursor to the beginning of the text buffer of a TextInputConcept.

See also
moveCursorToEnd(), setCursorPosition(), moveCursorForward(), moveCursorBackward(), moveCursorToNextWord(), moveCursorToPreviousWord()
void kanzi::TextInputManipulator::moveCursorToNextWord ( )
void kanzi::TextInputManipulator::moveCursorToPreviousWord ( )
bool kanzi::TextInputManipulator::hasSelection ( ) const

Checks whether any text is selected.

Returns
If any text is selected, returns true, otherwise false.
void kanzi::TextInputManipulator::selectText ( size_t  start,
size_t  end 
)

Selects the text between the given start and end positions.

Parameters
startThe start position of the text selection.
endThe end position of the text selection. If the text selection is successful, the cursor ends up at this position.
size_t kanzi::TextInputManipulator::getSelectionStart ( ) const

Returns the starting point of the selected text.

Returns
The starting point of the selected text. If no text is selected, the method returns the cursor position.
void kanzi::TextInputManipulator::setSelectionStart ( size_t  position)

Sets the start of the text selection at the position given as argument.

Parameters
positionThe position at which to start the text selection. This position cannot be larger than the cursor position.
size_t kanzi::TextInputManipulator::getSelectionEnd ( ) const
inline

Returns the ending point of the selected text.

Returns
The ending point of the selected text, same as the cursor position.
void kanzi::TextInputManipulator::setSelectionEnd ( size_t  position)

Sets the end of the text selection at the position given as argument.

This is otherwise equivalent to moving the cursor to a given position, but it either starts a selection or modifies an existing selection.

Parameters
positionThe position at which to end the text selection. This position cannot be smaller than the position at which the text selection starts.
See also
getSelectionEnd(), getSelectionStart(), setSelectionStart(), setCursorPosition()
void kanzi::TextInputManipulator::clearSelection ( )

Clears the text selection.

void kanzi::TextInputManipulator::selectAll ( )

Selects all content in a Text Box node.

This method places the text selection start and end cursors in front of and at the end of the text string.

void kanzi::TextInputManipulator::moveSelectionStartForward ( size_t  characterCount)

Moves the start of text selection forward by a given characterCount in the text buffer of a Text Box node.

Parameters
characterCountThe number of characters by which to move the start of text selection forward.
See also
moveSelectionEndForward(), moveSelectionEndBackward(), selectText(), moveSelectionStartToNextWord(), moveSelectionStartToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionStartBackward ( size_t  characterCount)

Moves the end of text selection a given characterCount backward in the text buffer of a Text Box node.

Parameters
characterCountThe number of characters to move the end of text selection backward.
See also
moveSelectionEndForward(), moveSelectionEndBackward(), selectText(), moveSelectionStartToNextWord(), moveSelectionStartToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionEndForward ( size_t  characterCount)

Moves the end of text selection a given characterCount forward in the text buffer of a Text Box node.

Parameters
characterCountThe number of characters to move the end of text selection forward.
See also
moveSelectionEndForward(), moveSelectionEndBackward(), selectText(), moveSelectionEndToNextWord(), moveSelectionEndToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionEndBackward ( size_t  characterCount)

Moves the end of text selection a given characterCount backward in the text buffer of a Text Box node.

Parameters
characterCountThe number of characters to move the end of text selection backward.
See also
moveSelectionEndForward(), moveSelectionEndBackward(), selectText(), moveSelectionEndToNextWord(), moveSelectionEndToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionStartForward ( )

Moves the start of the text selection forward by one character.

See also
selectText(), moveSelectionStartBackward(), moveSelectionStartToNextWord(), moveSelectionStartToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionStartBackward ( )

Moves the start of the text selection backward by one character.

See also
selectText(), moveSelectionStartForward(), moveSelectionStartToNextWord(), moveSelectionStartToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionEndForward ( )

Moves the end of the text selection forward by one character.

See also
selectText(), moveSelectionEndBackward(), moveSelectionEndToNextWord(), moveSelectionEndToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionEndBackward ( )

Moves the end of the text selection backward by one character.

See also
selectText(), moveSelectionEndForward(), moveSelectionEndToNextWord(), moveSelectionEndToPreviousWord()
void kanzi::TextInputManipulator::moveSelectionStartToNextWord ( )

Moves the start of the text selection forward to the next word.

See also
moveSelectionStartToPreviousWord(), selectText(), moveSelectionStartForward(), moveSelectionStartBackward()
void kanzi::TextInputManipulator::moveSelectionStartToPreviousWord ( )

Moves the start of the text selection backward to the previous word.

See also
moveSelectionStartToNextWord(), selectText(), moveSelectionStartForward(), moveSelectionStartBackward()
void kanzi::TextInputManipulator::moveSelectionEndToNextWord ( )

Moves the end of the text selection forward to the next word.

See also
moveSelectionEndToNextWord(), selectText(), moveSelectionEndForward(), moveSelectionEndBackward()
void kanzi::TextInputManipulator::moveSelectionEndToPreviousWord ( )

Moves the end of the text selection backward to the previous word.

See also
moveSelectionEndToPreviousWord(), selectText(), moveSelectionEndForward(), moveSelectionEndBackward()
void kanzi::TextInputManipulator::moveSelectionEndpointBackward ( size_t  steps)

Moves the endpoint of the active text selection backward with steps passed as argument.

Parameters
stepsThe steps to move the active selection endpoint backward. If the selection is initiated when you call this function, the selection start position becomes the active selection endpoint.
void kanzi::TextInputManipulator::moveSelectionEndpointBackward ( )
inline

Overload of moveSelectionEndpointBackward(), moves the endpoint of the active text selection one step backward.

void kanzi::TextInputManipulator::moveSelectionEndpointForward ( size_t  steps)

Moves the endpoint of the active text selection forward by steps passed as argument.

Parameters
stepsThe steps to move the active selection endpoint forward. If the selection is initiated when you call this function, the selection end position becomes the active selection endpoint.
void kanzi::TextInputManipulator::moveSelectionEndpointForward ( )
inline

Overload of moveSelectionEndpointForward(), moves the endpoint of the active text selection one step forward.

void kanzi::TextInputManipulator::moveSelectionEndpointToPreviousWord ( )

Moves the endpoint of the active text selection backward to the previous word boundary.

If the selection is initiated when you call this function, the selection start position becomes the active selection endpoint.

void kanzi::TextInputManipulator::moveSelectionEndpointToNextWord ( )

Moves the endpoint of the active text selection forward to the previous word boundary.

If the selection is initiated when you call this function, the selection end position becomes the active selection endpoint.

void kanzi::TextInputManipulator::moveSelectionEndpointToFront ( )

Moves the active selection end-point to the beginning of the text string.

If the selection is initiated when you call this function, the selection start position becomes the active selection end-point.

void kanzi::TextInputManipulator::moveSelectionEndpointToBack ( )

Moves the endpoint of the active text selection to the end of the text string.

If the selection is initiated when you call this function, the selection end position becomes the active selection endpoint.

void kanzi::TextInputManipulator::setEchoMode ( EchoMode  echoMode)

Sets the echo mode to use to format the display text of the text buffer of the input manipulator.

Parameters
echoModeThe echo mode to use to format the display text.
See also
TextEditBuffer::getEchoMode(), TextEditBuffer::setEchoMode()
void kanzi::TextInputManipulator::setPasswordMaskingCharacter ( string_view  passwordMask)

Sets the password masking character of the text buffer of the input manipulator.

Parameters
passwordMaskThe masking character to set.
void kanzi::TextInputManipulator::setReadOnly ( bool  readOnly)

Sets whether the user input can modify the text of a TextInputManipulator.

Parameters
readOnlyThe read-only state to set.
See also
isReadOnly(), ReadOnlyStateChangedMessage
void kanzi::TextInputManipulator::setInputMethodAction ( InputMethodAction  action)

Sets the input method action of the text input methods.

Parameters
actionThe input method action to set.
void kanzi::TextInputManipulator::setInputType ( InputType  inputType)

Sets the input type of the input methods.

Parameters
inputTypeThe input type to use in the input methods.
void kanzi::TextInputManipulator::activateInput ( )

Activates the input on an input manipulator.

void kanzi::TextInputManipulator::deactivateInput ( )

Deactivates the input on an input manipulator.

void kanzi::TextInputManipulator::ensureInputMethodsAvailable ( )

Ensures that the connected input methods are available.

For example, if the input method is an on-screen keyboard, shows the on-screen keyboard.

TextKeyNavigationDirection kanzi::TextInputManipulator::getTextKeyNavigationDirection ( ) const

Returns the direction of key navigation.

Returns
Key navigation direction.
void kanzi::TextInputManipulator::setTextKeyNavigationDirection ( TextKeyNavigationDirection  direction)

Sets the direction of key navigation.

Parameters
directionFor left-to-right key navigation pass TextKeyNavigationDirection::LeftToRight. For right-to-left key navigation pass TextKeyNavigationDirection::LeftToRight.
void kanzi::TextInputManipulator::onPartialKeyPressGesture ( KeyGestureInfo )
overrideprotectedvirtual
void kanzi::TextInputManipulator::onKeyPressGesture ( KeyGestureInfo )
overrideprotectedvirtual
void kanzi::TextInputManipulator::onKeyReleaseGesture ( KeyGestureInfo )
overrideprotectedvirtual
bool kanzi::TextInputManipulator::notifyKeyInput ( const KeyEvent event)
overrideprotectedvirtual
void kanzi::TextInputManipulator::onCancel ( )
overrideprotectedvirtual

Overrides InputManipulator::onCancel().

Reimplemented from kanzi::InputManipulator.

void kanzi::TextInputManipulator::onReset ( )
overrideprotectedvirtual

Overrides InputManipulator::onReset().

Reimplemented from kanzi::InputManipulator.

void kanzi::TextInputManipulator::onInputMethodAvailableOverride ( InputMethod source,
bool  available 
)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onInputMethodDisconnectedOverride ( InputMethod source)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onTextAddedOverride ( InputMethod source,
size_t  position,
string_view  text 
)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onTextDeletedOverride ( InputMethod source,
size_t  start,
size_t  end 
)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onTextChangedOverride ( InputMethod source,
string_view  text 
)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onTextCompositionStartedOverride ( InputMethod source)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onCompositionTextUpdatedOverride ( InputMethod source,
string_view  text 
)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onCompositionTextCommittedOverride ( InputMethod source)
overrideprotectedvirtual
void kanzi::TextInputManipulator::onTextCompositionCanceledOverride ( InputMethod source)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onCursorMovedOverride ( InputMethod source,
size_t  position 
)
overrideprotectedvirtual
bool kanzi::TextInputManipulator::onSelectionChangedOverride ( InputMethod source,
size_t  start,
size_t  end 
)
overrideprotectedvirtual
void kanzi::TextInputManipulator::onInputTypeChangedOverride ( InputMethod source,
InputType  inputType 
)
overrideprotectedvirtual
void kanzi::TextInputManipulator::onExecuteInputMethodActionOverride ( InputMethod )
overrideprotectedvirtual
void kanzi::TextInputManipulator::notifyTextChanged ( )
protected

Dispatches a TextChangedMessage to the attached node.

void kanzi::TextInputManipulator::notifyCursorMoved ( )
protected

Dispatches a CursorMovedMessage to the attached node.

void kanzi::TextInputManipulator::notifySelectionChanged ( )
protected

Dispatches a SelectionChangedMessage to the attached node.

void kanzi::TextInputManipulator::notifyReadOnlyStateChanged ( )
protected

Dispatches a ReadOnlyStateChangedMessage to the attached node.

void kanzi::TextInputManipulator::notifyInputTypeChanged ( )
protected

Dispatches an InputTypeChangedMessage to the attached node.

bool kanzi::TextInputManipulator::moveCursorTo ( size_t  position)
protected

Moves the cursor to the position given as argument.

Parameters
positionThe new position of the cursor.
void kanzi::TextInputManipulator::updateSelectionState ( )
protected

Updates the state of text selection.

void kanzi::TextInputManipulator::handleLeftArrowGesture ( )
protected

Handles the Left Arrow key gesture.

void kanzi::TextInputManipulator::handleRightArrowGesture ( )
protected

Handles the Right Arrow key gesture.

void kanzi::TextInputManipulator::handleControlLeftArrowGesture ( )
protected

Handles the Control + Left Arrow key gesture.

void kanzi::TextInputManipulator::handleControlRightArrowGesture ( )
protected

Handles the Control + Right Arrow key gesture.

void kanzi::TextInputManipulator::handleShiftLeftArrowGesture ( )
protected

Handles the Shift + Left Arrow key gesture.

void kanzi::TextInputManipulator::handleShiftRightArrowGesture ( )
protected

Handles the Shift + Right Arrow key gesture.

void kanzi::TextInputManipulator::handleShiftControlLeftArrowGesture ( )
protected

Handles the Shift + Control + Left Arrow key gesture.

void kanzi::TextInputManipulator::handleShiftControlRightArrowGesture ( )
protected

Handles the Shift + Control + Right Arrow key gesture.

Member Data Documentation

MessageType<TextChangedMessageArguments> kanzi::TextInputManipulator::TextChangedMessage
static

Kanzi dispatches this message to the attached node when the user changes the text content by adding or removing characters, when committing the IME composition text, or when the entire text is replaced.

MessageType<CursorMovedMessageArguments> kanzi::TextInputManipulator::CursorMovedMessage
static

Kanzi dispatches this message to the attached node when the user changes the cursor position by navigating with the arrow keys.

MessageType<SelectionChangedMessageArguments> kanzi::TextInputManipulator::SelectionChangedMessage
static

Kanzi dispatches this message to the attached node when the user changes the text selection by navigating with the arrow keys.

MessageType<ReadOnlyStateChangedMessageArguments> kanzi::TextInputManipulator::ReadOnlyStateChangedMessage
static

Kanzi dispatches this message to the attached node when the user changes the read-only state.

MessageType<InputTypeChangedMessageArguments> kanzi::TextInputManipulator::InputTypeChangedMessage
static

Kanzi dispatches this message to the attached node when the input method updates the input type.

MessageType<InputMethodActionMessageArguments> kanzi::TextInputManipulator::InputMethodActionMessage
static

Kanzi dispatches this message to the attached node when the input action event is handled.

MessageType<TextCompositionStateMessageArguments> kanzi::TextInputManipulator::CompositionTextChangedMessage
static

Kanzi dispatches this message to the attached node when the input method updates the composition text.

MessageType<TextCompositionStateMessageArguments> kanzi::TextInputManipulator::CompositionTextCommittedMessage
static

Kanzi dispatches this message to the attached node when the input method commits the composition text.

MessageType<TextCompositionStateMessageArguments> kanzi::TextInputManipulator::TextCompositionCanceledMessage
static

Kanzi dispatches this message to the attached node when the input method cancels the text composition.

MessageType<InputMethodsDisconnectedMessageArguments> kanzi::TextInputManipulator::InputMethodsDisconnectedMessage
static

Kanzi dispatches this message to the attached node when the input methods of the input manipulator are disconnected.

MessageType<InputMethodAvailableChangedMessageArguments> kanzi::TextInputManipulator::InputMethodAvailableChangedMessage
static

Kanzi dispatches this message to the attached node when the availability of an input method of the input manipulator changes.

When an input method is available, it produces text input. When an input method is not available, it does not produce text input, but is still connected to the input manipulator.


The documentation for this class was generated from the following file: