The InputMethodListener defines the communication interface of Kanzi input methods. More...
#include <kanzi/core.ui/input_method/input_method_listener.hpp>
Public Member Functions | |
| 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... | |
| 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 | onEnterKeyCanceled (InputMethod &source) |
| The input method source informs the input method listener that the Enter key event is canceled. More... | |
| void | onEnterKeyPressed (InputMethod &source) |
| The input method source informs the input method listener that the Enter key is pressed. More... | |
| void | onEnterKeyReleased (InputMethod &source) |
| The input method source informs the input method listener that the Enter key is released. 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... | |
Protected Member Functions | |
| void | connectInputMethods (Node &attachedNode, bool readOnly) |
| 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... | |
Overridable operations | |
| virtual bool | onInputMethodDisconnectedOverride (InputMethod &source)=0 |
| To deactivate an input method listener, implement this method. More... | |
| virtual bool | onTextAddedOverride (InputMethod &source, size_t position, string_view text)=0 |
| To add text at a given position in the cached text, implement this method. More... | |
| virtual bool | onTextChangedOverride (InputMethod &source, string_view text)=0 |
| To replace the cached text with the text passed as argument, implement this method. More... | |
| virtual bool | onTextDeletedOverride (InputMethod &source, size_t start, size_t end)=0 |
| To delete the characters between the begin and positions from the cached text, implement this method. More... | |
| virtual bool | onTextCompositionStartedOverride (InputMethod &source)=0 |
| To make the input method listener enter the text composition state, implement this method. More... | |
| virtual bool | onCompositionTextUpdatedOverride (InputMethod &source, string_view text)=0 |
| To update the composition text, implement this method. More... | |
| virtual bool | onCompositionTextCommitedOverride (InputMethod &source)=0 |
| To commit the composition text to the cached text, implement this method. More... | |
| virtual void | onTextCompositionCanceledOverride (InputMethod &source)=0 |
| To cancel text composition, implement this method. More... | |
| virtual bool | onCursorMovedOverride (InputMethod &source, size_t position)=0 |
| To update the cursor position, implement this method. More... | |
| virtual bool | onSelectionChangedOverride (InputMethod &source, size_t start, size_t end)=0 |
| To update the text selection, implement this method. More... | |
| virtual void | onInputTypeChangedOverride (InputMethod &source, InputType inputType)=0 |
| To update the input type, implement this method. More... | |
| virtual void | onEnterKeyPressedOverride (InputMethod &source)=0 |
| To handle the Enter key press, implement this method. More... | |
| virtual void | onEnterKeyReleasedOverride (InputMethod &source)=0 |
| To handle the Enter key release, implement this method. More... | |
| virtual void | onEnterKeyCanceledOverride (InputMethod &source)=0 |
| To handle the Enter key cancel, implement this method. More... | |
Protected Attributes | |
| InputMethodWeakPtr | m_composingInputMethod |
| The input method that provides the text composition. More... | |
| TextEditBuffer | m_editBuffer |
| The buffer where the text input is stored. More... | |
| EnterKeyLabel | m_enterKeyLabel |
| The Enter key action. More... | |
| vector< InputMethodSharedPtr > | m_inputMethods |
| The input method instances with which the input method listener interacts. More... | |
| InputType | m_inputType |
| The input type. More... | |
The InputMethodListener defines the communication interface of Kanzi input methods.
Input methods use this interface to update the active client about the changes occurring on the input method. The input method listener implementation must use the InputMethod interface to initiate updates, and to notify the input methods about changes that occur on the client side.
|
virtual |
Destructor.
|
explicitprotected |
Constructor.
| bool kanzi::InputMethodListener::onInputMethodDisconnected | ( | InputMethod & | source | ) |
The input method source tells its active input method listener that it disconnected itself from the input method listener.
| source | The input method source that tells its active input method listener that it disconnected. |
| void kanzi::InputMethodListener::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.
| source | The input method source that tells the input method listener to replace the cached text. |
| text | The new text to set. |
| void kanzi::InputMethodListener::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.
| source | The input method source that tells the input method listener to add a text to the cached text. |
| position | The position where the text is added. |
| text | The text to append to the cached text. |
| void kanzi::InputMethodListener::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.
| source | The input method source that tells the input method listener to remove the text. |
| start | The start position of the text to remove. |
| end | The end position of the text to remove. |
| bool kanzi::InputMethodListener::isComposingText | ( | ) | const |
Returns the text composition state of the input method listener.
| void kanzi::InputMethodListener::onTextCompositionStarted | ( | InputMethod & | source | ) |
The input method source tells the input method listener to enter the text composition state at the current cursor position.
| source | The input method source that tells the input method listener to prepare for receiving composition text. |
| void kanzi::InputMethodListener::onCompositionTextUpdated | ( | InputMethod & | source, |
| string_view | text | ||
| ) |
The input method source tells the input method listener to update the composition text.
| source | The input method source that tells the input method listener to update the composition text. |
| text | The text to insert into the cached text. |
| void kanzi::InputMethodListener::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.
| source | The input method source that tells the input method listener to commit the composition text. |
| void kanzi::InputMethodListener::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.
| source | The input method source that tells the input method listener to cancel the text composition. |
| void kanzi::InputMethodListener::onCursorMoved | ( | InputMethod & | source, |
| size_t | position | ||
| ) |
The input method source tells the input method listener to update the cursor position.
| source | The input method source that tells the input method listener to update the cursor position. |
| position | The position of the cursor to set. |
| void kanzi::InputMethodListener::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.
| source | The input method that tells the input method listener to update the cursor positions. |
| start | The cursor position at the start of the text selection to set. |
| end | The cursor position at the end of the text selection to set. |
| void kanzi::InputMethodListener::onInputTypeChanged | ( | InputMethod & | source, |
| InputType | inputType | ||
| ) |
The input method source tells the input method listener to update its input type.
| source | The input method source that tells the input method listener to update its input type. |
| inputType | The input type to set. |
| void kanzi::InputMethodListener::onEnterKeyPressed | ( | InputMethod & | source | ) |
The input method source informs the input method listener that the Enter key is pressed.
| source | The input method source that tells the input method listener that the Enter key is pressed. |
| void kanzi::InputMethodListener::onEnterKeyReleased | ( | InputMethod & | source | ) |
The input method source informs the input method listener that the Enter key is released.
| source | The input method source that tells the input method listener that the Enter key is released. |
| void kanzi::InputMethodListener::onEnterKeyCanceled | ( | InputMethod & | source | ) |
The input method source informs the input method listener that the Enter key event is canceled.
| source | The input method source that tells the input method listener that the Enter key event is canceled. |
| void kanzi::InputMethodListener::cancelTextComposition | ( | ) |
Tells the input method, which provides the text composition, to cancel the text composition.
| void kanzi::InputMethodListener::commitCompositionText | ( | ) |
Commits the composition text.
|
protected |
Connects the input methods to this listener.
|
protected |
Disconnects the input methods from this listener.
|
protected |
Checks whether the inputMethod is in the text composition state.
|
protectedpure virtual |
To deactivate an input method listener, implement this method.
| source | The input method source that tells the input method listener to deactivate. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To add text at a given position in the cached text, implement this method.
This method is called by the InputMethodListener::onTextAdded() method.
| source | The input method source that tells the input method listener to add a text to the cached text. |
| position | The position where to add the text. |
| text | The text to append to the cached text. Kanzi expects the input method listener to move the cursor to the end of the text added to the cached text. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To replace the cached text with the text passed as argument, implement this method.
This method is called by the InputMethodListener::onTextChanged() method.
| source | The input method source that tells the input method listener to replace the cached text. |
| text | The text to set. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To delete the characters between the begin and positions from the cached text, implement this method.
This method is called by the InputMethodListener::onTextDeleted() method.
| source | The input method source that tells the input method listener to remove the text. |
| start | The start position of the text to remove. |
| end | The end position of the text to remove. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To make the input method listener enter the text composition state, implement this method.
This method is called by the InputMethodListener::onTextCompositionStarted() method.
| source | The input method source that tells the input method listener to enter the text composition state. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To update the composition text, implement this method.
This method is called by the InputMethodListener::onCompositionTextUpdated() method.
| source | The input method source that tells the input method listener to update the composition text. |
| text | The text to insert into the cached text. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To commit the composition text to the cached text, implement this method.
This method is called by the InputMethodListener::onCompositionTextCommitted() method.
| source | The input method source that tells the input method listener to commit the composition text. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To cancel text composition, implement this method.
This method is called by the InputMethodListener::onTextCompositionCanceled() method.
| source | The input method source that tells the input method listener to cancel text composition. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To update the cursor position, implement this method.
This method is called by the InputMethodListener::onCursorMoved() method.
| source | The input method source that tells the input method listener to update the cursor position. |
| position | The position of the cursor to set. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To update the text selection, implement this method.
This method is called by the InputMethodListener::onSelectionChanged() method.
| source | The input method that tells the input method listener to update the cursor positions. |
| start | The cursor position at the start of the text selection to set. |
| end | The cursor position at the end of the text selection to set. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To update the input type, implement this method.
This method is called by the InputMethodListener::onInputTypeChanged() method.
| source | The input method that tells the input method listener to update the input type. |
| inputType | The input type to set. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To handle the Enter key press, implement this method.
This method is called by the InputMethodListener::onEnterKeyPressed() method.
| source | The input method that tells the input method listener that the Enter key is pressed. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To handle the Enter key release, implement this method.
This method is called by the InputMethodListener::onEnterKeyReleased() method.
| source | The input method that tells the input method listener that the Enter key is released. |
Implemented in kanzi::TextInputManipulator.
|
protectedpure virtual |
To handle the Enter key cancel, implement this method.
This method is called by the InputMethodListener::onEnterKeyCanceled() method.
| source | The input method that tells the input method listener that the Enter key event is canceled. |
Implemented in kanzi::TextInputManipulator.
|
inlineprotected |
Calls a method of each input method with the arguments passed.
| Method | The method type. |
| Arguments | The argument types. |
| excludeInputMethod | The input method to exclude. The method is not called on this input method. |
| method | The address of the method to call. |
| arguments | The arguments to pass to the method. |
|
protected |
The input method instances with which the input method listener interacts.
|
protected |
The input method that provides the text composition.
|
protected |
The buffer where the text input is stored.
|
protected |
The Enter key action.
|
protected |
The input type.