harmony 鸿蒙InputMethod

2025-06-12 浏览 (11)

InputMethod

Overview

The InputMethod module provides methods for using and developing input methods.

Since: 12

Summary

Files

NameDescription
inputmethod_attach_options_capi.hProvides methods for creating, destroying, reading, and writing the option object bound to the input method.
inputmethod_controller_capi.hProvides methods for binding and unbinding input methods.
inputmethod_cursor_info_capi.hProvides methods for creating, destroying, reading, and writing cursor information objects.
inputmethod_inputmethod_proxy_capi.hProvides methods for using the input method, allowing requests and notifications to be sent to the input method application.
inputmethod_private_command_capi.hProvides methods for creating, destroying, reading, and writing private data objects.
inputmethod_text_avoid_info_capi.hProvides methods for creating, destroying, reading, and writing the text box avoidance information objects.
inputmethod_text_config_capi.hProvides methods for creating, destroying, reading, and writing the text box configuration information objects.
inputmethod_text_editor_proxy_capi.hProvides a set of methods for the custom text box developed by the application to obtain notifications and requests from the input method application.
inputmethod_types_capi.hDefines the types related to the input method.

Types

NameDescription
InputMethod_AttachOptionsOptions for binding the input method.
InputMethod_CursorInfoCursor information.
InputMethod_InputMethodProxyInput method proxy object.
InputMethod_PrivateCommandPrivate data.
InputMethod_TextAvoidInfoText box avoidance information.
InputMethod_TextConfigText box configuration.
InputMethod_TextEditorProxyText box proxy.
typedef void(* OH_TextEditorProxy_GetTextConfigFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config)Function called when the input method obtains the text box configuration.
typedef void(* OH_TextEditorProxy_InsertTextFunc) (InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length)Function called when the input method application inserts text.
typedef void(* OH_TextEditorProxy_DeleteForwardFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t length)Function called when the input method deletes the text on the right of the cursor.
typedef void(* OH_TextEditorProxy_DeleteBackwardFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t length)Function called when the input method deletes the text on the left of the cursor.
typedef void(* OH_TextEditorProxy_SendKeyboardStatusFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus)Function called when the input method notifies the keyboard status.
typedef void(* OH_TextEditorProxy_SendEnterKeyFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType)Function called when the Enter key is pressed in the input method.
typedef void(* OH_TextEditorProxy_MoveCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction)Function called when the cursor is moved in the input method.
typedef void(* OH_TextEditorProxy_HandleSetSelectionFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end)Function called when the input method requests to select text.
typedef void(* OH_TextEditorProxy_HandleExtendActionFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action)Function called when the input method sends an extended editing operation.
typedef void(* OH_TextEditorProxy_GetLeftTextOfCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)Function called when the input method obtains the text on the left of the cursor.
typedef void(* OH_TextEditorProxy_GetRightTextOfCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)Function called when the input method obtains the text on the right of the cursor.
typedef int32_t(* OH_TextEditorProxy_GetTextIndexAtCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy)Function called when the input method obtains the index of the text where the cursor is located in the text box.
typedef int32_t(* OH_TextEditorProxy_ReceivePrivateCommandFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size)Function called when the input method application sends a private data command.
typedef int32_t(* OH_TextEditorProxy_SetPreviewTextFunc) (InputMethod_TextEditorProxy *textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end)Function called when the input method sets the text preview feature.
typedef void(* OH_TextEditorProxy_FinishTextPreviewFunc) (InputMethod_TextEditorProxy *textEditorProxy)Function called when the input method ends the text preview feature.
InputMethod_KeyboardStatusKeyboard status.
InputMethod_EnterKeyTypeEnter function type.
InputMethod_DirectionMoving direction.
InputMethod_ExtendActionType of the extended edit action on the text box.
InputMethod_TextInputTypeText input type.
InputMethod_CommandValueTypePrivate data type.
InputMethod_ErrorCodeError code of the input method.

Enums

NameDescription
InputMethod_KeyboardStatus {
IME_KEYBOARD_STATUS_NONE = 0,
IME_KEYBOARD_STATUS_HIDE = 1,
IME_KEYBOARD_STATUS_SHOW = 2
}
Keyboard status.
InputMethod_EnterKeyType {
IME_ENTER_KEY_UNSPECIFIED = 0,
IME_ENTER_KEY_NONE = 1,
IME_ENTER_KEY_GO = 2,
IME_ENTER_KEY_SEARCH = 3,
IME_ENTER_KEY_SEND = 4,
IME_ENTER_KEY_NEXT = 5,
IME_ENTER_KEY_DONE = 6,
IME_ENTER_KEY_PREVIOUS = 7,
IME_ENTER_KEY_NEWLINE = 8
}
Enter function type.
InputMethod_Direction {
IME_DIRECTION_NONE = 0,
IME_DIRECTION_UP = 1,
IME_DIRECTION_DOWN = 2,
IME_DIRECTION_LEFT = 3,
IME_DIRECTION_RIGHT = 4
}
Moving direction.
InputMethod_ExtendAction {
IME_EXTEND_ACTION_SELECT_ALL = 0,
IME_EXTEND_ACTION_CUT = 3,
IME_EXTEND_ACTION_COPY = 4,
IME_EXTEND_ACTION_PASTE = 5
}
Type of the extended edit action on the text box.
InputMethod_TextInputType {
IME_TEXT_INPUT_TYPE_NONE = -1,
IME_TEXT_INPUT_TYPE_TEXT = 0,
IME_TEXT_INPUT_TYPE_MULTILINE = 1,
IME_TEXT_INPUT_TYPE_NUMBER = 2,
IME_TEXT_INPUT_TYPE_PHONE = 3,
IME_TEXT_INPUT_TYPE_DATETIME = 4,
IME_TEXT_INPUT_TYPE_EMAIL_ADDRESS = 5,
IME_TEXT_INPUT_TYPE_URL = 6,
IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORD = 7,
IME_TEXT_INPUT_TYPE_NUMBER_PASSWORD = 8,
IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORD = 9,
IME_TEXT_INPUT_TYPE_USER_NAME = 10,
IME_TEXT_INPUT_TYPE_NEW_PASSWORD = 11,
IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL = 12
}
Text input type.
InputMethod_CommandValueType {
IME_COMMAND_VALUE_TYPE_NONE = 0,
IME_COMMAND_VALUE_TYPE_STRING = 1,
IME_COMMAND_VALUE_TYPE_BOOL = 2,
IME_COMMAND_VALUE_TYPE_INT32 = 3
}
Private data type.
InputMethod_ErrorCode {
IME_ERR_OK = 0, IME_ERR_UNDEFINED = 1,
IME_ERR_PARAMCHECK = 401,
IME_ERR_PACKAGEMANAGER = 12800001,
IME_ERR_IMENGINE = 12800002,
IME_ERR_IMCLIENT = 12800003,
IME_ERR_CONFIG_PERSIST = 12800005,
IME_ERR_CONTROLLER = 12800006,
IME_ERR_SETTINGS = 12800007,
IME_ERR_IMMS = 12800008,
IME_ERR_DETACHED = 12800009,
IME_ERR_NULL_POINTER = 12802000,
IME_ERR_QUERY_FAILED = 12802001
}
Error code of the input method.

