Class InputMethodEditor
Definition
- Namespace:
- Tizen.Uix.InputMethod
- Assembly:
- Tizen.Uix.InputMethod.dll
- API Level:
- 4
This class contains the API's related to the IME (Input method editor).
C#Copypublic static class InputMethodEditor
- Inheritance
-
System.ObjectInputMethodEditor
Methods
CommitContent(String, String, String)
Commits contents such as image to the associated text input UI control.
Declaration
C#Copypublic static void CommitContent(string content, string description, string mimeType)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | The content URI to be sent. |
System.String | description | The content description. |
System.String | mimeType | The MIME type received from the MimeTypeSetRequest |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void CommitString(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | The string to be committed. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void DeleteSurroundingText(int offset, int len)
Parameters
Type | Name | Description |
---|---|---|
Int32 | offset | The offset value from the cursor position. |
Int32 | len | The length of the text to delete. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | This exception can be due to an invalid parameter. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copy[Obsolete("Deprecated since API10. Will be removed in API12.")] public static EditorWindow GetMainWindow()
Returns
Type | Description |
---|---|
EditorWindow | The input panel main window object on success, otherwise null. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | This can occur due to the following reasons: 1) The IME main loop has not started yet. 2) Operation failed. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static string GetSelectedText()
Returns
Type | Description |
---|---|
System.String | The selected text. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
GetSurroundingText(Int32, Int32, out String, out Int32)
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 |
---|---|---|
Int32 | maxLenBefore | The maximum length of the string to be retrieved before the cursor, -1 means unlimited. |
Int32 | maxLenAfter | The maximum length of the string to be retrieved after the cursor, -1 means unlimited. |
System.String | text | The surrounding text. |
Int32 | cursorPosition | The cursor position. |
Exceptions
Type | Condition |
---|---|
OutOfMemoryException | This exception can be due to out of memory. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void HidePreEditString()
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void RequestHide()
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 5
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
RequestSurroundingText(Int32, Int32)
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 |
---|---|---|
Int32 | maxLenBefore | The maximum length of the string to be retrieved before the cursor, -1 means unlimited. |
Int32 | maxLenAfter | The maximum length of the string to be retrieved after the cursor, -1 means unlimited. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | This can occur due to the following reasons: 1) The IME main loop has not started yet. 2) The necessary event is not set. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Run(Action, Action, Action<InputMethodEditor.ContextId, InputMethodContext>, Action<InputMethodEditor.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<InputMethodEditor.ContextId, InputMethodContext> | show | This is called when the IME application is shown. It provides the context information and the context ID. |
System.Action<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 |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | This exception can be due to operation failed. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SendCustomGeometryUpdated()
Notifies the changed geometry of input panel window to the associated text input UI control.
Declaration
C#Copypublic static void SendCustomGeometryUpdated()
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SendKeyEvent(KeyCode, KeyMask, Boolean)
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. |
Boolean | 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 |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SendLanguageUpdated()
Notifies the changed language of the input panel to the the associated text input UI control.
Declaration
C#Copypublic static void SendLanguageUpdated()
Remarks
LanguageRequestedCallback is raised after this API is called when the App requests changed language information.
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SendPrivateCommand(String)
Sends a private command to the associated text input UI control.
Declaration
C#Copypublic static void SendPrivateCommand(string command)
Parameters
Type | Name | Description |
---|---|---|
System.String | command | The UTF-8 string to be sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SendShiftModeUpdated(Boolean)
Sends the changed shift mode of the input panel to the the associated text input UI control.
Declaration
C#Copypublic static void SendShiftModeUpdated(bool enable)
Parameters
Type | Name | Description |
---|---|---|
Boolean | enable |
|
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SetCandidateVisibilityState(Boolean)
Sets whether candidate strings will be shown or not.
Declaration
C#Copypublic static void SetCandidateVisibilityState(bool visible)
Parameters
Type | Name | Description |
---|---|---|
Boolean | visible |
|
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 10
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SetDataRequestedCallback(InputMethodEditor.OutArrayAction<Byte>)
Sets the imDataRequested action.
Declaration
C#Copypublic static void SetDataRequestedCallback(InputMethodEditor.OutArrayAction<byte> imDataRequested)
Parameters
Type | Name | Description |
---|---|---|
InputMethodEditor.OutArrayAction<System.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. |
API Level: 4
SetFloatingDragEnd()
Does not allow the movement of the floating input panel window with the mouse pointer when the mouse is pressed.
Declaration
C#Copypublic static void SetFloatingDragEnd()
Remarks
This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 5
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SetFloatingDragStart()
Allows the floating input panel window to move along with the mouse pointer when the mouse is pressed.
Declaration
C#Copypublic static void SetFloatingDragStart()
Remarks
This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 5
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void SetFloatingMode(bool floatingMode)
Parameters
Type | Name | Description |
---|---|---|
Boolean | floatingMode |
|
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 5
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SetGeometryRequestedCallback(InputMethodEditor.OutAction<InputMethodEditor.Rect>)
Sets the GeometryRequested action.
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. |
API Level: 4
SetLanguageRequestedCallback(InputMethodEditor.OutAction<String>)
Sets the languageRequested action.
Declaration
C#Copypublic static void SetLanguageRequestedCallback(InputMethodEditor.OutAction<string> languageRequested)
Parameters
Type | Name | Description |
---|---|---|
InputMethodEditor.OutAction<System.String> | languageRequested | Called when an associated text input UI control requests the language from the input panel, requesting for language code. |
API Level: 4
SetProcessKeyCallback(InputMethodEditor.BoolAction<UInt32, 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<uint, KeyCode, KeyMask, InputMethodDeviceInformation> processKey)
Parameters
Type | Name | Description |
---|---|---|
InputMethodEditor.BoolAction<System.UInt32, KeyCode, KeyMask, InputMethodDeviceInformation> | processKey |
|
API Level: 10
SetProcessKeyCallback(InputMethodEditor.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. |
API Level: 4
Declaration
C#Copypublic static void SetSelection(int start, int end)
Parameters
Type | Name | Description |
---|---|---|
Int32 | start | The start cursor position in text (in characters not bytes). |
Int32 | end | The end cursor position in text (in characters not bytes). |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | This exception can be due to an invalid parameter. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
SetSize(IntPtr, Int32, Int32, Int32, Int32)
This API updates the given native input panel window's size information. The native window handle of NUI Window can be got by below code. var handle = new Window.SafeNativeWindowHandle(); IntPtr nativeHandle = handle.DangerousGetHandle();
Declaration
C#Copypublic static void SetSize(IntPtr window, int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | window | The native window handle. |
Int32 | portraitWidth | The width in the portrait mode. |
Int32 | portraitHeight | The height in the portrait mode. |
Int32 | landscapeWidth | The width in the landscape mode. |
Int32 | landscapeHeight | The height in the landscape mode. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | This exception can be due to an invalid parameter. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 9
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void ShowPreEditString()
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
Declaration
C#Copypublic static void UpdatePreeditCursor(uint position)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | position | The cursor position in the preedit string. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 10
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
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 |
---|---|---|
System.String | str | The string to be updated in pre-edit. |
System.Collections.Generic.IEnumerable<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 |
---|---|
UnauthorizedAccessException | This exception can be due to permission denied. |
System.InvalidOperationException | The IME main loop has not started yet. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/ime
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<AccessibilityStateChangedEventArgs> |
API Level: 4
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<CursorPositionUpdatedEventArgs> |
API Level: 4
Declaration
C#Copypublic static event EventHandler<SetDataEventArgs> DataSet
Event Type
Type | Description |
---|---|
System.EventHandler<SetDataEventArgs> |
API Level: 4
Declaration
C#Copypublic static event EventHandler<DisplayLanguageChangedEventArgs> DisplayLanguageChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DisplayLanguageChangedEventArgs> |
API Level: 4
Declaration
C#Copypublic static event EventHandler<FocusedInEventArgs> FocusedIn
Event Type
Type | Description |
---|---|
System.EventHandler<FocusedInEventArgs> |
API Level: 4
Declaration
C#Copypublic static event EventHandler<FocusedOutEventArgs> FocusedOut
Event Type
Type | Description |
---|---|
System.EventHandler<FocusedOutEventArgs> |
API Level: 4
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<EventArgs> |
API Level: 4
InputHintSet
Called when an associated text input UI control requests the input panel to set its input hint. It will only be called when the client application changes the edit field's input hint attribute after the input panel is shown.
Declaration
C#Copypublic static event EventHandler<InputHintSetEventArgs> InputHintSet
Event Type
Type | Description |
---|---|
System.EventHandler<InputHintSetEventArgs> |
See Also
API Level: 10
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<LanguageSetEventArgs> |
API Level: 4
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<LayoutSetEventArgs> |
API Level: 4
MimeTypeUpdateRequested
Called when an associated text input UI control requests the text entry to set the MIME type.
Declaration
C#Copypublic static event EventHandler<MimeTypeUpdateRequestedEventArgs> MimeTypeUpdateRequested
Event Type
Type | Description |
---|---|
System.EventHandler<MimeTypeUpdateRequestedEventArgs> |
API Level: 6
PredictionHintDataUpdated
Called to set the prediction hint key and value to deliver to the input panel.
Declaration
C#Copypublic static event EventHandler<PredictionHintDataUpdatedEventArgs> PredictionHintDataUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<PredictionHintDataUpdatedEventArgs> |
API Level: 6
PredictionHintUpdated
Called to set the prediction hint string to deliver to the input panel.
Declaration
C#Copypublic static event EventHandler<PredictionHintUpdatedEventArgs> PredictionHintUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<PredictionHintUpdatedEventArgs> |
API Level: 6
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<ReturnKeySetEventArgs> |
API Level: 4
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<ReturnKeyStateSetEventArgs> |
API Level: 4
Declaration
C#Copypublic static event EventHandler<RotationChangedEventArgs> RotationChanged
Event Type
Type | Description |
---|---|
System.EventHandler<RotationChangedEventArgs> |
API Level: 4
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<SurroundingTextUpdatedEventArgs> |