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

2026-08-25 浏览 (1)

inputmethod_text_editor_proxy_capi.h

概述

提供一套方法支持应用开发的自绘输入框获取来自输入法应用的通知和请求。

引用文件: <inputmethod/inputmethod_text_editor_proxy_capi.h>

库: libohinputmethod.so

系统能力: SystemCapability.MiscServices.InputMethodFramework

起始版本: 12

相关模块: InputMethod

汇总

结构体

名称typedef关键字描述
InputMethod_TextEditorProxyInputMethod_TextEditorProxy输入框代理。提供了获取来自输入法应用的通知和请求的方法。当输入法向编辑器发送请求或通知时,这些方法将被调用。

函数

名称typedef关键字描述
typedef void (*OH_TextEditorProxy_GetTextConfigFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config)OH_TextEditorProxy_GetTextConfigFunc输入法获取输入框配置时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetTextConfigFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_InsertTextFunc)(InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length)OH_TextEditorProxy_InsertTextFunc输入法应用插入文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetInsertTextFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_DeleteForwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length)OH_TextEditorProxy_DeleteForwardFunc输入法删除光标右侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetDeleteForwardFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_DeleteBackwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length)OH_TextEditorProxy_DeleteBackwardFunc输入法删除光标左侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetDeleteBackwardFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_SendKeyboardStatusFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus)OH_TextEditorProxy_SendKeyboardStatusFunc输入法通知键盘状态时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetSendKeyboardStatusFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_SendEnterKeyFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType)OH_TextEditorProxy_SendEnterKeyFunc输入法发送回车键时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetSendEnterKeyFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_MoveCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction)OH_TextEditorProxy_MoveCursorFunc输入法移动光标时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetMoveCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_HandleSetSelectionFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end)OH_TextEditorProxy_HandleSetSelectionFunc输入法请求选中文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetHandleSetSelectionFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_HandleExtendActionFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action)OH_TextEditorProxy_HandleExtendActionFunc输入法发送扩展编辑操作时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetHandleExtendActionFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_GetLeftTextOfCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)OH_TextEditorProxy_GetLeftTextOfCursorFunc输入法获取光标左侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetLeftTextOfCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_GetRightTextOfCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)OH_TextEditorProxy_GetRightTextOfCursorFunc输入法获取光标右侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetRightTextOfCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef int32_t (*OH_TextEditorProxy_GetTextIndexAtCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy)OH_TextEditorProxy_GetTextIndexAtCursorFunc输入法获取光标所在输入框文本索引时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetTextIndexAtCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef int32_t (*OH_TextEditorProxy_ReceivePrivateCommandFunc)(InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size)OH_TextEditorProxy_ReceivePrivateCommandFunc输入法应用发送私有数据命令时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetReceivePrivateCommandFunc 将它设置到InputMethod_TextEditorProxy中, 并通过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_SetPreviewTextFunc输入法设置预上屏文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetSetPreviewTextFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorProxy *textEditorProxy)OH_TextEditorProxy_FinishTextPreviewFunc输入法结束预上屏时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetFinishTextPreviewFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。
InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(void)-创建一个新的InputMethod_TextEditorProxy实例。
void OH_TextEditorProxy_Destroy(InputMethod_TextEditorProxy *proxy)-销毁一个InputMethod_TextEditorProxy实例。
InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc)-将函数OH_TextEditorProxy_GetTextConfigFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc)-将函数OH_TextEditorProxy_InsertTextFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc)-将函数OH_TextEditorProxy_DeleteForwardFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc)-将函数OH_TextEditorProxy_DeleteBackwardFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc)-将函数OH_TextEditorProxy_SendKeyboardStatusFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc)-将函数OH_TextEditorProxy_SetSendEnterKeyFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc)-将函数OH_TextEditorProxy_SetMoveCursorFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc)-将函数OH_TextEditorProxy_HandleSetSelectionFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc)-将函数OH_TextEditorProxy_HandleExtendActionFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc)-将函数OH_TextEditorProxy_GetLeftTextOfCursorFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc)-将函数OH_TextEditorProxy_GetRightTextOfCursorFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc)-将函数OH_TextEditorProxy_GetTextIndexAtCursorFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc)-将函数OH_TextEditorProxy_ReceivePrivateCommandFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc)-将函数OH_TextEditorProxy_SetPreviewTextFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc)-将函数OH_TextEditorProxy_FinishTextPreviewFunc设置到InputMethod_TextEditorProxy中。
InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetTextConfigFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc *insertTextFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_InsertTextFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_DeleteForwardFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_DeleteBackwardFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_SendKeyboardStatusFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_SendEnterKeyFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc *moveCursorFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_MoveCursorFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_HandleSetSelectionFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_HandleExtendActionFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetLeftTextOfCursorFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetRightTextOfCursorFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetTextIndexAtCursorFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_ReceivePrivateCommandFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_SetPreviewTextFunc函数。
InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFunc)-InputMethod_TextEditorProxy中获取OH_TextEditorProxy_FinishTextPreviewFunc函数。