Functions

NameDescription
InputMethod_AttachOptions * OH_AttachOptions_Create (bool showKeyboard)Creates an InputMethod_AttachOptions instance.
void OH_AttachOptions_Destroy (InputMethod_AttachOptions *options)Destroys an InputMethod_AttachOptions instance.
InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard (InputMethod_AttachOptions *options, bool *showKeyboard)Obtains the configured value that indicates whether to display the keyboard from InputMethod_AttachOptions.
InputMethod_ErrorCode OH_InputMethodController_Attach (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_AttachOptions *options, InputMethod_InputMethodProxy **inputMethodProxy)Binds an application to the input method service.
InputMethod_ErrorCode OH_InputMethodController_Detach (InputMethod_InputMethodProxy *inputMethodProxy)Unbinds an application from the input method service.
InputMethod_CursorInfo * OH_CursorInfo_Create (double left, double top, double width, double height)Creates an InputMethod_CursorInfo instance.
void OH_CursorInfo_Destroy (InputMethod_CursorInfo *cursorInfo)Destroys an InputMethod_CursorInfo instance.
InputMethod_ErrorCode OH_CursorInfo_SetRect (InputMethod_CursorInfo *cursorInfo, double left, double top, double width, double height)Sets the cursor information.
InputMethod_ErrorCode OH_CursorInfo_GetRect (InputMethod_CursorInfo *cursorInfo, double *left, double *top, double *width, double *height)Obtains the cursor information.
InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard (InputMethod_InputMethodProxy *inputMethodProxy)Displays the keyboard.
InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard (InputMethod_InputMethodProxy *inputMethodProxy)Hides the keyboard.
InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange (InputMethod_InputMethodProxy *inputMethodProxy, char16_t text[], size_t length, int start, int end)Notifies the change of the text selection area in the text box.
InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange (InputMethod_InputMethodProxy *inputMethodProxy, InputMethod_EnterKeyType enterKey, InputMethod_TextInputType textType)Notifies the change of the text box configuration.
InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate (InputMethod_InputMethodProxy *inputMethodProxy, InputMethod_CursorInfo *cursorInfo)Notifies the cursor position change.
InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand (InputMethod_InputMethodProxy *inputMethodProxy, InputMethod_PrivateCommand *privateCommand[], size_t size)Sends a private data command.
InputMethod_PrivateCommand * OH_PrivateCommand_Create (char key[], size_t keyLength)Creates an InputMethod_PrivateCommand instance.
void OH_PrivateCommand_Destroy (InputMethod_PrivateCommand *command)Destroys an InputMethod_PrivateCommand instance.
InputMethod_ErrorCode OH_PrivateCommand_SetKey (InputMethod_PrivateCommand *command, char key[], size_t keyLength)Sets the key value for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue (InputMethod_PrivateCommand *command, bool value)Sets the value of the Boolean type for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_SetIntValue (InputMethod_PrivateCommand *command, int32_t value)Sets the value of the integer type for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_SetStrValue (InputMethod_PrivateCommand *command, char value[], size_t valueLength)Sets the value of the character string type for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetKey (InputMethod_PrivateCommand *command, const char **key, size_t *keyLength)Obtains the key value from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetValueType (InputMethod_PrivateCommand *command, InputMethod_CommandValueType *type)Obtains the data type of value from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue (InputMethod_PrivateCommand *command, bool *value)Obtains the value of the Boolean type from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetIntValue (InputMethod_PrivateCommand *command, int32_t *value)Obtains the value of the integer type from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetStrValue (InputMethod_PrivateCommand *command, const char **value, size_t *valueLength)Obtains the value of the character string type from InputMethod_PrivateCommand.
InputMethod_TextAvoidInfo * OH_TextAvoidInfo_Create (double positionY, double height)Creates an InputMethod_TextAvoidInfo instance.
void OH_TextAvoidInfo_Destroy (InputMethod_TextAvoidInfo *info)Destroys an InputMethod_TextAvoidInfo instance.
InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY (InputMethod_TextAvoidInfo *info, double positionY)Sets the Y coordinate in InputMethod_TextAvoidInfo.
InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight (InputMethod_TextAvoidInfo *info, double height)Sets the height in InputMethod_TextAvoidInfo.
InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY (InputMethod_TextAvoidInfo *info, double *positionY)Obtains the Y coordinate from InputMethod_TextAvoidInfo.
InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight (InputMethod_TextAvoidInfo *info, double *height)Obtains the height from InputMethod_TextAvoidInfo.
InputMethod_TextConfig * OH_TextConfig_Create ()Creates an InputMethod_TextConfig instance.
void OH_TextConfig_Destroy (InputMethod_TextConfig *config)Destroys an InputMethod_TextConfig instance.
InputMethod_ErrorCode OH_TextConfig_SetInputType (InputMethod_TextConfig *config, InputMethod_TextInputType inputType)Sets the text box type for InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType (InputMethod_TextConfig *config, InputMethod_EnterKeyType enterKeyType)Sets the Enter function type for InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport (InputMethod_TextConfig *config, bool supported)Sets the text preview feature for InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_SetSelection (InputMethod_TextConfig *config, int32_t start, int32_t end)Sets the selected text area for InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_SetWindowId (InputMethod_TextConfig *config, int32_t windowId)Sets the ID of the window to which InputMethod_TextConfig belongs.
InputMethod_ErrorCode OH_TextConfig_GetInputType (InputMethod_TextConfig *config, InputMethod_TextInputType *inputType)Obtains the text box type of InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType (InputMethod_TextConfig *config, InputMethod_EnterKeyType *enterKeyType)Obtains the Enter function type of InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported (InputMethod_TextConfig *config, bool *supported)Obtains the text preview settings of InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_GetCursorInfo (InputMethod_TextConfig *config, InputMethod_CursorInfo **cursorInfo)Obtains the cursor information of InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo (InputMethod_TextConfig *config, InputMethod_TextAvoidInfo **avoidInfo)Obtains the avoidance information of InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_GetSelection (InputMethod_TextConfig *config, int32_t *start, int32_t *end)Obtains the selected text area of InputMethod_TextConfig.
InputMethod_ErrorCode OH_TextConfig_GetWindowId (InputMethod_TextConfig *config, int32_t *windowId)Obtains the ID of the window to which InputMethod_TextConfig belongs.
InputMethod_TextEditorProxy * OH_TextEditorProxy_Create ()Creates an InputMethod_TextEditorProxy instance.
void OH_TextEditorProxy_Destroy (InputMethod_TextEditorProxy *proxy)Destroys an InputMethod_TextEditorProxy instance.
InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc)Sets the OH_TextEditorProxy_GetTextConfigFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc)Sets the OH_TextEditorProxy_InsertTextFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc)Sets the OH_TextEditorProxy_DeleteForwardFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc)Sets the OH_TextEditorProxy_DeleteBackwardFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc)Sets the OH_TextEditorProxy_SendKeyboardStatusFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc)Sets the OH_TextEditorProxy_SetSendEnterKeyFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc)Sets the OH_TextEditorProxy_SetMoveCursorFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc)Sets the OH_TextEditorProxy_HandleSetSelectionFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc)Sets the OH_TextEditorProxy_HandleExtendActionFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc)Sets the OH_TextEditorProxy_GetLeftTextOfCursorFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc)Sets the OH_TextEditorProxy_GetRightTextOfCursorFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc)Sets the OH_TextEditorProxy_GetTextIndexAtCursorFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc)Sets the OH_TextEditorProxy_ReceivePrivateCommandFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc)Sets the OH_TextEditorProxy_SetPreviewTextFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc)Sets the OH_TextEditorProxy_FinishTextPreviewFunc function to InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFunc)Obtains the OH_TextEditorProxy_GetTextConfigFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc *insertTextFunc)Obtains the OH_TextEditorProxy_InsertTextFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFunc)Obtains the OH_TextEditorProxy_DeleteForwardFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFunc)Obtains the OH_TextEditorProxy_DeleteBackwardFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFunc)Obtains the OH_TextEditorProxy_SendKeyboardStatusFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFunc)Obtains the OH_TextEditorProxy_SendEnterKeyFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc *moveCursorFunc)Obtains the OH_TextEditorProxy_MoveCursorFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFunc)Obtains the OH_TextEditorProxy_HandleSetSelectionFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFunc)Obtains the OH_TextEditorProxy_HandleExtendActionFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFunc)Obtains the OH_TextEditorProxy_GetLeftTextOfCursorFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFunc)Obtains the OH_TextEditorProxy_GetRightTextOfCursorFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFunc)Obtains the OH_TextEditorProxy_GetTextIndexAtCursorFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFunc)Obtains the OH_TextEditorProxy_ReceivePrivateCommandFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFunc)Obtains the OH_TextEditorProxy_SetPreviewTextFunc function from InputMethod_TextEditorProxy.
InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc (InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFunc)Obtains the OH_TextEditorProxy_FinishTextPreviewFunc function from InputMethod_TextEditorProxy.

