cohtml.TextInputHandler
Implementation of the cohtml.Net.ITextInputHandler interface. Provides events when input fields are focused, unfocused or their input caret position changes. Manages IME compositions.
Inherits from cohtml.Net.ITextInputHandler, SystemIDisposable
Public Functions
Name | |
---|---|
TextInputHandler() Default constructor. | |
virtual override void | OnFocus(IInputProxy proxy) When the element is focused, a callback method is received from Cohtml. |
virtual override void | OnBlur(IInputProxy proxy) When the element loses focus, a callback method is received from Cohtml. |
T | GetAttributeValue< T >(string attribute) |
virtual override void | OnSelectionChanged(IInputProxy proxy, Selection selection) Notifies that the selection in an input element has changed, including change of the caret position. |
void | UpdateImeComposition(KeyEventData keyData) Notifies Cohtml that IME compositions should be updated. This method must be called when your text in the UI changes(e.g. when sending keyboard events to the UI). |
void | ImeSetComposition(KeyEventData keyData) Displaying and collecting the initiated IME composition in the input field. |
void | ImeEndComposition() When the composition ends, clear the accumulated composition before the new text segment is written. Reset cached text. |
Public Properties
Name | |
---|---|
string | InputText It returns the entire text from the focused input element. An empty string if it doesn’t contain any text. |
Action< string > | OnFocusCallback Focus callback, which will be invoked when an input field is focused. |
Func< string > | OnBlurCallback Focus callback, which will be invoked when an input field is unfocused. |
Action< IInputProxy, Selection > | OnSelectionChangedCallback This callback will be triggered when the selection of the input field’s caret changes. |
Additional inherited members
Public Functions inherited from cohtml.Net.ITextInputHandler
Name | |
---|---|
virtual void | Dispose() |
ITextInputHandler() | |
virtual void | OnTextChanged(IInputProxy proxy, string addedChars, uint addedCount, string removedChars, uint removedCount, uint index) Notifies that the text in an input element has changed. |
delegate void | SwigDelegateITextInputHandler_0(global.System.IntPtr proxy, global.System.IntPtr selection, global.System.IntPtr swigId) |
delegate void | SwigDelegateITextInputHandler_1(global.System.IntPtr proxy, string addedChars, uint addedCount, string removedChars, uint removedCount, uint index, global.System.IntPtr swigId) |
delegate void | SwigDelegateITextInputHandler_2(global.System.IntPtr proxy, global.System.IntPtr swigId) |
delegate void | SwigDelegateITextInputHandler_3(global.System.IntPtr proxy, global.System.IntPtr swigId) |
Protected Attributes inherited from cohtml.Net.ITextInputHandler
Name | |
---|---|
bool | swigCMemOwn |
Public Functions Documentation
function TextInputHandler
TextInputHandler()
Default constructor.
function OnFocus
virtual override void OnFocus(
IInputProxy proxy
)
When the element is focused, a callback method is received from Cohtml.
Parameters:
- proxy The affected element
Reimplements: cohtml.Net.ITextInputHandler.OnFocus
function OnBlur
virtual override void OnBlur(
IInputProxy proxy
)
When the element loses focus, a callback method is received from Cohtml.
Parameters:
- proxy the affected element
Reimplements: cohtml.Net.ITextInputHandler.OnBlur
function GetAttributeValue< T >
T GetAttributeValue< T >(
string attribute
)
function OnSelectionChanged
virtual override void OnSelectionChanged(
IInputProxy proxy,
Selection selection
)
Notifies that the selection in an input element has changed, including change of the caret position.
Parameters:
- proxy The affected element
- selection The new selection
Reimplements: cohtml.Net.ITextInputHandler.OnSelectionChanged
function UpdateImeComposition
void UpdateImeComposition(
KeyEventData keyData
)
Notifies Cohtml that IME compositions should be updated. This method must be called when your text in the UI changes(e.g. when sending keyboard events to the UI).
function ImeSetComposition
void ImeSetComposition(
KeyEventData keyData
)
Displaying and collecting the initiated IME composition in the input field.
function ImeEndComposition
void ImeEndComposition()
When the composition ends, clear the accumulated composition before the new text segment is written. Reset cached text.
Public Property Documentation
property InputText
string InputText;
It returns the entire text from the focused input element. An empty string if it doesn’t contain any text.
property OnFocusCallback
Action< string > OnFocusCallback;
Focus callback, which will be invoked when an input field is focused.
property OnBlurCallback
Func< string > OnBlurCallback;
Focus callback, which will be invoked when an input field is unfocused.
property OnSelectionChangedCallback
Action< IInputProxy, Selection > OnSelectionChangedCallback;
This callback will be triggered when the selection of the input field’s caret changes.