函数说明

OH_TextEditorProxy_GetTextConfigFunc()

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

描述

输入法获取输入框配置时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetTextConfigFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
InputMethod_TextConfig *config表示指向InputMethod_TextConfig实例的指针。只能在此回调接口被调用时访问该指针指向的内存,当此回调接口返回后,该内存将会被释放,不能再访问。

OH_TextEditorProxy_InsertTextFunc()

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

描述

输入法应用插入文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetInsertTextFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。in.
const char16_t *text插入的字符。只能在此回调接口被调用时访问该指针指向的内存,当此回调接口返回后,该内存将会被释放,不能再访问。
size_t length插入字符的长度。

OH_TextEditorProxy_DeleteForwardFunc()

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

描述

输入法删除光标右侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetDeleteForwardFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
int32_t length要删除字符的长度。

OH_TextEditorProxy_DeleteBackwardFunc()

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

描述

输入法删除光标左侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetDeleteBackwardFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
int32_t length要删除字符的长度。

OH_TextEditorProxy_SendKeyboardStatusFunc()

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

描述

输入法通知键盘状态时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetSendKeyboardStatusFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
InputMethod_KeyboardStatus keyboardStatus键盘状态,具体定义详见InputMethod_KeyboardStatus

OH_TextEditorProxy_SendEnterKeyFunc()

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

描述

输入法发送回车键时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetSendEnterKeyFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
InputMethod_EnterKeyType enterKeyType回车键类型,具体定义详见InputMethod_EnterKeyType.

OH_TextEditorProxy_MoveCursorFunc()

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

描述

输入法移动光标时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetMoveCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
InputMethod_Direction direction光标移动方向,具体定义详见InputMethod_Direction.

OH_TextEditorProxy_HandleSetSelectionFunc()

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

描述

输入法请求选中文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetHandleSetSelectionFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
int32_t start表示选中文本的起始位置。
int32_t end表示选中文本的结束位置。

OH_TextEditorProxy_HandleExtendActionFunc()

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

描述

输入法发送扩展编辑操作时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetHandleExtendActionFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
InputMethod_ExtendAction action扩展编辑操作,具体定义详见InputMethod_ExtendAction.

OH_TextEditorProxy_GetLeftTextOfCursorFunc()

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

描述

输入法获取光标左侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetLeftTextOfCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
int32_t number目标获取文本的长度。
char16_t text[]光标左侧指定长度的文本内容,需要在函数实现中对它赋值。只能在此回调接口被调用时访问该指针指向的内存,当此回调接口返回后,该内存将会被释放,不能再访问。
size_t *length表示游标左侧文本的长度,您需要传递此参数。

OH_TextEditorProxy_GetRightTextOfCursorFunc()

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

描述

输入法获取光标右侧文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetRightTextOfCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
int32_t number目标获取文本的长度。
char16_t text[]光标右侧指定长度的文本内容,需要在函数实现中对它赋值。只能在此回调接口被调用时访问该指针指向的内存,当此回调接口返回后,该内存将会被释放,不能再访问。
size_t *length表示游标右侧文本的长度,您需要传递此参数。

OH_TextEditorProxy_GetTextIndexAtCursorFunc()

typedef int32_t (*OH_TextEditorProxy_GetTextIndexAtCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy)

描述

输入法获取光标所在输入框文本索引时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetGetTextIndexAtCursorFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。

返回:

类型说明
int32_t返回光标所在输入框文本索引。

OH_TextEditorProxy_ReceivePrivateCommandFunc()

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

描述

