openharmony 鸿蒙 capi-inputmethod-text-editor-proxy-capi-h

2026-08-25 浏览 (1)

inputmethod_text_editor_proxy_capi.h

Overview

Provides a set of methods for the custom text box developed by the application to obtain notifications and requests from the input method application.

File to include: <inputmethod/inputmethod_text_editor_proxy_capi.h>

Library: libohinputmethod.so

System capability: SystemCapability.MiscServices.InputMethodFramework

Since: 12

Related module: InputMethod

Summary

Structs

Nametypedef KeywordDescription
InputMethod_TextEditorProxyInputMethod_TextEditorProxyRepresents the text box proxy. It provides methods for obtaining notifications and requests from the input method application.

Function

Nametypedef KeywordDescription
typedef void (*OH_TextEditorProxy_GetTextConfigFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config)OH_TextEditorProxy_GetTextConfigFuncFunction called when the input method obtains the text box configuration. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetTextConfigFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_InsertTextFunc)(InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length)OH_TextEditorProxy_InsertTextFuncFunction called when the input method application inserts text. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetInsertTextFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_DeleteForwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length)OH_TextEditorProxy_DeleteForwardFuncFunction called when the input method deletes the text on the right of the cursor. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetDeleteForwardFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_DeleteBackwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length)OH_TextEditorProxy_DeleteBackwardFuncFunction called when the input method deletes the text on the left of the cursor. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetDeleteBackwardFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_SendKeyboardStatusFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus)OH_TextEditorProxy_SendKeyboardStatusFuncFunction called when the input method notifies the keyboard status. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetSendKeyboardStatusFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_SendEnterKeyFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType)OH_TextEditorProxy_SendEnterKeyFuncFunction called when the Enter key is pressed in the input method. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetSendEnterKeyFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_MoveCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction)OH_TextEditorProxy_MoveCursorFuncFunction called when the cursor is moved in the input method. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetMoveCursorFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_HandleSetSelectionFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end)OH_TextEditorProxy_HandleSetSelectionFuncFunction called when the input method requests to select text. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetHandleSetSelectionFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_HandleExtendActionFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action)OH_TextEditorProxy_HandleExtendActionFuncFunction called when the input method sends an extended editing operation. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetHandleExtendActionFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_GetLeftTextOfCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)OH_TextEditorProxy_GetLeftTextOfCursorFuncFunction called when the input method obtains the text on the left of the cursor. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetLeftTextOfCursorFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_GetRightTextOfCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)OH_TextEditorProxy_GetRightTextOfCursorFuncFunction called when the input method obtains the text on the right of the cursor. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetRightTextOfCursorFunc, and register it through OH_InputMethodController_Attach.
typedef int32_t (*OH_TextEditorProxy_GetTextIndexAtCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy)OH_TextEditorProxy_GetTextIndexAtCursorFuncFunction called when the input method obtains the index of the text where the cursor is located in the text box. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetTextIndexAtCursorFunc, and register it through OH_InputMethodController_Attach.
typedef int32_t (*OH_TextEditorProxy_ReceivePrivateCommandFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size)OH_TextEditorProxy_ReceivePrivateCommandFuncFunction called when the input method application sends a private data command. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetReceivePrivateCommandFunc, and register it through OH_InputMethodController_Attach.
typedef int32_t (*OH_TextEditorProxy_SetPreviewTextFunc)(InputMethod_TextEditorProxy *textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end)OH_TextEditorProxy_SetPreviewTextFuncFunction called when the input method sets the text preview feature. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetSetPreviewTextFunc, and register it through OH_InputMethodController_Attach.
typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorProxy *textEditorProxy)OH_TextEditorProxy_FinishTextPreviewFuncFunction called when the input method ends the text preview feature. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetFinishTextPreviewFunc, and register it through OH_InputMethodController_Attach.
InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(void)-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.

Function Description

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetTextConfigFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
InputMethod_TextConfig *configPointer to the InputMethod_TextConfig instance. The memory to which this pointer points can be accessed only when this API is called. Once the callback returns, the memory will be released and must not be accessed thereafter.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetInsertTextFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.in.
const char16_t *textPointer to the characters to be inserted. The memory to which this pointer points can be accessed only when this API is called. Once the callback returns, the memory will be released and must not be accessed thereafter.
size_t lengthLength of the characters to be inserted.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetDeleteForwardFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

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

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetDeleteBackwardFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

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

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetSendKeyboardStatusFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

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

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetSendEnterKeyFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

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

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetMoveCursorFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
InputMethod_Direction directionDirection in which the cursor moves. For details, see InputMethod_Direction.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetHandleSetSelectionFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

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

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetHandleExtendActionFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

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

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetLeftTextOfCursorFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
int32_t numberLength of the text to be obtained.
char16_t text[]Text 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. The memory to which this pointer points can be accessed only when this API is called. Once the callback returns, the memory will be released and must not be accessed thereafter.
size_t *lengthPointer to the length of the text on the left of the cursor. You need to transfer this parameter.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetRightTextOfCursorFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
int32_t numberLength of the text to be obtained.
char16_t text[]Text 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. The memory to which this pointer points can be accessed only when this API is called. Once the callback returns, the memory will be released and must not be accessed thereafter.
size_t *lengthPointer to the length of the text on the right of the cursor. You need to transfer this parameter.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetGetTextIndexAtCursorFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.

Returns

TypeDescription
int32_tIndex of the text where the cursor is located.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetReceivePrivateCommandFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
InputMethod_PrivateCommand *privateCommand[]Private data command. The memory to which this pointer points can be accessed only when this API is called. Once the callback returns, the memory will be released and must not be accessed thereafter.
size_t sizeSize of the private data.