Type Description

InputMethod_AttachOptions

typedef struct InputMethod_AttachOptions InputMethod_AttachOptions

Description

Options carried when the input method is bound.

Since: 12

InputMethod_CommandValueType

typedef enum InputMethod_CommandValueType InputMethod_CommandValueType

Description

Private data type.

Since: 12

InputMethod_CursorInfo

typedef struct InputMethod_CursorInfo InputMethod_CursorInfo

Description

Coordinates, width, and height of the cursor.

Since: 12

InputMethod_Direction

typedef enum InputMethod_Direction InputMethod_Direction

Description

Moving direction.

Since: 12

InputMethod_EnterKeyType

typedef enum InputMethod_EnterKeyType InputMethod_EnterKeyType

Description

Enter function type.

Since: 12

InputMethod_ErrorCode

typedef enum InputMethod_ErrorCode InputMethod_ErrorCode

Description

Error code of the input method.

Since: 12

InputMethod_ExtendAction

typedef enum InputMethod_ExtendAction InputMethod_ExtendAction

Description

Type of the extended edit action on the text box.

Since: 12

InputMethod_InputMethodProxy

typedef struct InputMethod_InputMethodProxy InputMethod_InputMethodProxy

Description

Input method proxy object.

This object can be used to call the method for using the input method.

Since: 12

InputMethod_KeyboardStatus

typedef enum InputMethod_KeyboardStatus InputMethod_KeyboardStatus

Description

Keyboard status.

Since: 12

InputMethod_PrivateCommand

typedef struct InputMethod_PrivateCommand InputMethod_PrivateCommand

Description

Private data.

It refers to the private data exchanged between the text box and the input method application.

Since: 12

InputMethod_TextAvoidInfo

typedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo

Description

Information of the text box used to avoid the keyboard.

Since: 12

InputMethod_TextConfig

typedef struct InputMethod_TextConfig InputMethod_TextConfig

Description

Text box configuration.

Since: 12

InputMethod_TextEditorProxy

typedef struct InputMethod_TextEditorProxy InputMethod_TextEditorProxy

Description

Text box proxy.

It provides methods for obtaining notifications and requests from the input method application.

Since: 12

InputMethod_TextInputType

typedef enum InputMethod_TextInputType InputMethod_TextInputType

Description

Text input type.

Since: 12

OH_TextEditorProxy_DeleteBackwardFunc

typedef void(* OH_TextEditorProxy_DeleteBackwardFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t length)

Description

Function called when the input method deletes the text on the left of the cursor.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
lengthLength of the characters to be deleted.

OH_TextEditorProxy_DeleteForwardFunc