输入法应用发送私有数据命令时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetReceivePrivateCommandFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
InputMethod_PrivateCommand *privateCommand[]私有数据命令。只能在此回调接口被调用时访问该指针指向的内存,当此回调接口返回后,该内存将会被释放,不能再访问。
size_t size私有数据的大小。

返回:

类型说明
int32_t返回对私有数据命令处理的处理结果。

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)

描述

输入法设置预上屏文本时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetSetPreviewTextFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
const char16_t text[]请求设置为预上屏样式的文本内容。只能在此回调接口被调用时访问该指针指向的内存,当此回调接口返回后,该内存将会被释放,不能再访问。
size_t length预上屏文本长度。
int32_t start预上屏文本起始光标位置。
int32_t end预上屏文本结束光标位置。

返回:

类型说明
int32_t返回设置预上屏文本的处理结果。

OH_TextEditorProxy_FinishTextPreviewFunc()

typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorProxy *textEditorProxy)

描述

输入法结束预上屏时触发的函数。您需要实现此函数,通过 OH_TextEditorProxy_SetFinishTextPreviewFunc 将它设置到InputMethod_TextEditorProxy中, 并通过OH_InputMethodController_Attach完成注册。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *textEditorProxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。

OH_TextEditorProxy_Create()

InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(void)

描述

创建一个新的InputMethod_TextEditorProxy实例。

起始版本: 12

返回:

类型说明
InputMethod_TextEditorProxy *如果创建成功,返回一个指向新创建的InputMethod_TextEditorProxy实例的指针。
如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。

OH_TextEditorProxy_Destroy()

void OH_TextEditorProxy_Destroy(InputMethod_TextEditorProxy *proxy)

描述

销毁一个InputMethod_TextEditorProxy实例。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy表示指向即将被销毁的InputMethod_TextEditorProxy实例的指针。

OH_TextEditorProxy_SetGetTextConfigFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc)

描述

将函数OH_TextEditorProxy_GetTextConfigFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc表示被设置到proxy的函数OH_TextEditorProxy_GetTextConfigFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetInsertTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc)

描述

将函数OH_TextEditorProxy_InsertTextFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_InsertTextFunc insertTextFunc表示被设置到proxy的函数OH_TextEditorProxy_InsertTextFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetDeleteForwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc)

描述

将函数OH_TextEditorProxy_DeleteForwardFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc表示被设置到proxy的函数OH_TextEditorProxy_DeleteForwardFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetDeleteBackwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc)

描述

将函数OH_TextEditorProxy_DeleteBackwardFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc表示被设置到proxy的函数OH_TextEditorProxy_DeleteBackwardFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetSendKeyboardStatusFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc)

描述

将函数OH_TextEditorProxy_SendKeyboardStatusFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc表示被设置到proxy的函数OH_TextEditorProxy_SendKeyboardStatusFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetSendEnterKeyFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc)

描述

将函数OH_TextEditorProxy_SetSendEnterKeyFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc表示被设置到proxy的函数OH_TextEditorProxy_SendEnterKeyFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetMoveCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc)

描述

将函数OH_TextEditorProxy_SetMoveCursorFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_MoveCursorFunc moveCursorFunc表示被设置到proxy的函数OH_TextEditorProxy_MoveCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetHandleSetSelectionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc)

描述

将函数OH_TextEditorProxy_HandleSetSelectionFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc表示被设置到proxy的函数OH_TextEditorProxy_HandleSetSelectionFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetHandleExtendActionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc)

描述

将函数OH_TextEditorProxy_HandleExtendActionFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc表示被设置到proxy的函数OH_TextEditorProxy_HandleExtendActionFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetGetLeftTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc)

描述

将函数OH_TextEditorProxy_GetLeftTextOfCursorFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc表示被设置到proxy的函数OH_TextEditorProxy_GetLeftTextOfCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetGetRightTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc)

描述

将函数OH_TextEditorProxy_GetRightTextOfCursorFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc表示被设置到proxy的函数OH_TextEditorProxy_GetRightTextOfCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetGetTextIndexAtCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc)

描述

将函数OH_TextEditorProxy_GetTextIndexAtCursorFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc表示被设置到proxy的函数OH_TextEditorProxy_GetTextIndexAtCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetReceivePrivateCommandFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc)

描述

将函数OH_TextEditorProxy_ReceivePrivateCommandFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc表示被设置到proxy的函数OH_TextEditorProxy_ReceivePrivateCommandFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetSetPreviewTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc)

