Class InputMethodEditor
Definition
- Namespace:
- Tizen.Uix.InputMethod
- Assembly:
- Tizen.Uix.InputMethod.dll
This class contains the API's related to the IME (Input method editor).
C#Copypublic static class InputMethodEditor
- Inheritance
-
objectInputMethodEditor
Methods
Declaration
C#Copypublic static void CommitString(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| string | str | The string to be committed. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static void Create()
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static void DeleteSurroundingText(int offset, int len)
Parameters
| Type | Name | Description |
|---|---|---|
| int | offset | The offset value from the cursor position. |
| int | len | The length of the text to delete. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static void Destroy()
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static EditorWindow GetMainWindow()
Returns
| Type | Description |
|---|---|
| EditorWindow | The input panel main window object on success, otherwise null. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
GetSurroundingText(int, int, out string, out int)
Gets the surrounding text from the position of the cursor, synchronously.
Declaration
C#Copypublic static void GetSurroundingText(int maxLenBefore, int maxLenAfter, out string text, out int cursorPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| int | maxLenBefore | The maximum length of the string to be retrieved before the cursor, -1 means unlimited. |
| int | maxLenAfter | The maximum length of the string to be retrieved after the cursor, -1 means unlimited. |
| string | text | The surrounding text. |
| int | cursorPosition | The cursor position. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static void HidePreEditString()
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
RequestSurroundingText(int, int)
Requests the surrounding text from the position of the cursor, asynchronously.
Declaration
C#Copypublic static void RequestSurroundingText(int maxLenBefore, int maxLenAfter)
Parameters
| Type | Name | Description |
|---|---|---|
| int | maxLenBefore | The maximum length of the string to be retrieved before the cursor, -1 means unlimited. |
| int | maxLenAfter | The maximum length of the string to be retrieved after the cursor, -1 means unlimited. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Run(Action, Action, Action<ContextId, InputMethodContext>, Action<ContextId>)
Runs the main loop of the IME application. This function starts to run the IME application's main loop.
Declaration
C#Copypublic static void Run(Action create, Action terminate, Action<InputMethodEditor.ContextId, InputMethodContext> show, Action<InputMethodEditor.ContextId> hide)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action | create | This is called to initialize the IME application before the main loop starts up. |
| System.Action | terminate | This is called when the IME application is terminated. |
| System.Action<T1, T2><InputMethodEditor.ContextId, InputMethodContext> | show | This is called when the IME application is shown. It provides the context information and the context ID. |
| System.Action<T><InputMethodEditor.ContextId> | hide | This is called when the IME application is hidden. It provides the context ID. |
Remarks
This API is a blocking call, as it starts the main loop of the application.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
SendKeyEvent(KeyCode, KeyMask, bool)
Sends a key event to the associated text input UI control.
Declaration
C#Copypublic static void SendKeyEvent(KeyCode keyCode, KeyMask keyMask, bool forwardKey = false)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyCode | keyCode | The key code to be sent. |
| KeyMask | keyMask | The modifier key mask. |
| bool | forwardKey | The flag to send the key event directly to the edit field. |
Remarks
This function sends a key down or up event with the key mask to the client application. If forwardKey is true, this key event goes to the edit filed directly. And if forwardKey is false, the ProcessKey event receives the key event before the edit field.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static void SetDataRequestedCallback(InputMethodEditor.OutArrayAction<byte> imDataRequested)
Parameters
| Type | Name | Description |
|---|---|---|
| InputMethodEditor.OutArrayAction<byte> | imDataRequested | Called when an associated text input UI control requests the application specific data from the input panel, requesting for data array and it's length. |
Declaration
C#Copypublic static void SetGeometryRequestedCallback(InputMethodEditor.OutAction<InputMethodEditor.Rect> geometryRequested)
Parameters
| Type | Name | Description |
|---|---|---|
| InputMethodEditor.OutAction<InputMethodEditor.Rect> | geometryRequested | Called when an associated text input UI control requests the position and size from the input panel, requesting for x, y, w, h values. |
Declaration
C#Copypublic static void SetLanguageRequestedCallback(InputMethodEditor.OutAction<string> languageRequested)
Parameters
| Type | Name | Description |
|---|---|---|
| InputMethodEditor.OutAction<string> | languageRequested | Called when an associated text input UI control requests the language from the input panel, requesting for language code. |
SetProcessKeyCallback(BoolAction<KeyCode, KeyMask, InputMethodDeviceInformation>)
Sets the processKey action. If the key event is from the external device, DeviceInfo will have its name, class, and subclass information.
Declaration
C#Copypublic static void SetProcessKeyCallback(InputMethodEditor.BoolAction<KeyCode, KeyMask, InputMethodDeviceInformation> processKey)
Parameters
| Type | Name | Description |
|---|---|---|
| InputMethodEditor.BoolAction<KeyCode, KeyMask, InputMethodDeviceInformation> | processKey | The action is called when the key event is received from the external devices or the SendKey function. This Event processes the key event before an associated text input UI control does. |
Declaration
C#Copypublic static void SetSelection(int start, int end)
Parameters
| Type | Name | Description |
|---|---|---|
| int | start | The start cursor position in text (in characters not bytes). |
| int | end | The end cursor position in text (in characters not bytes). |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Declaration
C#Copypublic static void ShowPreEditString()
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
UpdatePreEditString(string, IEnumerable<PreEditAttribute>)
Updates a new pre-edit string.
Declaration
C#Copypublic static void UpdatePreEditString(string str, IEnumerable<PreEditAttribute> attrs)
Parameters
| Type | Name | Description |
|---|---|---|
| string | str | The string to be updated in pre-edit. |
| System.Collections.Generic.IEnumerable<T><PreEditAttribute> | attrs | The list which has ime_preedit_attribute lists, strings can be composed of multiple string attributes: underline, highlight color, and reversal color. The attrs list can be empty if no attributes to set. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | This can occur due to the following reasons:
|
Events
AccessibilityStateChanged
Called when Accessibility in settings application is on or off.
Declaration
C#Copypublic static event EventHandler<AccessibilityStateChangedEventArgs> AccessibilityStateChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><AccessibilityStateChangedEventArgs> |
CursorPositionUpdated
Called when the position of the cursor in an associated text input UI control changes.
Declaration
C#Copypublic static event EventHandler<CursorPositionUpdatedEventArgs> CursorPositionUpdated
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><CursorPositionUpdatedEventArgs> |
Declaration
C#Copypublic static event EventHandler<SetDataEventArgs> DataSet
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><SetDataEventArgs> |
Declaration
C#Copypublic static event EventHandler<DisplayLanguageChangedEventArgs> DisplayLanguageChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><DisplayLanguageChangedEventArgs> |
Declaration
C#Copypublic static event EventHandler<FocusedInEventArgs> FocusedIn
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><FocusedInEventArgs> |
Declaration
C#Copypublic static event EventHandler<FocusedOutEventArgs> FocusedOut
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><FocusedOutEventArgs> |
InputContextReset
Called to reset the input context of an associated text input UI control.
Declaration
C#Copypublic static event EventHandler<EventArgs> InputContextReset
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><System.EventArgs> |
LanguageSet
Called to set the preferred language to the input panel. It will only be called when the client application changes the edit field's language attribute after the input panel is shown.
Declaration
C#Copypublic static event EventHandler<LanguageSetEventArgs> LanguageSet
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><LanguageSetEventArgs> |
LayoutSet
Called when an associated text input UI control requests the input panel to set its layout. It will only be called when the client application changes the edit field's layout attribute after the input panel is shown.
Declaration
C#Copypublic static event EventHandler<LayoutSetEventArgs> LayoutSet
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><LayoutSetEventArgs> |
ReturnKeySet
Called when an associated text input UI control requests the input panel to set the Return key label. The input panel can show the text or an image on the Return button, according to the Return key action.
Declaration
C#Copypublic static event EventHandler<ReturnKeySetEventArgs> ReturnKeySet
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><ReturnKeySetEventArgs> |
ReturnKeyStateSet
Called when an associated text input UI control requests the input panel to enable or disable the Return key state.
Declaration
C#Copypublic static event EventHandler<ReturnKeyStateSetEventArgs> ReturnKeyStateSet
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><ReturnKeyStateSetEventArgs> |
Declaration
C#Copypublic static event EventHandler<RotationChangedEventArgs> RotationChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RotationChangedEventArgs> |
SurroundingTextUpdated
Called when an associated text input UI control responds to a request with the surrounding text.
Declaration
C#Copypublic static event EventHandler<SurroundingTextUpdatedEventArgs> SurroundingTextUpdated
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><SurroundingTextUpdatedEventArgs> |