typedef void(* OH_TextEditorProxy_DeleteForwardFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t length)

Description

Function called when the input method deletes the text on the right of the cursor.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
lengthLength of the characters to be deleted.

OH_TextEditorProxy_FinishTextPreviewFunc

typedef void(* OH_TextEditorProxy_FinishTextPreviewFunc) (InputMethod_TextEditorProxy *textEditorProxy)

Description

Function called when the input method ends the text preview feature.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.

OH_TextEditorProxy_GetLeftTextOfCursorFunc

typedef void(* OH_TextEditorProxy_GetLeftTextOfCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)

Description

Function called when the input method obtains the text on the left of the cursor.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
numberLength of the text to be obtained.
textText content of a specified length on the left of the cursor. You need to assign a value to the text content in the function implementation.

OH_TextEditorProxy_GetRightTextOfCursorFunc

typedef void(* OH_TextEditorProxy_GetRightTextOfCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)

Description

Function called when the input method obtains the text on the right of the cursor.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
numberLength of the text to be obtained.
textText content of a specified length on the right of the cursor. You need to assign a value to the text content in the function implementation.

OH_TextEditorProxy_GetTextConfigFunc

typedef void(* OH_TextEditorProxy_GetTextConfigFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config)

Description

Function called when the input method obtains the text box configuration.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters:

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
configText box configuration.

OH_TextEditorProxy_GetTextIndexAtCursorFunc

typedef int32_t(* OH_TextEditorProxy_GetTextIndexAtCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy)

Description

Function called when the input method obtains the index of the text where the cursor is located in the text box.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.

Returns:

Index of the text where the cursor is located.

OH_TextEditorProxy_HandleExtendActionFunc

typedef void(* OH_TextEditorProxy_HandleExtendActionFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action)

Description

Function called when the input method sends an extended editing operation.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
actionExtended editing operation. For details, see InputMethod_ExtendAction.

OH_TextEditorProxy_HandleSetSelectionFunc

typedef void(* OH_TextEditorProxy_HandleSetSelectionFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end)

Description

Function called when the input method requests to select text.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
startStart position of the selected text.
endEnd position of the selected text.

OH_TextEditorProxy_InsertTextFunc

typedef void(* OH_TextEditorProxy_InsertTextFunc) (InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length)

Description

Function called when the input method application inserts text.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
textCharacters to be inserted.
lengthLength of the characters to be inserted.

OH_TextEditorProxy_MoveCursorFunc

typedef void(* OH_TextEditorProxy_MoveCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction)

Description

Function called when the cursor is moved in the input method.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
directionCursor moving direction. For details, see InputMethod_Direction.

OH_TextEditorProxy_ReceivePrivateCommandFunc

typedef int32_t(* OH_TextEditorProxy_ReceivePrivateCommandFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size)

Description

Function called when the input method application sends a private data command.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
privateCommandPrivate data command.
sizeSize of the private data.

Returns:

Processing result of the private data command.

OH_TextEditorProxy_SendEnterKeyFunc

typedef void(* OH_TextEditorProxy_SendEnterKeyFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType)

Description

Function called when the Enter key is pressed in the input method.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
enterKeyTypeEnter key type. For details, see InputMethod_EnterKeyType.

OH_TextEditorProxy_SendKeyboardStatusFunc

typedef void(* OH_TextEditorProxy_SendKeyboardStatusFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus)

Description

Function called when the input method notifies the keyboard status.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
keyboardStatusKeyboard status. For details, see InputMethod_KeyboardStatus.

OH_TextEditorProxy_SetPreviewTextFunc

typedef int32_t(* OH_TextEditorProxy_SetPreviewTextFunc) (InputMethod_TextEditorProxy *textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end)

Description

Function called when the input method sets the text preview feature.

Implement this function, set it to InputMethod_TextEditorProxy, and register it using OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
textText requested to be previewed.
lengthLength of the text to be previewed.
startStarting cursor position of the text to be previewed.
endEnding cursor position of the text to be previewed.

Returns:

Result of setting text preview.

Enum Description

InputMethod_CommandValueType

enum InputMethod_CommandValueType

Description

Private data type.

Since: 12

ValueDescription
IME_COMMAND_VALUE_TYPE_NONENONE.
IME_COMMAND_VALUE_TYPE_STRINGString.
IME_COMMAND_VALUE_TYPE_BOOLBoolean.
IME_COMMAND_VALUE_TYPE_INT3232-bit signed integer.

InputMethod_Direction

enum InputMethod_Direction

Description

Moving direction.

Since: 12

ValueDescription
IME_DIRECTION_NONENONE.
IME_DIRECTION_UPUpward.
IME_DIRECTION_DOWNDownward.
IME_DIRECTION_LEFTTo the left.
IME_DIRECTION_RIGHTTo the right.

InputMethod_EnterKeyType

enum InputMethod_EnterKeyType

Description

Enter function type.

Since: 12

ValueDescription
IME_ENTER_KEY_UNSPECIFIEDNot specified.
IME_ENTER_KEY_NONENONE.
IME_ENTER_KEY_GOGo.
IME_ENTER_KEY_SEARCHSearch.
IME_ENTER_KEY_SENDSend.
IME_ENTER_KEY_NEXTNext.
IME_ENTER_KEY_DONEDone.
IME_ENTER_KEY_PREVIOUSPrevious.
IME_ENTER_KEY_NEWLINELine break.

InputMethod_ErrorCode

enum InputMethod_ErrorCode

Description

Error code of the input method.

Since: 12

ValueDescription
IME_ERR_OKSuccessful.
IME_ERR_UNDEFINEDQuery failed.
IME_ERR_PARAMCHECKParameter check failed.
IME_ERR_PACKAGEMANAGERPackage management error.
IME_ERR_IMENGINEInput method application error.
IME_ERR_IMCLIENTText box client error.
IME_ERR_CONFIG_PERSISTConfiguration persistence failed. This error code is reported when the configuration fails to be saved.
IME_ERR_CONTROLLERInput method controller error.
IME_ERR_SETTINGSInput method setter error.
IME_ERR_IMMSInput method manager service error.
IME_ERR_DETACHEDText box unbound.
IME_ERR_NULL_POINTERNull pointer.
IME_ERR_QUERY_FAILEDQuery failed.