描述

将函数OH_TextEditorProxy_SetPreviewTextFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc表示被设置到proxy的函数OH_TextEditorProxy_SetPreviewTextFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetFinishTextPreviewFunc()

InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc)

描述

将函数OH_TextEditorProxy_FinishTextPreviewFunc设置到InputMethod_TextEditorProxy中。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向即将被设置的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc表示被设置到proxy的函数OH_TextEditorProxy_FinishTextPreviewFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetGetTextConfigFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetTextConfigFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFunc表示从proxy获取到的函数OH_TextEditorProxy_GetTextConfigFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetInsertTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc *insertTextFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_InsertTextFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_InsertTextFunc *insertTextFunc表示从proxy获取到的函数OH_TextEditorProxy_InsertTextFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetDeleteForwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_DeleteForwardFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFunc表示从proxy获取到的函数OH_TextEditorProxy_DeleteForwardFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetDeleteBackwardFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_DeleteBackwardFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFunc表示从proxy获取到的函数OH_TextEditorProxy_DeleteBackwardFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetSendKeyboardStatusFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_SendKeyboardStatusFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFunc表示从proxy获取到的函数OH_TextEditorProxy_SendKeyboardStatusFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetSendEnterKeyFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_SendEnterKeyFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFunc表示从proxy获取到的函数OH_TextEditorProxy_SendEnterKeyFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetMoveCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc *moveCursorFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_MoveCursorFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_MoveCursorFunc *moveCursorFunc表示从proxy获取到的函数OH_TextEditorProxy_MoveCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetHandleSetSelectionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_HandleSetSelectionFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFunc表示从proxy获取到的函数OH_TextEditorProxy_HandleSetSelectionFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetHandleExtendActionFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_HandleExtendActionFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFunc表示从proxy获取到的函数OH_TextEditorProxy_HandleExtendActionFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetGetLeftTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetLeftTextOfCursorFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFunc表示从proxy获取到的函数OH_TextEditorProxy_GetLeftTextOfCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetGetRightTextOfCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetRightTextOfCursorFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFunc表示从proxy获取到的函数OH_TextEditorProxy_GetRightTextOfCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetGetTextIndexAtCursorFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_GetTextIndexAtCursorFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFunc表示从proxy获取到的函数OH_TextEditorProxy_GetTextIndexAtCursorFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetReceivePrivateCommandFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_ReceivePrivateCommandFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFunc表示从proxy获取到的函数OH_TextEditorProxy_ReceivePrivateCommandFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetSetPreviewTextFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_SetPreviewTextFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFunc表示从proxy获取到的函数OH_TextEditorProxy_SetPreviewTextFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_GetFinishTextPreviewFunc()

InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc(InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFunc)

描述

InputMethod_TextEditorProxy中获取OH_TextEditorProxy_FinishTextPreviewFunc函数。

起始版本: 12

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向被读取的InputMethod_TextEditorProxy实例的指针。
OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFunc表示从proxy获取到的函数OH_TextEditorProxy_FinishTextPreviewFunc

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextEditorProxy_SetCallbackInMainThread()

InputMethod_ErrorCode OH_TextEditorProxy_SetCallbackInMainThread(InputMethod_TextEditorProxy *proxy, bool isCallbackInMainThread)

描述

为InputMethod_TextEditorProxy的回调函数配置执行线程(主线程/IPC线程)。本接口仅控制InputMethod_TextEditorProxy中除OH_TextEditorProxy_GetTextConfigFunc之外的所有回调函数。OH_TextEditorProxy_GetTextConfigFunc的执行线程由调用OH_InputMethodController_Attach的线程决定,不受本接口影响,若需该回调也在主线程执行,需确保OH_InputMethodController_Attach在主线程调用。

起始版本: 22

参数:

参数项描述
InputMethod_TextEditorProxy *proxy指向目标InputMethod_TextEditorProxy实例的指针。
bool isCallbackInMainThread线程执行策略。- true:回调函数切换至主线程执行(用于避免多线程并发问题)。避免在回调内执行耗时操作,防止主线程阻塞。- false:回调函数在IPC线程执行(可能存在多线程并发情况)。

返回:

类型说明
InputMethod_ErrorCode执行结果。
IME_ERR_OK - 配置成功。
IME_ERR_NULL_POINTER - 当proxy为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/RQuOhH17