Returns

TypeDescription
int32_tProcessing result of the private data command.

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. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetSetPreviewTextFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.
const char16_t text[]Text requested to be previewed. The memory to which this pointer points can be accessed only when this API is called. Once the callback returns, the memory will be released and must not be accessed thereafter.
size_t lengthLength of the text to be previewed.
int32_t startStarting cursor position of the text to be previewed.
int32_t endEnding cursor position of the text to be previewed.

Returns

TypeDescription
int32_tResult of setting text preview.

OH_TextEditorProxy_FinishTextPreviewFunc()

typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorProxy *textEditorProxy)

Description

Function called when the input method ends the text preview feature. You need to implement this function, set it to InputMethod_TextEditorProxy via OH_TextEditorProxy_SetFinishTextPreviewFunc, and register it through OH_InputMethodController_Attach.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance to be set.

OH_TextEditorProxy_Create()

InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(void)

Description

Creates an InputMethod_TextEditorProxy instance.

Since: 12

Returns

TypeDescription
InputMethod_TextEditorProxy *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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be destroyed.

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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_GetTextConfigFunc getTextConfigFuncOH_TextEditorProxy_GetTextConfigFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_InsertTextFunc insertTextFuncOH_TextEditorProxy_InsertTextFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_DeleteForwardFunc deleteForwardFuncOH_TextEditorProxy_DeleteForwardFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFuncOH_TextEditorProxy_DeleteBackwardFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFuncOH_TextEditorProxy_SendKeyboardStatusFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFuncOH_TextEditorProxy_SendEnterKeyFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_MoveCursorFunc moveCursorFuncOH_TextEditorProxy_MoveCursorFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFuncOH_TextEditorProxy_HandleSetSelectionFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFuncOH_TextEditorProxy_HandleExtendActionFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFuncOH_TextEditorProxy_GetLeftTextOfCursorFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFuncOH_TextEditorProxy_GetRightTextOfCursorFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFuncOH_TextEditorProxy_GetTextIndexAtCursorFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFuncOH_TextEditorProxy_ReceivePrivateCommandFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFuncOH_TextEditorProxy_SetPreviewTextFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be set.
OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFuncOH_TextEditorProxy_FinishTextPreviewFunc to be set to the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFuncFunction OH_TextEditorProxy_GetTextConfigFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_InsertTextFunc *insertTextFuncFunction OH_TextEditorProxy_InsertTextFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFuncFunction OH_TextEditorProxy_DeleteForwardFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFuncFunction OH_TextEditorProxy_DeleteBackwardFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFuncFunction OH_TextEditorProxy_SendKeyboardStatusFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFuncFunction OH_TextEditorProxy_SendEnterKeyFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_MoveCursorFunc *moveCursorFuncFunction OH_TextEditorProxy_MoveCursorFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFuncFunction OH_TextEditorProxy_HandleSetSelectionFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFuncFunction OH_TextEditorProxy_HandleExtendActionFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFuncFunction OH_TextEditorProxy_GetLeftTextOfCursorFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFuncFunction OH_TextEditorProxy_GetRightTextOfCursorFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFuncFunction OH_TextEditorProxy_GetTextIndexAtCursorFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFuncFunction OH_TextEditorProxy_ReceivePrivateCommandFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFuncFunction OH_TextEditorProxy_SetPreviewTextFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, 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
InputMethod_TextEditorProxy *proxyPointer to the InputMethod_TextEditorProxy instance to be read.
OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFuncFunction OH_TextEditorProxy_FinishTextPreviewFunc obtained from the proxy.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_TextEditorProxy_SetCallbackInMainThread()

InputMethod_ErrorCode OH_TextEditorProxy_SetCallbackInMainThread(InputMethod_TextEditorProxy *proxy, bool isCallbackInMainThread)

Description

Configures the execution thread (main thread/IPC thread) for the callback function of InputMethod_TextEditorProxy. This API controls all callbacks of InputMethod_TextEditorProxy except OH_TextEditorProxy_GetTextConfigFunc. The execution thread of OH_TextEditorProxy_GetTextConfigFunc is determined by the thread that calls OH_InputMethodController_Attach, and is not affected by this API. If this callback needs to be executed on the main thread, ensure that OH_InputMethodController_Attach is called on the main thread.

Since: 22

Parameters

NameDescription
InputMethod_TextEditorProxy *proxyPointer to the target InputMethod_TextEditorProxy instance.
bool isCallbackInMainThreadThread execution policy. - true: The callback executes on the main thread to avoid multithreaded concurrency. Do not perform time-consuming operations in the callback, as this may block the main thread. - false: The callback executes on an IPC thread (which may result in multithreaded concurrency).

Returns

TypeDescription
InputMethod_ErrorCodeExecution result.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - It is returned when proxy is null.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-inputmethod-inputmethod-textconfig

openharmony 鸿蒙 js-apis-inputmethod-extension-context

openharmony 鸿蒙 js-apis-inputmethod-subtype

openharmony 鸿蒙 capi-inputmethod-inputmethod-proxy-capi-h

openharmony 鸿蒙 capi-inputmethod-controller-capi-h

openharmony 鸿蒙 capi-inputmethod

openharmony 鸿蒙 js-apis-inputmethod-panel

openharmony 鸿蒙 js-apis-inputmethodengine

openharmony 鸿蒙 capi-inputmethod-cursor-info-capi-h

openharmony 鸿蒙 js-apis-inputmethod-system-panel-manager-sys

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