InputMethod_ExtendAction

enum InputMethod_ExtendAction

Description

Type of the extended edit action on the text box.

Since: 12

ValueDescription
IME_EXTEND_ACTION_SELECT_ALLSelect all.
IME_EXTEND_ACTION_CUTCut.
IME_EXTEND_ACTION_COPYCopy.
IME_EXTEND_ACTION_PASTEPaste.

InputMethod_KeyboardStatus

enum InputMethod_KeyboardStatus

Description

Keyboard status.

Since: 12

ValueDescription
IME_KEYBOARD_STATUS_NONENONE.
IME_KEYBOARD_STATUS_HIDEInvisible.
IME_KEYBOARD_STATUS_SHOWVisible.

InputMethod_TextInputType

enum InputMethod_TextInputType

Description

Text input type.

Since: 12

ValueDescription
IME_TEXT_INPUT_TYPE_NONENONE.
IME_TEXT_INPUT_TYPE_TEXTText.
IME_TEXT_INPUT_TYPE_MULTILINEMulti-line.
IME_TEXT_INPUT_TYPE_NUMBERNumber.
IME_TEXT_INPUT_TYPE_PHONEPhone number.
IME_TEXT_INPUT_TYPE_DATETIMEDate.
IME_TEXT_INPUT_TYPE_EMAIL_ADDRESSEmail address.
IME_TEXT_INPUT_TYPE_URLURL.
IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORDPassword.
IME_TEXT_INPUT_TYPE_NUMBER_PASSWORDNumeric password.
IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORDLock screen password.
IME_TEXT_INPUT_TYPE_USER_NAMEUsername.
IME_TEXT_INPUT_TYPE_NEW_PASSWORDNew password.
IME_TEXT_INPUT_TYPE_NUMBER_DECIMALNUMBER DECIMAL.

Function Description

OH_AttachOptions_Create()

InputMethod_AttachOptions* OH_AttachOptions_Create (bool showKeyboard)

Description

Creates an InputMethod_AttachOptions instance.

Since: 12

Parameters

NameDescription
showKeyboardIndicates whether to display the keyboard.

Returns:

If the operation is successful, a pointer to the created InputMethod_AttachOptions instance is returned. If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_AttachOptions_Destroy()

void OH_AttachOptions_Destroy (InputMethod_AttachOptions * options)

Description

Destroys an InputMethod_AttachOptions instance.

Since: 12

Parameters

NameDescription
optionsInputMethod_AttachOptions instance to be destroyed.

OH_AttachOptions_IsShowKeyboard()

InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard (InputMethod_AttachOptions * options, bool * showKeyboard )

Description

Obtains the configured value that indicates whether to display the keyboard from InputMethod_AttachOptions.

Since: 12

Parameters

NameDescription
optionsInputMethod_AttachOptions instance whose value is read.
showKeyboardWhether to display the keyboard during binding. true: The keyboard is displayed after the binding is complete. false: The keyboard is hidden after the binding is complete.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_CursorInfo_Create()

InputMethod_CursorInfo* OH_CursorInfo_Create (double left, double top, double width, double height )

Description

Creates an InputMethod_CursorInfo instance.

Since: 12

Parameters

NameDescription
leftAbsolute value of the distance between the cursor's leftmost point and the left edge of the physical screen.
topAbsolute value of the distance between the cursor's top vertex and the top edge of the physical screen.
widthWidth.
heightHeight.

Returns:

If the operation is successful, a pointer to the created InputMethod_CursorInfo instance is returned. If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_CursorInfo_Destroy()

void OH_CursorInfo_Destroy (InputMethod_CursorInfo * cursorInfo)

Description

Destroys an InputMethod_CursorInfo instance.

Since: 12

Parameters

NameDescription
cursorInfoPointer to the InputMethod_CursorInfo instance to be destroyed.

OH_CursorInfo_GetRect()

InputMethod_ErrorCode OH_CursorInfo_GetRect (InputMethod_CursorInfo * cursorInfo, double * left, double * top, double * width, double * height )

Description

Obtains the cursor information.

Since: 12

Parameters

NameDescription
cursorInfoPointer to the InputMethod_CursorInfo instance.
leftAbsolute value of the distance between the cursor's leftmost point and the left edge of the physical screen.
topAbsolute value of the distance between the cursor's top vertex and the top edge of the physical screen.
widthWidth.
heightHeight.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_CursorInfo_SetRect()

InputMethod_ErrorCode OH_CursorInfo_SetRect (InputMethod_CursorInfo * cursorInfo, double left, double top, double width, double height )

Description

Sets the cursor information.

Since: 12

Parameters

NameDescription
cursorInfoPointer to the InputMethod_CursorInfo instance.
leftAbsolute value of the distance between the cursor's leftmost point and the left edge of the physical screen.
topAbsolute value of the distance between the cursor's top vertex and the top edge of the physical screen.
widthWidth.
heightHeight.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodController_Attach()

InputMethod_ErrorCode OH_InputMethodController_Attach (InputMethod_TextEditorProxy * textEditorProxy, InputMethod_AttachOptions * options, InputMethod_InputMethodProxy ** inputMethodProxy )

Description

Binds an application to the input method service.

Since: 12

Parameters

NameDescription
textEditorProxyPointer to the InputMethod_TextEditorProxy instance. The caller needs to manage the textEditorProxy lifespan. If the calling is successful, the caller cannot release textEditorProxy before the next binding or unbinding call.
optionsPointer to the InputMethod_AttachOptions instance, which is the option for binding.
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. The lifespan is maintained until the next binding or unbinding call.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_PARAMCHECK indicates the parameter error.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodController_Detach()

InputMethod_ErrorCode OH_InputMethodController_Detach (InputMethod_InputMethodProxy * inputMethodProxy)

Description

Unbinds an application from the input method service.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodProxy_HideKeyboard()

InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard (InputMethod_InputMethodProxy * inputMethodProxy)

Description

Hides the keyboard.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

IME_ERR_DETACHED indicates that no input method is bound.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodProxy_NotifyConfigurationChange()

InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange (InputMethod_InputMethodProxy * inputMethodProxy, InputMethod_EnterKeyType enterKey, InputMethod_TextInputType textType )

Description

Notifies the change of the text box configuration.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.
enterKeyEnter key type.
textTypeText box type.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_PARAMCHECK indicates the parameter error.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

IME_ERR_DETACHED indicates that no input method is bound.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodProxy_NotifyCursorUpdate()

InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate (InputMethod_InputMethodProxy * inputMethodProxy, InputMethod_CursorInfo * cursorInfo )

Description

Notifies the cursor position change.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.
cursorInfoPointer to the InputMethod_CursorInfo instance, indicating the cursor information.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_PARAMCHECK indicates the parameter error.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

IME_ERR_DETACHED indicates that no input method is bound.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodProxy_NotifySelectionChange()

InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange (InputMethod_InputMethodProxy * inputMethodProxy, char16_t text[], size_t length, int start, int end )

Description

Notifies the change of the text selection area in the text box.

When the text content, the cursor position, or the selected text changes, this API is used to notify the input method application of the change.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.
textAll input text.
lengthLength of the text parameter. Maximum length: 8 KB.
startStart position of the selected text.
endEnd position of the selected text.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_PARAMCHECK indicates the parameter error.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

IME_ERR_DETACHED indicates that no input method is bound.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodProxy_SendPrivateCommand()

InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand (InputMethod_InputMethodProxy * inputMethodProxy, InputMethod_PrivateCommand * privateCommand[], size_t size )

Description

Sends a private data command.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.
privateCommandPrivate command, which is defined in InputMethod_PrivateCommand. The maximum size is 32 KB.
sizeSize of the private command. Maximum size: 5.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_PARAMCHECK indicates the parameter error.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

IME_ERR_DETACHED indicates that no input method is bound.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_InputMethodProxy_ShowKeyboard()

InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard (InputMethod_InputMethodProxy * inputMethodProxy)

Description

Displays the keyboard.

Since: 12

Parameters

NameDescription
inputMethodProxyPointer to the InputMethod_InputMethodProxy instance. Call OH_InputMethodController_Attach to obtain inputMethodProxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

IME_ERR_PARAMCHECK indicates the parameter error.

IME_ERR_IMCLIENT indicates the input method client error.

IME_ERR_IMMS indicates the input method service error.

IME_ERR_DETACHED indicates that no input method is bound.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_Create()

InputMethod_PrivateCommand* OH_PrivateCommand_Create (char key[], size_t keyLength )

Description

Creates an InputMethod_PrivateCommand instance.

Since: 12

Parameters

NameDescription
keyKey value of the private data.
keyLengthKey length.

Returns:

If the operation is successful, a pointer to the created InputMethod_PrivateCommand instance is returned. If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_PrivateCommand_Destroy()

void OH_PrivateCommand_Destroy (InputMethod_PrivateCommand * command)

Description

Destroys an InputMethod_PrivateCommand instance.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance to be destroyed.

OH_PrivateCommand_GetBoolValue()

InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue (InputMethod_PrivateCommand * command, bool * value )

Description

Obtains the value of the Boolean type from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance whose value is to be obtained.
valueBoolean value.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_GetIntValue()

InputMethod_ErrorCode OH_PrivateCommand_GetIntValue (InputMethod_PrivateCommand * command, int32_t * value )

Description

Obtains the value of the integer type from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance whose value is to be obtained.
valueValue of the integer type.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_GetKey()

InputMethod_ErrorCode OH_PrivateCommand_GetKey (InputMethod_PrivateCommand * command, const char ** key, size_t * keyLength )

Description

Obtains the key value from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance whose key value is to be obtained.
keyThe lifespan of key is consistent with that of command. Do not directly save the key address or write key. You are advised to copy key and then use the copy.
keyLengthKey length.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_GetStrValue()

InputMethod_ErrorCode OH_PrivateCommand_GetStrValue (InputMethod_PrivateCommand * command, const char ** value, size_t * valueLength )

Description

Obtains the value of the character string type from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance whose value is to be obtained.
valueValue of the character string type.
valueLengthThe lifespan of value is consistent with that of command. Do not directly save the value address or directly write value. You are advised to copy value and then use the copy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_GetValueType()

InputMethod_ErrorCode OH_PrivateCommand_GetValueType (InputMethod_PrivateCommand * command, InputMethod_CommandValueType * type )

Description

Obtains the data type of value from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance whose value is to be obtained.
typeData type of value.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_SetBoolValue()

InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue (InputMethod_PrivateCommand * command, bool value )

Description

Sets the value of the Boolean type for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance to be set.
valueBoolean value.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_SetIntValue()

InputMethod_ErrorCode OH_PrivateCommand_SetIntValue (InputMethod_PrivateCommand * command, int32_t value )

Description

Sets the value of the integer type for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance to be set.
valueInteger value.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_SetKey()

InputMethod_ErrorCode OH_PrivateCommand_SetKey (InputMethod_PrivateCommand * command, char key[], size_t keyLength )

Description

Sets the key value for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance to be set.
keyKey value.
keyLengthKey length.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_PrivateCommand_SetStrValue()

InputMethod_ErrorCode OH_PrivateCommand_SetStrValue (InputMethod_PrivateCommand * command, char value[], size_t valueLength )

Description

Sets the value of the character string type for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
commandPointer to the InputMethod_PrivateCommand instance to be set.
valueValue of the character string type.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextAvoidInfo_Create()

InputMethod_TextAvoidInfo* OH_TextAvoidInfo_Create (double positionY, double height )

Description

Creates an InputMethod_TextAvoidInfo instance.

Since: 12

Parameters

NameDescription
positionYY coordinate of the text box.
heightHeight of the text box.

Returns:

If the operation is successful, a pointer to the created InputMethod_TextAvoidInfo instance is returned. If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_TextAvoidInfo_Destroy()

void OH_TextAvoidInfo_Destroy (InputMethod_TextAvoidInfo * info)

Description

Destroys an InputMethod_TextAvoidInfo instance.

Since: 12

Parameters

NameDescription
optionsPointer to the InputMethod_TextAvoidInfo instance to be destroyed.

OH_TextAvoidInfo_GetHeight()

InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight (InputMethod_TextAvoidInfo * info, double * height )

Description

Obtains the height from InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
infoPointer to the InputMethod_TextAvoidInfo instance whose value is to be obtained.
heightHeight of the text box.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextAvoidInfo_GetPositionY()

InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY (InputMethod_TextAvoidInfo * info, double * positionY )

Description

Obtains the Y coordinate from InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
infoPointer to the InputMethod_TextAvoidInfo instance whose value is to be obtained.
positionYAbsolute value of the distance between the text box's top vertex and the top edge of the physical screen.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextAvoidInfo_SetHeight()

InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight (InputMethod_TextAvoidInfo * info, double height )

Description

Sets the height in InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
infoPointer to the InputMethod_TextAvoidInfo instance to be set.
heightHeight.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextAvoidInfo_SetPositionY()

InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY (InputMethod_TextAvoidInfo * info, double positionY )

Description

Sets the Y coordinate in InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
infoPointer to the InputMethod_TextAvoidInfo instance to be set.
positionYAbsolute value of the distance between the text box's top vertex and the top edge of the physical screen.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_Create()

InputMethod_TextConfig* OH_TextConfig_Create ()

Description

Creates an InputMethod_TextConfig instance.

Since: 12

Returns:

If the operation is successful, a pointer to the created InputMethod_TextConfig instance is returned. If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_TextConfig_Destroy()

void OH_TextConfig_Destroy (InputMethod_TextConfig * config)

Description

Destroys an InputMethod_TextConfig instance.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance to be destroyed.

OH_TextConfig_GetCursorInfo()

InputMethod_ErrorCode OH_TextConfig_GetCursorInfo (InputMethod_TextConfig * config, InputMethod_CursorInfo ** cursorInfo )

Description

Obtains the cursor information of InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
cursorInfoCursor information.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_GetEnterKeyType()

InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType (InputMethod_TextConfig * config, InputMethod_EnterKeyType * enterKeyType )

Description

Obtains the Enter function type of InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
enterKeyTypeEnter function type of the text box.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_GetInputType()

InputMethod_ErrorCode OH_TextConfig_GetInputType (InputMethod_TextConfig * config, InputMethod_TextInputType * inputType )

Description

Obtains the text box type of InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
inputTypeInput type of the text box.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_GetSelection()

InputMethod_ErrorCode OH_TextConfig_GetSelection (InputMethod_TextConfig * config, int32_t * start, int32_t * end )

Description

Obtains the selected text area of InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
startStart position of the selected text.
endEnd position of the selected text.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_GetTextAvoidInfo()

InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo (InputMethod_TextConfig * config, InputMethod_TextAvoidInfo ** avoidInfo )

Description

Obtains the avoidance information of InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
avoidInfoText box avoidance information.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_GetWindowId()

InputMethod_ErrorCode OH_TextConfig_GetWindowId (InputMethod_TextConfig * config, int32_t * windowId )

Description

Obtains the ID of the window to which InputMethod_TextConfig belongs.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
windowIdWindow ID of the application bound to the input method.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_IsPreviewTextSupported()

InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported (InputMethod_TextConfig * config, bool * supported )

Description

Obtains the text preview settings of InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance whose value is to be obtained.
supportedWhether text preview is supported.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_SetEnterKeyType()

InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType (InputMethod_TextConfig * config, InputMethod_EnterKeyType enterKeyType )

Description

Sets the Enter function type for InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance to be set.
enterKeyTypeEnter function type.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_SetInputType()

InputMethod_ErrorCode OH_TextConfig_SetInputType (InputMethod_TextConfig * config, InputMethod_TextInputType inputType )

Description

Sets the text box type for InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance to be set.
inputTypeInput type of the text box.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_SetPreviewTextSupport()

InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport (InputMethod_TextConfig * config, bool supported )

Description

Sets the text preview feature for InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance to be set.
supportedWhether text preview is supported.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_SetSelection()

InputMethod_ErrorCode OH_TextConfig_SetSelection (InputMethod_TextConfig * config, int32_t start, int32_t end )

Description

Sets the selected text area for InputMethod_TextConfig.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance to be set.
startStart position of the selected text.
endEnd position of the selected text.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextConfig_SetWindowId()

InputMethod_ErrorCode OH_TextConfig_SetWindowId (InputMethod_TextConfig * config, int32_t windowId )

Description

Sets the ID of the window to which InputMethod_TextConfig belongs.

Since: 12

Parameters

NameDescription
configPointer to the InputMethod_TextConfig instance to be set.
windowIdWindow ID of the application bound to the input method.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_Create()

InputMethod_TextEditorProxy* OH_TextEditorProxy_Create ()

Description

Creates an InputMethod_TextEditorProxy instance.

Since: 12

Returns:

If the operation is successful, a pointer to the created InputMethod_TextEditorProxy instance is returned. If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_TextEditorProxy_Destroy()

void OH_TextEditorProxy_Destroy (InputMethod_TextEditorProxy * proxy)

Description

Destroys an InputMethod_TextEditorProxy instance.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be destroyed.

OH_TextEditorProxy_GetDeleteBackwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteBackwardFunc * deleteBackwardFunc )

Description

Obtains the OH_TextEditorProxy_DeleteBackwardFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
deleteBackwardFuncFunction OH_TextEditorProxy_DeleteBackwardFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetDeleteForwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteForwardFunc * deleteForwardFunc )

Description

Obtains the OH_TextEditorProxy_DeleteForwardFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
deleteForwardFuncFunction OH_TextEditorProxy_DeleteForwardFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetFinishTextPreviewFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_FinishTextPreviewFunc * finishTextPreviewFunc )

Description

Obtains the OH_TextEditorProxy_FinishTextPreviewFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
finishTextPreviewFuncFunction OH_TextEditorProxy_FinishTextPreviewFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetGetLeftTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc * getLeftTextOfCursorFunc )

Description

Obtains the OH_TextEditorProxy_GetLeftTextOfCursorFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
getLeftTextOfCursorFuncFunction OH_TextEditorProxy_GetLeftTextOfCursorFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetGetRightTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc * getRightTextOfCursorFunc )

Description

Obtains the OH_TextEditorProxy_GetRightTextOfCursorFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
getRightTextOfCursorFuncFunction OH_TextEditorProxy_GetRightTextOfCursorFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetGetTextConfigFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextConfigFunc * getTextConfigFunc )

Description

Obtains the OH_TextEditorProxy_GetTextConfigFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
getTextConfigFuncFunction OH_TextEditorProxy_GetTextConfigFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetGetTextIndexAtCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc * getTextIndexAtCursorFunc )

Description

Obtains the OH_TextEditorProxy_GetTextIndexAtCursorFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
getTextIndexAtCursorFuncFunction OH_TextEditorProxy_GetTextIndexAtCursorFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetHandleExtendActionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleExtendActionFunc * handleExtendActionFunc )

Description

Obtains the OH_TextEditorProxy_HandleExtendActionFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
handleExtendActionFuncFunction OH_TextEditorProxy_HandleExtendActionFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetHandleSetSelectionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleSetSelectionFunc * handleSetSelectionFunc )

Description

Obtains the OH_TextEditorProxy_HandleSetSelectionFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
handleSetSelectionFuncFunction OH_TextEditorProxy_HandleSetSelectionFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetInsertTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_InsertTextFunc * insertTextFunc )

Description

Obtains the OH_TextEditorProxy_InsertTextFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
insertTextFuncFunction OH_TextEditorProxy_InsertTextFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetMoveCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_MoveCursorFunc * moveCursorFunc )

Description

Obtains the OH_TextEditorProxy_MoveCursorFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
moveCursorFuncFunction OH_TextEditorProxy_MoveCursorFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetReceivePrivateCommandFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc * receivePrivateCommandFunc )

Description

Obtains the OH_TextEditorProxy_ReceivePrivateCommandFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
receivePrivateCommandFuncFunction OH_TextEditorProxy_ReceivePrivateCommandFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetSendEnterKeyFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendEnterKeyFunc * sendEnterKeyFunc )

Description

Obtains the OH_TextEditorProxy_SendEnterKeyFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
sendEnterKeyFuncFunction OH_TextEditorProxy_SendEnterKeyFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetSendKeyboardStatusFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendKeyboardStatusFunc * sendKeyboardStatusFunc )

Description

Obtains the OH_TextEditorProxy_SendKeyboardStatusFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
sendKeyboardStatusFuncFunction OH_TextEditorProxy_SendKeyboardStatusFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_GetSetPreviewTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SetPreviewTextFunc * setPreviewTextFunc )

Description

Obtains the OH_TextEditorProxy_SetPreviewTextFunc function from InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be read.
setPreviewTextFuncFunction OH_TextEditorProxy_SetPreviewTextFunc obtained from the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetDeleteBackwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc )

Description

Sets the OH_TextEditorProxy_DeleteBackwardFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
deleteBackwardFuncFunction OH_TextEditorProxy_DeleteBackwardFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetDeleteForwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc )

Description

Sets the OH_TextEditorProxy_DeleteForwardFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
deleteForwardFuncFunction OH_TextEditorProxy_DeleteForwardFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetFinishTextPreviewFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc )

Description

Sets the OH_TextEditorProxy_FinishTextPreviewFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
finishTextPreviewFuncFunction OH_TextEditorProxy_FinishTextPreviewFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetGetLeftTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc )

Description

Sets the OH_TextEditorProxy_GetLeftTextOfCursorFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
getLeftTextOfCursorFuncFunction OH_TextEditorProxy_GetLeftTextOfCursorFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetGetRightTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc )

Description

Sets the OH_TextEditorProxy_GetRightTextOfCursorFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
getRightTextOfCursorFuncFunction OH_TextEditorProxy_GetRightTextOfCursorFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetGetTextConfigFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc )

Description

Sets the OH_TextEditorProxy_GetTextConfigFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
getTextConfigFuncFunction OH_TextEditorProxy_GetTextConfigFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetGetTextIndexAtCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc )

Description

Sets the OH_TextEditorProxy_GetTextIndexAtCursorFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
getTextIndexAtCursorFuncFunction OH_TextEditorProxy_GetTextIndexAtCursorFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetHandleExtendActionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc )

Description

Sets the OH_TextEditorProxy_HandleExtendActionFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
handleExtendActionFuncFunction OH_TextEditorProxy_HandleExtendActionFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetHandleSetSelectionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc )

Description

Sets the OH_TextEditorProxy_HandleSetSelectionFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
handleSetSelectionFuncFunction OH_TextEditorProxy_HandleSetSelectionFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetInsertTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc )

Description

Sets the OH_TextEditorProxy_InsertTextFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
insertTextFuncFunction OH_TextEditorProxy_InsertTextFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetMoveCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc )

Description

Sets the OH_TextEditorProxy_SetMoveCursorFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
moveCursorFuncFunction OH_TextEditorProxy_MoveCursorFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetReceivePrivateCommandFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc )

Description

Sets the OH_TextEditorProxy_ReceivePrivateCommandFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
receivePrivateCommandFuncFunction OH_TextEditorProxy_ReceivePrivateCommandFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetSendEnterKeyFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc )

Description

Sets the OH_TextEditorProxy_SetSendEnterKeyFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
sendEnterKeyFuncFunction OH_TextEditorProxy_SendEnterKeyFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetSendKeyboardStatusFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc )

Description

Sets the OH_TextEditorProxy_SendKeyboardStatusFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
sendKeyboardStatusFuncFunction OH_TextEditorProxy_SendKeyboardStatusFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetSetPreviewTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc )

Description

Sets the OH_TextEditorProxy_SetPreviewTextFunc function to InputMethod_TextEditorProxy.

Since: 12

Parameters

NameDescription
proxyPointer to the InputMethod_TextEditorProxy instance to be set.
setPreviewTextFuncFunction OH_TextEditorProxy_SetPreviewTextFunc set to the proxy.

Returns:

An error code.

IME_ERR_OK indicates the operation is successful.

The IME_ERR_NULL_POINTER indicates an unexpected null pointer.

For details about the error code, see InputMethod_ErrorCode.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙IME Kit

harmony 鸿蒙Input Method Framework Error Codes

harmony 鸿蒙inputmethod_attach_options_capi.h

harmony 鸿蒙inputmethod_controller_capi.h

harmony 鸿蒙inputmethod_cursor_info_capi.h

harmony 鸿蒙inputmethod_inputmethod_proxy_capi.h

harmony 鸿蒙inputmethod_private_command_capi.h

harmony 鸿蒙inputmethod_text_avoid_info_capi.h

harmony 鸿蒙inputmethod_text_config_capi.h

harmony 鸿蒙inputmethod_text_editor_proxy_capi.h

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/jYMSUh