1# InputMethod
2
3
4## 概述
5
6InputMethod模块提供方法来使用输入法和开发输入法。
7
8**起始版本:** 12
9
10
11## 汇总
12
13
14### 文件
15
16| 名称 | 描述 |
17| -------- | -------- |
18| [inputmethod_attach_options_capi.h](inputmethod__attach__options__capi_8h.md) | 提供输入法绑定选项对象的创建、销毁与读写方法。 |
19| [inputmethod_controller_capi.h](inputmethod__controller__capi_8h.md) | 提供绑定、解绑输入法的方法。 |
20| [inputmethod_cursor_info_capi.h](inputmethod__cursor__info__capi_8h.md) | 提供光标信息对象的创建、销毁与读写方法。 |
21| [inputmethod_inputmethod_proxy_capi.h](inputmethod__inputmethod__proxy__capi_8h.md) | 提供使用输入法的方法,可以向输入法应用发送请求和通知。 |
22| [inputmethod_private_command_capi.h](inputmethod__private__command__capi_8h.md) | 提供私有数据对象的创建、销毁与读写方法。 |
23| [inputmethod_text_avoid_info_capi.h](inputmethod__text__avoid__info__capi_8h.md) | 提供输入框避让信息对象的创建、销毁与读写方法。 |
24| [inputmethod_text_config_capi.h](inputmethod__text__config__capi_8h.md) | 提供输入框配置信息对象的创建、销毁与读写方法。 |
25| [inputmethod_text_editor_proxy_capi.h](inputmethod__text__editor__proxy__capi_8h.md) | 提供一套方法支持应用开发的自绘输入框获取来自输入法应用的通知和请求。 |
26| [inputmethod_types_capi.h](inputmethod__types__capi_8h.md) | 提供了输入法相关的类型定义。 |
27
28
29### 类型定义
30
31| 名称 | 描述 |
32| -------- | -------- |
33| [InputMethod_AttachOptions](#inputmethod_attachoptions) | 输入法绑定选项。 |
34| [InputMethod_CursorInfo](#inputmethod_cursorinfo) | 光标信息。 |
35| [InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) | 输入法代理对象。 |
36| [InputMethod_PrivateCommand](#inputmethod_privatecommand) | 私有数据。 |
37| [InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) | 输入框避让信息。 |
38| [InputMethod_TextConfig](#inputmethod_textconfig) | 输入框配置。 |
39| [InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) | 输入框代理。 |
40| typedef void(\* [OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_TextConfig](#inputmethod_textconfig) \*config) | 输入法获取输入框配置时触发的函数。 |
41| typedef void(\* [OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, const char16_t \*text, size_t length) | 输入法应用插入文本时触发的函数。 |
42| typedef void(\* [OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, int32_t length) | 输入法删除光标右侧文本时触发的函数。 |
43| typedef void(\* [OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, int32_t length) | 输入法删除光标左侧文本时触发的函数。 |
44| typedef void(\* [OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_KeyboardStatus](#inputmethod_keyboardstatus) keyboardStatus) | 输入法通知键盘状态时触发的函数。 |
45| typedef void(\* [OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_EnterKeyType](#inputmethod_enterkeytype) enterKeyType) | 输入法发送回车键时触发的函数。 |
46| typedef void(\* [OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_Direction](#inputmethod_direction) direction) | 输入法移动光标时触发的函数。 |
47| typedef void(\* [OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, int32_t start, int32_t end) | 输入法请求选中文本时触发的函数。 |
48| typedef void(\* [OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_ExtendAction](#inputmethod_extendaction) action) | 输入法发送扩展编辑操作时触发的函数。 |
49| typedef void(\* [OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, int32_t number, char16_t text[], size_t \*length) | 输入法获取光标左侧文本时触发的函数。 |
50| typedef void(\* [OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, int32_t number, char16_t text[], size_t \*length) | 输入法获取光标右侧文本时触发的函数。 |
51| typedef int32_t(\* [OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy) | 输入法获取光标所在输入框文本索引时触发的函数。 |
52| typedef int32_t(\* [OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_PrivateCommand](#inputmethod_privatecommand) \*privateCommand[], size_t size) | 输入法应用发送私有数据命令时触发的函数。 |
53| typedef int32_t(\* [OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end) | 输入法设置预上屏文本时触发的函数。 |
54| typedef void(\* [OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy) | 输入法结束预上屏时触发的函数。 |
55| [InputMethod_KeyboardStatus](#inputmethod_keyboardstatus) | 键盘状态。 |
56| [InputMethod_EnterKeyType](#inputmethod_enterkeytype) | 回车键功能类型。 |
57| [InputMethod_Direction](#inputmethod_direction) | 移动方向。 |
58| [InputMethod_ExtendAction](#inputmethod_extendaction) | 编辑框中文本的扩展编辑操作类型。 |
59| [InputMethod_TextInputType](#inputmethod_textinputtype) | 文本输入类型。 |
60| [InputMethod_CommandValueType](#inputmethod_commandvaluetype) | 私有数据类型。 |
61| [InputMethod_ErrorCode](#inputmethod_errorcode) | 输入法错误码。 |
62
63
64### 枚举
65
66| 名称 | 描述 |
67| -------- | -------- |
68| [InputMethod_KeyboardStatus](#inputmethod_keyboardstatus) {<br/>IME_KEYBOARD_STATUS_NONE = 0,<br/>IME_KEYBOARD_STATUS_HIDE = 1,<br/>IME_KEYBOARD_STATUS_SHOW = 2<br/>} | 键盘状态。 |
69| [InputMethod_EnterKeyType](#inputmethod_enterkeytype) {<br/>IME_ENTER_KEY_UNSPECIFIED = 0,<br/>IME_ENTER_KEY_NONE = 1,<br/>IME_ENTER_KEY_GO = 2,<br/>IME_ENTER_KEY_SEARCH = 3,<br/>IME_ENTER_KEY_SEND = 4,<br/>IME_ENTER_KEY_NEXT = 5,<br/>IME_ENTER_KEY_DONE = 6,<br/>IME_ENTER_KEY_PREVIOUS = 7,<br/>IME_ENTER_KEY_NEWLINE = 8<br/>} | 回车键功能类型。 |
70| [InputMethod_Direction](#inputmethod_direction) {<br/>IME_DIRECTION_NONE = 0,<br/>IME_DIRECTION_UP = 1,<br/>IME_DIRECTION_DOWN = 2,<br/>IME_DIRECTION_LEFT = 3,<br/>IME_DIRECTION_RIGHT = 4<br/>} | 移动方向。 |
71| [InputMethod_ExtendAction](#inputmethod_extendaction) {<br/>IME_EXTEND_ACTION_SELECT_ALL = 0,<br/>IME_EXTEND_ACTION_CUT = 3,<br/>IME_EXTEND_ACTION_COPY = 4,<br/>IME_EXTEND_ACTION_PASTE = 5<br/>} | 编辑框中文本的扩展编辑操作类型。 |
72| [InputMethod_TextInputType](#inputmethod_textinputtype) {<br/>IME_TEXT_INPUT_TYPE_NONE = -1,<br/>IME_TEXT_INPUT_TYPE_TEXT = 0,<br/>IME_TEXT_INPUT_TYPE_MULTILINE = 1,<br/>IME_TEXT_INPUT_TYPE_NUMBER = 2,<br/>IME_TEXT_INPUT_TYPE_PHONE = 3,<br/>IME_TEXT_INPUT_TYPE_DATETIME = 4,<br/>IME_TEXT_INPUT_TYPE_EMAIL_ADDRESS = 5,<br/>IME_TEXT_INPUT_TYPE_URL = 6,<br/>IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORD = 7,<br/>IME_TEXT_INPUT_TYPE_NUMBER_PASSWORD = 8,<br/>IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORD = 9,<br/>IME_TEXT_INPUT_TYPE_USER_NAME = 10,<br/>IME_TEXT_INPUT_TYPE_NEW_PASSWORD = 11,<br/>IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL = 12<br/>} | 文本输入类型。 |
73| [InputMethod_CommandValueType](#inputmethod_commandvaluetype) {<br/>IME_COMMAND_VALUE_TYPE_NONE = 0,<br/>IME_COMMAND_VALUE_TYPE_STRING = 1,<br/>IME_COMMAND_VALUE_TYPE_BOOL = 2,<br/>IME_COMMAND_VALUE_TYPE_INT32 = 3<br/>} | 私有数据类型。 |
74| [InputMethod_ErrorCode](#inputmethod_errorcode) {<br/>IME_ERR_OK = 0, IME_ERR_UNDEFINED = 1,<br/>IME_ERR_PARAMCHECK = 401,<br/>IME_ERR_PACKAGEMANAGER = 12800001,<br/>IME_ERR_IMENGINE = 12800002,<br/>IME_ERR_IMCLIENT = 12800003,<br/>IME_ERR_CONFIG_PERSIST = 12800005,<br/>IME_ERR_CONTROLLER = 12800006,<br/>IME_ERR_SETTINGS = 12800007,<br/>IME_ERR_IMMS = 12800008,<br/>IME_ERR_DETACHED = 12800009,<br/>IME_ERR_NULL_POINTER = 12802000,<br/>IME_ERR_QUERY_FAILED = 12802001<br/>} | 输入法错误码。 |
75
76
77### 函数
78
79| 名称 | 描述 |
80| -------- | -------- |
81| [InputMethod_AttachOptions](#inputmethod_attachoptions) \* [OH_AttachOptions_Create](#oh_attachoptions_create) (bool showKeyboard) | 创建一个新的[InputMethod_AttachOptions](#inputmethod_attachoptions)实例。 |
82| void [OH_AttachOptions_Destroy](#oh_attachoptions_destroy) ([InputMethod_AttachOptions](#inputmethod_attachoptions) \*options) | 销毁一个[InputMethod_AttachOptions](#inputmethod_attachoptions)实例. |
83| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_AttachOptions_IsShowKeyboard](#oh_attachoptions_isshowkeyboard) ([InputMethod_AttachOptions](#inputmethod_attachoptions) \*options, bool \*showKeyboard) | 从[InputMethod_AttachOptions](#inputmethod_attachoptions)中获取是否显示键盘的值。 |
84| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*textEditorProxy, [InputMethod_AttachOptions](#inputmethod_attachoptions) \*options, [InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*\*inputMethodProxy) | 将应用绑定到输入法服务。 |
85| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodController_Detach](#oh_inputmethodcontroller_detach) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy) | 将应用从输入法服务解绑。 |
86| [InputMethod_CursorInfo](#inputmethod_cursorinfo) \* [OH_CursorInfo_Create](#oh_cursorinfo_create) (double left, double top, double width, double height) | 创建一个新的[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例。 |
87| void [OH_CursorInfo_Destroy](#oh_cursorinfo_destroy) ([InputMethod_CursorInfo](#inputmethod_cursorinfo) \*cursorInfo) | 销毁一个[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例。 |
88| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_CursorInfo_SetRect](#oh_cursorinfo_setrect) ([InputMethod_CursorInfo](#inputmethod_cursorinfo) \*cursorInfo, double left, double top, double width, double height) | 设置光标信息内容。 |
89| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_CursorInfo_GetRect](#oh_cursorinfo_getrect) ([InputMethod_CursorInfo](#inputmethod_cursorinfo) \*cursorInfo, double \*left, double \*top, double \*width, double \*height) | 获取光标信息内容。 |
90| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodProxy_ShowKeyboard](#oh_inputmethodproxy_showkeyboard) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy) | 显示键盘。 |
91| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodProxy_HideKeyboard](#oh_inputmethodproxy_hidekeyboard) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy) | 隐藏键盘。 |
92| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodProxy_NotifySelectionChange](#oh_inputmethodproxy_notifyselectionchange) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy, char16_t text[], size_t length, int start, int end) | 通知文本框选区变化。 |
93| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodProxy_NotifyConfigurationChange](#oh_inputmethodproxy_notifyconfigurationchange) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy, [InputMethod_EnterKeyType](#inputmethod_enterkeytype) enterKey, [InputMethod_TextInputType](#inputmethod_textinputtype) textType) | 通知输入框配置变化。 |
94| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodProxy_NotifyCursorUpdate](#oh_inputmethodproxy_notifycursorupdate) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy, [InputMethod_CursorInfo](#inputmethod_cursorinfo) \*cursorInfo) | 通知光标位置变化。 |
95| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_InputMethodProxy_SendPrivateCommand](#oh_inputmethodproxy_sendprivatecommand) ([InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy) \*inputMethodProxy, [InputMethod_PrivateCommand](#inputmethod_privatecommand) \*privateCommand[], size_t size) | 发送私有数据命令。 |
96| [InputMethod_PrivateCommand](#inputmethod_privatecommand) \* [OH_PrivateCommand_Create](#oh_privatecommand_create) (char key[], size_t keyLength) | 创建一个新的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例。 |
97| void [OH_PrivateCommand_Destroy](#oh_privatecommand_destroy) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command) | 销毁一个[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例。 |
98| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_SetKey](#oh_privatecommand_setkey) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, char key[], size_t keyLength) | 设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的key值。 |
99| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_SetBoolValue](#oh_privatecommand_setboolvalue) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, bool value) | 设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的布尔类型value值。 |
100| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_SetIntValue](#oh_privatecommand_setintvalue) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, int32_t value) | 设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的整数类型value值。 |
101| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_SetStrValue](#oh_privatecommand_setstrvalue) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, char value[], size_t valueLength) | 设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的字符串类型value值。 |
102| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_GetKey](#oh_privatecommand_getkey) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, const char \*\*key, size_t \*keyLength) | 从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取key值。 |
103| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_GetValueType](#oh_privatecommand_getvaluetype) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, [InputMethod_CommandValueType](#inputmethod_commandvaluetype) \*type) | 从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取value的数据类型。 |
104| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_GetBoolValue](#oh_privatecommand_getboolvalue) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, bool \*value) | 从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取布尔类型的value的值。 |
105| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_GetIntValue](#oh_privatecommand_getintvalue) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, int32_t \*value) | 从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取整数类型的value的值。 |
106| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_PrivateCommand_GetStrValue](#oh_privatecommand_getstrvalue) ([InputMethod_PrivateCommand](#inputmethod_privatecommand) \*command, const char \*\*value, size_t \*valueLength) | 从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取字符串类型的value的值。 |
107| [InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \* [OH_TextAvoidInfo_Create](#oh_textavoidinfo_create) (double positionY, double height) | 创建一个新的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例。 |
108| void [OH_TextAvoidInfo_Destroy](#oh_textavoidinfo_destroy) ([InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \*info) | 销毁一个[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例。 |
109| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextAvoidInfo_SetPositionY](#oh_textavoidinfo_setpositiony) ([InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \*info, double positionY) | 设置[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)中的Y坐标值。 |
110| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextAvoidInfo_SetHeight](#oh_textavoidinfo_setheight) ([InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \*info, double height) | 设置[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)中的高度值。 |
111| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextAvoidInfo_GetPositionY](#oh_textavoidinfo_getpositiony) ([InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \*info, double \*positionY) | 从[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)获取Y坐标值。 |
112| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextAvoidInfo_GetHeight](#oh_textavoidinfo_getheight) ([InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \*info, double \*height) | 从[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)获取高度值。 |
113| [InputMethod_TextConfig](#inputmethod_textconfig) \* [OH_TextConfig_Create](#oh_textconfig_create) () | 创建一个新的[InputMethod_TextConfig](#inputmethod_textconfig)实例。 |
114| void [OH_TextConfig_Destroy](#oh_textconfig_destroy) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config) | 销毁一个[InputMethod_TextConfig](#inputmethod_textconfig)实例。 |
115| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_SetInputType](#oh_textconfig_setinputtype) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, [InputMethod_TextInputType](#inputmethod_textinputtype) inputType) | 设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的输入框类型。 |
116| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_SetEnterKeyType](#oh_textconfig_setenterkeytype) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, [InputMethod_EnterKeyType](#inputmethod_enterkeytype) enterKeyType) | 设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的回车键功能类型。 |
117| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_SetPreviewTextSupport](#oh_textconfig_setpreviewtextsupport) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, bool supported) | 将预上屏支持情况设置到[InputMethod_TextConfig](#inputmethod_textconfig)实例。 |
118| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_SetSelection](#oh_textconfig_setselection) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, int32_t start, int32_t end) | 设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的选中文本范围。 |
119| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_SetWindowId](#oh_textconfig_setwindowid) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, int32_t windowId) | 设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的所属窗口的窗口id。 |
120| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_GetInputType](#oh_textconfig_getinputtype) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, [InputMethod_TextInputType](#inputmethod_textinputtype) \*inputType) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的输入框类型。 |
121| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_GetEnterKeyType](#oh_textconfig_getenterkeytype) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, [InputMethod_EnterKeyType](#inputmethod_enterkeytype) \*enterKeyType) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的回车键功能类型。 |
122| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_IsPreviewTextSupported](#oh_textconfig_ispreviewtextsupported) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, bool \*supported) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的是否支持预上屏。 |
123| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_GetCursorInfo](#oh_textconfig_getcursorinfo) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, [InputMethod_CursorInfo](#inputmethod_cursorinfo) \*\*cursorInfo) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的光标信息。 |
124| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_GetTextAvoidInfo](#oh_textconfig_gettextavoidinfo) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, [InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo) \*\*avoidInfo) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的避让信息。 |
125| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_GetSelection](#oh_textconfig_getselection) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, int32_t \*start, int32_t \*end) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的选区范围信息。 |
126| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextConfig_GetWindowId](#oh_textconfig_getwindowid) ([InputMethod_TextConfig](#inputmethod_textconfig) \*config, int32_t \*windowId) | 获取[InputMethod_TextConfig](#inputmethod_textconfig)实例所属窗口的窗口id。 |
127| [InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \* [OH_TextEditorProxy_Create](#oh_texteditorproxy_create) () | 创建一个新的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例。 |
128| void [OH_TextEditorProxy_Destroy](#oh_texteditorproxy_destroy) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy) | 销毁一个[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例。 |
129| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetGetTextConfigFunc](#oh_texteditorproxy_setgettextconfigfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc) getTextConfigFunc) | 将函数[OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
130| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetInsertTextFunc](#oh_texteditorproxy_setinserttextfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc) insertTextFunc) | 将函数[OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
131| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetDeleteForwardFunc](#oh_texteditorproxy_setdeleteforwardfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc) deleteForwardFunc) | 将函数[OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
132| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetDeleteBackwardFunc](#oh_texteditorproxy_setdeletebackwardfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc) deleteBackwardFunc) | 将函数[OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
133| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetSendKeyboardStatusFunc](#oh_texteditorproxy_setsendkeyboardstatusfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc) sendKeyboardStatusFunc) | 将函数[OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
134| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetSendEnterKeyFunc](#oh_texteditorproxy_setsendenterkeyfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc) sendEnterKeyFunc) | 将函数[OH_TextEditorProxy_SetSendEnterKeyFunc](#oh_texteditorproxy_setsendenterkeyfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
135| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetMoveCursorFunc](#oh_texteditorproxy_setmovecursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc) moveCursorFunc) | 将函数[OH_TextEditorProxy_SetMoveCursorFunc](#oh_texteditorproxy_setmovecursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
136| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetHandleSetSelectionFunc](#oh_texteditorproxy_sethandlesetselectionfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc) handleSetSelectionFunc) | 将函数[OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
137| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetHandleExtendActionFunc](#oh_texteditorproxy_sethandleextendactionfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc) handleExtendActionFunc) | 将函数[OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
138| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetGetLeftTextOfCursorFunc](#oh_texteditorproxy_setgetlefttextofcursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc) getLeftTextOfCursorFunc) | 将函数[OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
139| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetGetRightTextOfCursorFunc](#oh_texteditorproxy_setgetrighttextofcursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc) getRightTextOfCursorFunc) | 将函数[OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
140| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetGetTextIndexAtCursorFunc](#oh_texteditorproxy_setgettextindexatcursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc) getTextIndexAtCursorFunc) | 将函数[OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
141| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetReceivePrivateCommandFunc](#oh_texteditorproxy_setreceiveprivatecommandfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc) receivePrivateCommandFunc) | 将函数[OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
142| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetSetPreviewTextFunc](#oh_texteditorproxy_setsetpreviewtextfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc) setPreviewTextFunc) | 将函数[OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
143| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_SetFinishTextPreviewFunc](#oh_texteditorproxy_setfinishtextpreviewfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc) finishTextPreviewFunc) | 将函数[OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。 |
144| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetGetTextConfigFunc](#oh_texteditorproxy_getgettextconfigfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc) \*getTextConfigFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)函数。 |
145| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetInsertTextFunc](#oh_texteditorproxy_getinserttextfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc) \*insertTextFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)函数。 |
146| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetDeleteForwardFunc](#oh_texteditorproxy_getdeleteforwardfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc) \*deleteForwardFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)函数。 |
147| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetDeleteBackwardFunc](#oh_texteditorproxy_getdeletebackwardfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc) \*deleteBackwardFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)函数。 |
148| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetSendKeyboardStatusFunc](#oh_texteditorproxy_getsendkeyboardstatusfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc) \*sendKeyboardStatusFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)函数。 |
149| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetSendEnterKeyFunc](#oh_texteditorproxy_getsendenterkeyfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc) \*sendEnterKeyFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc)函数。 |
150| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetMoveCursorFunc](#oh_texteditorproxy_getmovecursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc) \*moveCursorFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc)函数。 |
151| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetHandleSetSelectionFunc](#oh_texteditorproxy_gethandlesetselectionfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc) \*handleSetSelectionFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)函数。 |
152| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetHandleExtendActionFunc](#oh_texteditorproxy_gethandleextendactionfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc) \*handleExtendActionFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)函数。 |
153| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetGetLeftTextOfCursorFunc](#oh_texteditorproxy_getgetlefttextofcursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc) \*getLeftTextOfCursorFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)函数。 |
154| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetGetRightTextOfCursorFunc](#oh_texteditorproxy_getgetrighttextofcursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc) \*getRightTextOfCursorFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)函数。 |
155| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetGetTextIndexAtCursorFunc](#oh_texteditorproxy_getgettextindexatcursorfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc) \*getTextIndexAtCursorFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)函数。 |
156| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetReceivePrivateCommandFunc](#oh_texteditorproxy_getreceiveprivatecommandfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc) \*receivePrivateCommandFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)函数。 |
157| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetSetPreviewTextFunc](#oh_texteditorproxy_getsetpreviewtextfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc) \*setPreviewTextFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)函数。 |
158| [InputMethod_ErrorCode](#inputmethod_errorcode) [OH_TextEditorProxy_GetFinishTextPreviewFunc](#oh_texteditorproxy_getfinishtextpreviewfunc) ([InputMethod_TextEditorProxy](#inputmethod_texteditorproxy) \*proxy, [OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc) \*finishTextPreviewFunc) | 从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)函数。 |
159
160
161## 类型定义说明
162
163
164### InputMethod_AttachOptions
165
166```
167typedef struct InputMethod_AttachOptions InputMethod_AttachOptions
168```
169
170**描述**
171
172绑定输入法时携带的选项。
173
174**起始版本:** 12
175
176
177### InputMethod_CommandValueType
178
179```
180typedef enum InputMethod_CommandValueType InputMethod_CommandValueType
181```
182
183**描述**
184
185私有数据类型。
186
187**起始版本:** 12
188
189
190### InputMethod_CursorInfo
191
192```
193typedef struct InputMethod_CursorInfo InputMethod_CursorInfo
194```
195
196**描述**
197
198光标的坐标位置、宽度和高度。
199
200**起始版本:** 12
201
202
203### InputMethod_Direction
204
205```
206typedef enum InputMethod_Direction InputMethod_Direction
207```
208
209**描述**
210
211移动方向。
212
213**起始版本:** 12
214
215
216### InputMethod_EnterKeyType
217
218```
219typedef enum InputMethod_EnterKeyType InputMethod_EnterKeyType
220```
221
222**描述**
223
224回车键功能类型。
225
226**起始版本:** 12
227
228
229### InputMethod_ErrorCode
230
231```
232typedef enum InputMethod_ErrorCode InputMethod_ErrorCode
233```
234
235**描述**
236
237输入法错误码。
238
239**起始版本:** 12
240
241
242### InputMethod_ExtendAction
243
244```
245typedef enum InputMethod_ExtendAction InputMethod_ExtendAction
246```
247
248**描述**
249
250编辑框中文本的扩展编辑操作类型。
251
252**起始版本:** 12
253
254
255### InputMethod_InputMethodProxy
256
257```
258typedef struct InputMethod_InputMethodProxy InputMethod_InputMethodProxy
259```
260
261**描述**
262
263输入法代理对象。
264
265使用此对象可以用于调用使用输入法的方法。
266
267**起始版本:** 12
268
269
270### InputMethod_KeyboardStatus
271
272```
273typedef enum InputMethod_KeyboardStatus InputMethod_KeyboardStatus
274```
275
276**描述**
277
278键盘状态。
279
280**起始版本:** 12
281
282
283### InputMethod_PrivateCommand
284
285```
286typedef struct InputMethod_PrivateCommand InputMethod_PrivateCommand
287```
288
289**描述**
290
291私有数据。
292
293输入框和输入法应用之间交互的私有数据。
294
295**起始版本:** 12
296
297
298### InputMethod_TextAvoidInfo
299
300```
301typedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo
302```
303
304**描述**
305
306输入框用于避让键盘的信息。
307
308**起始版本:** 12
309
310
311### InputMethod_TextConfig
312
313```
314typedef struct InputMethod_TextConfig InputMethod_TextConfig
315```
316
317**描述**
318
319输入框的配置信息。
320
321**起始版本:** 12
322
323
324### InputMethod_TextEditorProxy
325
326```
327typedef struct InputMethod_TextEditorProxy InputMethod_TextEditorProxy
328```
329
330**描述**
331
332输入框代理。
333
334提供了获取来自输入法应用的通知和请求的方法。
335
336**起始版本:** 12
337
338
339### InputMethod_TextInputType
340
341```
342typedef enum InputMethod_TextInputType InputMethod_TextInputType
343```
344
345**描述**
346
347文本输入类型。
348
349**起始版本:** 12
350
351
352### OH_TextEditorProxy_DeleteBackwardFunc
353
354```
355typedef void(* OH_TextEditorProxy_DeleteBackwardFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t length)
356```
357
358**描述**
359
360输入法删除光标左侧文本时触发的函数。
361
362您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
363
364**起始版本:** 12
365
366**参数:**
367
368| 名称 | 描述 |
369| -------- | -------- |
370| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
371| length | 要删除字符的长度。 |
372
373
374### OH_TextEditorProxy_DeleteForwardFunc
375
376```
377typedef void(* OH_TextEditorProxy_DeleteForwardFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t length)
378```
379
380**描述**
381
382输入法删除光标右侧文本时触发的函数。
383
384您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
385
386**起始版本:** 12
387
388**参数:**
389
390| 名称 | 描述 |
391| -------- | -------- |
392| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
393| length | 要删除字符的长度。 |
394
395
396### OH_TextEditorProxy_FinishTextPreviewFunc
397
398```
399typedef void(* OH_TextEditorProxy_FinishTextPreviewFunc) (InputMethod_TextEditorProxy *textEditorProxy)
400```
401
402**描述**
403
404输入法结束预上屏时触发的函数。
405
406您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
407
408**起始版本:** 12
409
410**参数:**
411
412| 名称 | 描述 |
413| -------- | -------- |
414| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
415
416
417### OH_TextEditorProxy_GetLeftTextOfCursorFunc
418
419```
420typedef void(* OH_TextEditorProxy_GetLeftTextOfCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)
421```
422
423**描述**
424
425输入法获取光标左侧文本时触发的函数。
426
427您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
428
429**起始版本:** 12
430
431**参数:**
432
433| 名称 | 描述 |
434| -------- | -------- |
435| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
436| number | 目标获取文本的长度。 |
437| text | 光标左侧指定长度的文本内容,需要在函数实现中对它赋值。 |
438
439
440### OH_TextEditorProxy_GetRightTextOfCursorFunc
441
442```
443typedef void(* OH_TextEditorProxy_GetRightTextOfCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length)
444```
445
446**描述**
447
448输入法获取光标右侧文本时触发的函数。
449
450您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
451
452**起始版本:** 12
453
454**参数:**
455
456| 名称 | 描述 |
457| -------- | -------- |
458| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
459| number | 目标获取文本的长度。 |
460| text | 光标右侧指定长度的文本内容,需要在函数实现中对它赋值。 |
461
462
463### OH_TextEditorProxy_GetTextConfigFunc
464
465```
466typedef void(* OH_TextEditorProxy_GetTextConfigFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config)
467```
468
469**描述**
470
471输入法获取输入框配置时触发的函数。
472
473您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
474
475**起始版本:** 12
476
477**参数:**
478
479| 名称 | 描述 |
480| -------- | -------- |
481| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
482| config | 输入框配置。 |
483
484
485### OH_TextEditorProxy_GetTextIndexAtCursorFunc
486
487```
488typedef int32_t(* OH_TextEditorProxy_GetTextIndexAtCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy)
489```
490
491**描述**
492
493输入法获取光标所在输入框文本索引时触发的函数。
494
495您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
496
497**起始版本:** 12
498
499**参数:**
500
501| 名称 | 描述 |
502| -------- | -------- |
503| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
504
505**返回:**
506
507返回光标所在输入框文本索引。
508
509
510### OH_TextEditorProxy_HandleExtendActionFunc
511
512```
513typedef void(* OH_TextEditorProxy_HandleExtendActionFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action)
514```
515
516**描述**
517
518输入法发送扩展编辑操作时触发的函数。
519
520您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
521
522**起始版本:** 12
523
524**参数:**
525
526| 名称 | 描述 |
527| -------- | -------- |
528| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
529| action | 扩展编辑操作,具体定义详见[InputMethod_ExtendAction](#inputmethod_extendaction)。 |
530
531
532### OH_TextEditorProxy_HandleSetSelectionFunc
533
534```
535typedef void(* OH_TextEditorProxy_HandleSetSelectionFunc) (InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end)
536```
537
538**描述**
539
540输入法请求选中文本时触发的函数。
541
542您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
543
544**起始版本:** 12
545
546**参数:**
547
548| 名称 | 描述 |
549| -------- | -------- |
550| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
551| start | 表示选中文本的起始位置。 |
552| end | 表示选中文本的结束位置。 |
553
554
555### OH_TextEditorProxy_InsertTextFunc
556
557```
558typedef void(* OH_TextEditorProxy_InsertTextFunc) (InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length)
559```
560
561**描述**
562
563输入法应用插入文本时触发的函数。
564
565您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
566
567**起始版本:** 12
568
569**参数:**
570
571| 名称 | 描述 |
572| -------- | -------- |
573| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
574| text | 插入的字符。 |
575| length | 插入字符的长度。 |
576
577
578### OH_TextEditorProxy_MoveCursorFunc
579
580```
581typedef void(* OH_TextEditorProxy_MoveCursorFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction)
582```
583
584**描述**
585
586输入法移动光标时触发的函数。
587
588您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
589
590**起始版本:** 12
591
592**参数:**
593
594| 名称 | 描述 |
595| -------- | -------- |
596| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
597| direction | 光标移动方向,具体定义详见[InputMethod_Direction](#inputmethod_direction)。 |
598
599
600### OH_TextEditorProxy_ReceivePrivateCommandFunc
601
602```
603typedef int32_t(* OH_TextEditorProxy_ReceivePrivateCommandFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size)
604```
605
606**描述**
607
608输入法应用发送私有数据命令时触发的函数。
609
610您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
611
612**起始版本:** 12
613
614**参数:**
615
616| 名称 | 描述 |
617| -------- | -------- |
618| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
619| privateCommand | 私有数据命令。 |
620| size | 私有数据的大小。 |
621
622**返回:**
623
624返回对私有数据命令处理的处理结果。
625
626
627### OH_TextEditorProxy_SendEnterKeyFunc
628
629```
630typedef void(* OH_TextEditorProxy_SendEnterKeyFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType)
631```
632
633**描述**
634
635输入法发送回车键时触发的函数。
636
637您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
638
639**起始版本:** 12
640
641**参数:**
642
643| 名称 | 描述 |
644| -------- | -------- |
645| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
646| enterKeyType | 回车键类型,具体定义详见[InputMethod_EnterKeyType](#inputmethod_enterkeytype)。 |
647
648
649### OH_TextEditorProxy_SendKeyboardStatusFunc
650
651```
652typedef void(* OH_TextEditorProxy_SendKeyboardStatusFunc) (InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus)
653```
654
655**描述**
656
657输入法通知键盘状态时触发的函数。
658
659您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
660
661**起始版本:** 12
662
663**参数:**
664
665| 名称 | 描述 |
666| -------- | -------- |
667| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
668| keyboardStatus | 键盘状态,具体定义详见[InputMethod_KeyboardStatus](#inputmethod_keyboardstatus)。 |
669
670
671### OH_TextEditorProxy_SetPreviewTextFunc
672
673```
674typedef int32_t(* OH_TextEditorProxy_SetPreviewTextFunc) (InputMethod_TextEditorProxy *textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end)
675```
676
677**描述**
678
679输入法设置预上屏文本时触发的函数。
680
681您需要实现此函数,将它设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中,并通过[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)完成注册。
682
683**起始版本:** 12
684
685**参数:**
686
687| 名称 | 描述 |
688| -------- | -------- |
689| textEditorProxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
690| text | 请求设置为预上屏样式的文本内容。 |
691| length | 预上屏文本长度。 |
692| start | 预上屏文本起始光标位置。 |
693| end | 预上屏文本结束光标位置。 |
694
695**返回:**
696
697返回设置预上屏文本的处理结果。
698
699
700## 枚举类型说明
701
702
703### InputMethod_CommandValueType
704
705```
706enum InputMethod_CommandValueType
707```
708
709**描述**
710
711私有数据类型。
712
713**起始版本:** 12
714
715| 枚举值 | 描述 |
716| -------- | -------- |
717| IME_COMMAND_VALUE_TYPE_NONE | NONE。 |
718| IME_COMMAND_VALUE_TYPE_STRING | 字符串类型。 |
719| IME_COMMAND_VALUE_TYPE_BOOL | 布尔类型。 |
720| IME_COMMAND_VALUE_TYPE_INT32 | 32位带符号整数类型。 |
721
722
723### InputMethod_Direction
724
725```
726enum InputMethod_Direction
727```
728
729**描述**
730
731移动方向。
732
733**起始版本:** 12
734
735| 枚举值 | 描述 |
736| -------- | -------- |
737| IME_DIRECTION_NONE | NONE。 |
738| IME_DIRECTION_UP | 向上。 |
739| IME_DIRECTION_DOWN | 向下。 |
740| IME_DIRECTION_LEFT | 向左。 |
741| IME_DIRECTION_RIGHT | 向右。 |
742
743
744### InputMethod_EnterKeyType
745
746```
747enum InputMethod_EnterKeyType
748```
749
750**描述**
751
752回车键功能类型。
753
754**起始版本:** 12
755
756| 枚举值 | 描述 |
757| -------- | -------- |
758| IME_ENTER_KEY_UNSPECIFIED | 未指定。 |
759| IME_ENTER_KEY_NONE | NONE。 |
760| IME_ENTER_KEY_GO | 前往。 |
761| IME_ENTER_KEY_SEARCH | 搜索。 |
762| IME_ENTER_KEY_SEND | 发送。 |
763| IME_ENTER_KEY_NEXT | 下一步。 |
764| IME_ENTER_KEY_DONE | 完成。 |
765| IME_ENTER_KEY_PREVIOUS | 上一步。 |
766| IME_ENTER_KEY_NEWLINE | 换行。 |
767
768
769### InputMethod_ErrorCode
770
771```
772enum InputMethod_ErrorCode
773```
774
775**描述**
776
777输入法错误码。
778
779**起始版本:** 12
780
781| 枚举值 | 描述 |
782| -------- | -------- |
783| IME_ERR_OK | 成功。 |
784| IME_ERR_UNDEFINED | 查询失败。 |
785| IME_ERR_PARAMCHECK | 参数检查失败。 |
786| IME_ERR_PACKAGEMANAGER | 包管理异常。 |
787| IME_ERR_IMENGINE | 输入法应用异常。 |
788| IME_ERR_IMCLIENT | 输入框客户端异常。 |
789| IME_ERR_CONFIG_PERSIST | 配置固化失败。当保存配置失败时,会报此错误码。 |
790| IME_ERR_CONTROLLER | 输入法控制器异常。 |
791| IME_ERR_SETTINGS | 输入法设置器异常。 |
792| IME_ERR_IMMS | 输入法管理服务异常。 |
793| IME_ERR_DETACHED | 输入框未绑定。 |
794| IME_ERR_NULL_POINTER | 空指针异常。 |
795| IME_ERR_QUERY_FAILED | 查询失败。 |
796
797
798### InputMethod_ExtendAction
799
800```
801enum InputMethod_ExtendAction
802```
803
804**描述**
805
806编辑框中文本的扩展编辑操作类型。
807
808**起始版本:** 12
809
810| 枚举值 | 描述 |
811| -------- | -------- |
812| IME_EXTEND_ACTION_SELECT_ALL | 全选。 |
813| IME_EXTEND_ACTION_CUT | 剪切。 |
814| IME_EXTEND_ACTION_COPY | 赋值。 |
815| IME_EXTEND_ACTION_PASTE | 粘贴。 |
816
817
818### InputMethod_KeyboardStatus
819
820```
821enum InputMethod_KeyboardStatus
822```
823
824**描述**
825
826键盘状态。
827
828**起始版本:** 12
829
830| 枚举值 | 描述 |
831| -------- | -------- |
832| IME_KEYBOARD_STATUS_NONE | 键盘状态为NONE。 |
833| IME_KEYBOARD_STATUS_HIDE | 键盘状态为隐藏。 |
834| IME_KEYBOARD_STATUS_SHOW | 键盘状态为显示。 |
835
836
837### InputMethod_TextInputType
838
839```
840enum InputMethod_TextInputType
841```
842
843**描述**
844
845文本输入类型。
846
847**起始版本:** 12
848
849| 枚举值 | 描述 |
850| -------- | -------- |
851| IME_TEXT_INPUT_TYPE_NONE | NONE。 |
852| IME_TEXT_INPUT_TYPE_TEXT | 文本类型。 |
853| IME_TEXT_INPUT_TYPE_MULTILINE | 多行类型。 |
854| IME_TEXT_INPUT_TYPE_NUMBER | 数字类型。 |
855| IME_TEXT_INPUT_TYPE_PHONE | 电话号码类型。 |
856| IME_TEXT_INPUT_TYPE_DATETIME | 日期类型。 |
857| IME_TEXT_INPUT_TYPE_EMAIL_ADDRESS | 邮箱地址类型。 |
858| IME_TEXT_INPUT_TYPE_URL | 链接类型。 |
859| IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORD | 密码类型。 |
860| IME_TEXT_INPUT_TYPE_NUMBER_PASSWORD | 数字密码类型。 |
861| IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORD | 锁屏密码类型。 |
862| IME_TEXT_INPUT_TYPE_USER_NAME | 用户名类型。 |
863| IME_TEXT_INPUT_TYPE_NEW_PASSWORD | 新密码类型。 |
864| IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL | NUMBER DECIMAL. |
865
866
867## 函数说明
868
869
870### OH_AttachOptions_Create()
871
872```
873InputMethod_AttachOptions* OH_AttachOptions_Create (bool showKeyboard)
874```
875
876**描述**
877
878创建一个新的[InputMethod_AttachOptions](#inputmethod_attachoptions)实例。
879
880**起始版本:** 12
881
882**参数:**
883
884| 名称 | 描述 |
885| -------- | -------- |
886| showKeyboard | 表示是否显示键盘。 |
887
888**返回:**
889
890如果创建成功,返回一个指向新创建的[InputMethod_AttachOptions](#inputmethod_attachoptions)实例的指针。 如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。
891
892
893### OH_AttachOptions_Destroy()
894
895```
896void OH_AttachOptions_Destroy (InputMethod_AttachOptions * options)
897```
898
899**描述**
900
901销毁一个[InputMethod_AttachOptions](#inputmethod_attachoptions)实例.
902
903**起始版本:** 12
904
905**参数:**
906
907| 名称 | 描述 |
908| -------- | -------- |
909| options | 表示即将被销毁的[InputMethod_AttachOptions](#inputmethod_attachoptions)实例。 |
910
911
912### OH_AttachOptions_IsShowKeyboard()
913
914```
915InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard (InputMethod_AttachOptions * options, bool * showKeyboard )
916```
917
918**描述**
919
920从[InputMethod_AttachOptions](#inputmethod_attachoptions)中获取是否显示键盘的值。
921
922**起始版本:** 12
923
924**参数:**
925
926| 名称 | 描述 |
927| -------- | -------- |
928| options | 表示被读取值的[InputMethod_AttachOptions](#inputmethod_attachoptions)实例。 |
929| showKeyboard | 表示绑定时是否显示键盘。 true - 表示绑定完成时需要显示键盘。 false - 表示绑定完成时不需要显示键盘. |
930
931**返回:**
932
933返回一个特定的错误码。
934
935IME_ERR_OK - 表示成功。
936
937IME_ERR_NULL_POINTER - 非预期的空指针。
938
939具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
940
941
942### OH_CursorInfo_Create()
943
944```
945InputMethod_CursorInfo* OH_CursorInfo_Create (double left, double top, double width, double height )
946```
947
948**描述**
949
950创建一个新的[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例。
951
952**起始版本:** 12
953
954**参数:**
955
956| 名称 | 描述 |
957| -------- | -------- |
958| left | 光标靠左点与物理屏幕左侧距离的绝对值。 |
959| top | 光标顶点与物理屏幕上侧距离的绝对值。 |
960| width | 宽度。 |
961| height | 高度。 |
962
963**返回:**
964
965如果创建成功,返回一个指向新创建的[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例的指针。 如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。
966
967
968### OH_CursorInfo_Destroy()
969
970```
971void OH_CursorInfo_Destroy (InputMethod_CursorInfo * cursorInfo)
972```
973
974**描述**
975
976销毁一个[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例。
977
978**起始版本:** 12
979
980**参数:**
981
982| 名称 | 描述 |
983| -------- | -------- |
984| cursorInfo | 表示指向即将被销毁的[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例的指针。 |
985
986
987### OH_CursorInfo_GetRect()
988
989```
990InputMethod_ErrorCode OH_CursorInfo_GetRect (InputMethod_CursorInfo * cursorInfo, double * left, double * top, double * width, double * height )
991```
992
993**描述**
994
995获取光标信息内容。
996
997**起始版本:** 12
998
999**参数:**
1000
1001| 名称 | 描述 |
1002| -------- | -------- |
1003| cursorInfo | 表示指向[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例的指针。 |
1004| left | 靠左点与物理屏幕左侧距离的绝对值。 |
1005| top | 顶点与物理屏幕上侧距离的绝对值。 |
1006| width | 宽度。 |
1007| height | 高度。 |
1008
1009**返回:**
1010
1011返回一个特定的错误码。
1012
1013IME_ERR_OK - 表示成功。
1014
1015IME_ERR_NULL_POINTER - 非预期的空指针。
1016
1017具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1018
1019
1020### OH_CursorInfo_SetRect()
1021
1022```
1023InputMethod_ErrorCode OH_CursorInfo_SetRect (InputMethod_CursorInfo * cursorInfo, double left, double top, double width, double height )
1024```
1025
1026**描述**
1027
1028设置光标信息内容。
1029
1030**起始版本:** 12
1031
1032**参数:**
1033
1034| 名称 | 描述 |
1035| -------- | -------- |
1036| cursorInfo | 表示指向[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例的指针。 |
1037| left | 光标靠左点与物理屏幕左侧距离的绝对值。 |
1038| top | 光标顶点与物理屏幕上侧距离的绝对值。 |
1039| width | 宽度。 |
1040| height | 高度。 |
1041
1042**返回:**
1043
1044返回一个特定的错误码。
1045
1046IME_ERR_OK - 表示成功。
1047
1048IME_ERR_NULL_POINTER - 非预期的空指针。
1049
1050具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1051
1052
1053### OH_InputMethodController_Attach()
1054
1055```
1056InputMethod_ErrorCode OH_InputMethodController_Attach (InputMethod_TextEditorProxy * textEditorProxy, InputMethod_AttachOptions * options, InputMethod_InputMethodProxy ** inputMethodProxy )
1057```
1058
1059**描述**
1060
1061将应用绑定到输入法服务。
1062
1063**起始版本:** 12
1064
1065**参数:**
1066
1067| 名称 | 描述 |
1068| -------- | -------- |
1069| textEditorProxy | 表示指向[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 调用者需要自行管理textEditorProxy的生命周期。 并且如果调用成功,调用者在下次发起绑定或解绑之前,不能将textEditorProxy释放。 |
1070| options | 表示指向[InputMethod_AttachOptions](#inputmethod_attachoptions)实例的指针,是绑定时的选项。 |
1071| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。生命周期维持到下一次绑定或解绑的调用。 |
1072
1073**返回:**
1074
1075返回一个特定的错误码。
1076
1077IME_ERR_OK - 表示成功。
1078
1079IME_ERR_PARAMCHECK - 表示参数错误。
1080
1081IME_ERR_IMCLIENT - 输入法客户端错误。
1082
1083IME_ERR_IMMS - 输入法服务错误。
1084
1085IME_ERR_NULL_POINTER - 非预期的空指针。
1086
1087具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1088
1089
1090### OH_InputMethodController_Detach()
1091
1092```
1093InputMethod_ErrorCode OH_InputMethodController_Detach (InputMethod_InputMethodProxy * inputMethodProxy)
1094```
1095
1096**描述**
1097
1098将应用从输入法服务解绑。
1099
1100**起始版本:** 12
1101
1102**参数:**
1103
1104| 名称 | 描述 |
1105| -------- | -------- |
1106| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1107
1108**返回:**
1109
1110返回一个特定的错误码。
1111
1112IME_ERR_OK - 表示成功。
1113
1114IME_ERR_IMCLIENT - 表示输入法客户端错误。
1115
1116IME_ERR_IMMS - 表示输入法服务错误。
1117
1118IME_ERR_NULL_POINTER - 非预期的空指针。
1119
1120具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1121
1122
1123### OH_InputMethodProxy_HideKeyboard()
1124
1125```
1126InputMethod_ErrorCode OH_InputMethodProxy_HideKeyboard (InputMethod_InputMethodProxy * inputMethodProxy)
1127```
1128
1129**描述**
1130
1131隐藏键盘。
1132
1133**起始版本:** 12
1134
1135**参数:**
1136
1137| 名称 | 描述 |
1138| -------- | -------- |
1139| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1140
1141**返回:**
1142
1143返回一个特定的错误码。
1144
1145IME_ERR_OK - 表示成功。
1146
1147IME_ERR_IMCLIENT - 表示输入法客户端错误。
1148
1149IME_ERR_IMMS - 表示输入法服务错误。
1150
1151IME_ERR_DETACHED - 未绑定输入法。
1152
1153IME_ERR_NULL_POINTER - 非预期的空指针。
1154
1155具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1156
1157
1158### OH_InputMethodProxy_NotifyConfigurationChange()
1159
1160```
1161InputMethod_ErrorCode OH_InputMethodProxy_NotifyConfigurationChange (InputMethod_InputMethodProxy * inputMethodProxy, InputMethod_EnterKeyType enterKey, InputMethod_TextInputType textType )
1162```
1163
1164**描述**
1165
1166通知输入框配置变化。
1167
1168**起始版本:** 12
1169
1170**参数:**
1171
1172| 名称 | 描述 |
1173| -------- | -------- |
1174| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1175| enterKey | 回车键类型。 |
1176| textType | 输入框类型。 |
1177
1178**返回:**
1179
1180返回一个特定的错误码。
1181
1182IME_ERR_OK - 表示成功。
1183
1184IME_ERR_PARAMCHECK - 表示参数错误。
1185
1186IME_ERR_IMCLIENT - 输入法客户端错误。
1187
1188IME_ERR_IMMS - 表示输入法服务错误。
1189
1190IME_ERR_DETACHED - 未绑定输入法。
1191
1192IME_ERR_NULL_POINTER - 非预期的空指针。
1193
1194具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1195
1196
1197### OH_InputMethodProxy_NotifyCursorUpdate()
1198
1199```
1200InputMethod_ErrorCode OH_InputMethodProxy_NotifyCursorUpdate (InputMethod_InputMethodProxy * inputMethodProxy, InputMethod_CursorInfo * cursorInfo )
1201```
1202
1203**描述**
1204
1205通知光标位置变化。
1206
1207**起始版本:** 12
1208
1209**参数:**
1210
1211| 名称 | 描述 |
1212| -------- | -------- |
1213| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1214| cursorInfo | 指向[InputMethod_CursorInfo](#inputmethod_cursorinfo)实例的指针,表示光标信息。 |
1215
1216**返回:**
1217
1218返回一个特定的错误码。
1219
1220IME_ERR_OK - 表示成功。
1221
1222IME_ERR_PARAMCHECK - 表示参数错误。
1223
1224IME_ERR_IMCLIENT - 输入法客户端错误。
1225
1226IME_ERR_IMMS - 表示输入法服务错误。
1227
1228IME_ERR_DETACHED - 未绑定输入法。
1229
1230IME_ERR_NULL_POINTER - 非预期的空指针。
1231
1232具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1233
1234
1235### OH_InputMethodProxy_NotifySelectionChange()
1236
1237```
1238InputMethod_ErrorCode OH_InputMethodProxy_NotifySelectionChange (InputMethod_InputMethodProxy * inputMethodProxy, char16_t text[], size_t length, int start, int end )
1239```
1240
1241**描述**
1242
1243通知文本框选区变化。
1244
1245当输入框内文本内容、光标位置或选中文本发生变化时,通过此接口将信息通知给输入法应用。
1246
1247**起始版本:** 12
1248
1249**参数:**
1250
1251| 名称 | 描述 |
1252| -------- | -------- |
1253| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1254| text | 整个输入文本。 |
1255| length | text参数的长度。最大长度为8K。 |
1256| start | 所选文本的起始位置。 |
1257| end | 所选文本的结束位置。 |
1258
1259**返回:**
1260
1261返回一个特定的错误码。
1262
1263IME_ERR_OK - 表示成功。
1264
1265IME_ERR_PARAMCHECK - 表示参数错误。
1266
1267IME_ERR_IMCLIENT - 输入法客户端错误。
1268
1269IME_ERR_IMMS - 表示输入法服务错误。
1270
1271IME_ERR_DETACHED - 未绑定输入法。
1272
1273IME_ERR_NULL_POINTER - 非预期的空指针。
1274
1275具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1276
1277
1278### OH_InputMethodProxy_SendPrivateCommand()
1279
1280```
1281InputMethod_ErrorCode OH_InputMethodProxy_SendPrivateCommand (InputMethod_InputMethodProxy * inputMethodProxy, InputMethod_PrivateCommand * privateCommand[], size_t size )
1282```
1283
1284**描述**
1285
1286发送私有数据命令。
1287
1288**起始版本:** 12
1289
1290**参数:**
1291
1292| 名称 | 描述 |
1293| -------- | -------- |
1294| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1295| privateCommand | 私有命令, 定义在[InputMethod_PrivateCommand](#inputmethod_privatecommand),最大大小为32KB。 |
1296| size | 私有命令的大小. 最大大小为5。 |
1297
1298**返回:**
1299
1300返回一个特定的错误码。
1301
1302IME_ERR_OK - 表示成功。
1303
1304IME_ERR_PARAMCHECK - 表示参数错误。
1305
1306IME_ERR_IMCLIENT - 输入法客户端错误。
1307
1308IME_ERR_IMMS - 表示输入法服务错误。
1309
1310IME_ERR_DETACHED - 未绑定输入法。
1311
1312IME_ERR_NULL_POINTER - 非预期的空指针。
1313
1314具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1315
1316
1317### OH_InputMethodProxy_ShowKeyboard()
1318
1319```
1320InputMethod_ErrorCode OH_InputMethodProxy_ShowKeyboard (InputMethod_InputMethodProxy * inputMethodProxy)
1321```
1322
1323**描述**
1324
1325显示键盘。
1326
1327**起始版本:** 12
1328
1329**参数:**
1330
1331| 名称 | 描述 |
1332| -------- | -------- |
1333| inputMethodProxy | 表示指向[InputMethod_InputMethodProxy](#inputmethod_inputmethodproxy)实例的指针。 inputMethodProxy由调用[OH_InputMethodController_Attach](#oh_inputmethodcontroller_attach)获取。 |
1334
1335**返回:**
1336
1337返回一个特定的错误码。
1338
1339IME_ERR_OK - 表示成功。
1340
1341IME_ERR_PARAMCHECK - 表示参数错误。
1342
1343IME_ERR_IMCLIENT - 输入法客户端错误。
1344
1345IME_ERR_IMMS - 表示输入法服务错误。
1346
1347IME_ERR_DETACHED - 未绑定输入法。
1348
1349IME_ERR_NULL_POINTER - 非预期的空指针。
1350
1351具体错误码可以参考[InputMethod_ErrorCode](#inputmethod_errorcode)。
1352
1353
1354### OH_PrivateCommand_Create()
1355
1356```
1357InputMethod_PrivateCommand* OH_PrivateCommand_Create (char key[], size_t keyLength )
1358```
1359
1360**描述**
1361
1362创建一个新的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例。
1363
1364**起始版本:** 12
1365
1366**参数:**
1367
1368| 名称 | 描述 |
1369| -------- | -------- |
1370| key | 私有数据的key值。 |
1371| keyLength | key长度。 |
1372
1373**返回:**
1374
1375如果创建成功,返回一个指向新创建的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。
1376
1377
1378### OH_PrivateCommand_Destroy()
1379
1380```
1381void OH_PrivateCommand_Destroy (InputMethod_PrivateCommand * command)
1382```
1383
1384**描述**
1385
1386销毁一个[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例。
1387
1388**起始版本:** 12
1389
1390**参数:**
1391
1392| 名称 | 描述 |
1393| -------- | -------- |
1394| command | 指向即将被销毁的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1395
1396
1397### OH_PrivateCommand_GetBoolValue()
1398
1399```
1400InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue (InputMethod_PrivateCommand * command, bool * value )
1401```
1402
1403**描述**
1404
1405从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取布尔类型的value的值。
1406
1407**起始版本:** 12
1408
1409**参数:**
1410
1411| 名称 | 描述 |
1412| -------- | -------- |
1413| command | 指向即将被获取value值的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1414| value | 布尔类型的value的值。 |
1415
1416**返回:**
1417
1418返回一个特定的错误码。
1419
1420IME_ERR_OK - 表示成功。
1421
1422IME_ERR_NULL_POINTER - 非预期的空指针。
1423
1424具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1425
1426
1427### OH_PrivateCommand_GetIntValue()
1428
1429```
1430InputMethod_ErrorCode OH_PrivateCommand_GetIntValue (InputMethod_PrivateCommand * command, int32_t * value )
1431```
1432
1433**描述**
1434
1435从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取整数类型的value的值。
1436
1437**起始版本:** 12
1438
1439**参数:**
1440
1441| 名称 | 描述 |
1442| -------- | -------- |
1443| command | 指向即将被获取value值的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1444| value | 整数类型的value的值。 |
1445
1446**返回:**
1447
1448返回一个特定的错误码。
1449
1450IME_ERR_OK - 表示成功。
1451
1452IME_ERR_NULL_POINTER - 非预期的空指针。
1453
1454具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1455
1456
1457### OH_PrivateCommand_GetKey()
1458
1459```
1460InputMethod_ErrorCode OH_PrivateCommand_GetKey (InputMethod_PrivateCommand * command, const char ** key, size_t * keyLength )
1461```
1462
1463**描述**
1464
1465从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取key值。
1466
1467**起始版本:** 12
1468
1469**参数:**
1470
1471| 名称 | 描述 |
1472| -------- | -------- |
1473| command | 指向即将被获取key值的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1474| key | key的生命周期和command一致。不要直接保存key地址,或者直接写key。建议拷贝后使用。 |
1475| keyLength | key长度。 |
1476
1477**返回:**
1478
1479返回一个特定的错误码。
1480
1481IME_ERR_OK - 表示成功。
1482
1483IME_ERR_NULL_POINTER - 非预期的空指针。
1484
1485具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1486
1487
1488### OH_PrivateCommand_GetStrValue()
1489
1490```
1491InputMethod_ErrorCode OH_PrivateCommand_GetStrValue (InputMethod_PrivateCommand * command, const char ** value, size_t * valueLength )
1492```
1493
1494**描述**
1495
1496从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取字符串类型的value的值。
1497
1498**起始版本:** 12
1499
1500**参数:**
1501
1502| 名称 | 描述 |
1503| -------- | -------- |
1504| command | 指向即将被获取value值的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1505| value | 字符串类型的value的值。 |
1506| valueLength | value的生命周期和command一致。不要直接保存value地址,或者直接写value。建议拷贝后使用。 |
1507
1508**返回:**
1509
1510返回一个特定的错误码。
1511
1512IME_ERR_OK - 表示成功。
1513
1514IME_ERR_NULL_POINTER - 非预期的空指针。
1515
1516具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1517
1518
1519### OH_PrivateCommand_GetValueType()
1520
1521```
1522InputMethod_ErrorCode OH_PrivateCommand_GetValueType (InputMethod_PrivateCommand * command, InputMethod_CommandValueType * type )
1523```
1524
1525**描述**
1526
1527从[InputMethod_PrivateCommand](#inputmethod_privatecommand)获取value的数据类型。
1528
1529**起始版本:** 12
1530
1531**参数:**
1532
1533| 名称 | 描述 |
1534| -------- | -------- |
1535| command | 指向即将被获取value值的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1536| type | value值的数据类型。 |
1537
1538**返回:**
1539
1540返回一个特定的错误码。
1541
1542IME_ERR_OK - 表示成功。
1543
1544IME_ERR_NULL_POINTER - 非预期的空指针。
1545
1546具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1547
1548
1549### OH_PrivateCommand_SetBoolValue()
1550
1551```
1552InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue (InputMethod_PrivateCommand * command, bool value )
1553```
1554
1555**描述**
1556
1557设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的布尔类型value值。
1558
1559**起始版本:** 12
1560
1561**参数:**
1562
1563| 名称 | 描述 |
1564| -------- | -------- |
1565| command | 指向即将被设置的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1566| value | 布尔类型value值。 |
1567
1568**返回:**
1569
1570返回一个特定的错误码。
1571
1572IME_ERR_OK - 表示成功。
1573
1574IME_ERR_NULL_POINTER - 非预期的空指针。
1575
1576具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1577
1578
1579### OH_PrivateCommand_SetIntValue()
1580
1581```
1582InputMethod_ErrorCode OH_PrivateCommand_SetIntValue (InputMethod_PrivateCommand * command, int32_t value )
1583```
1584
1585**描述**
1586
1587设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的整数类型value值。
1588
1589**起始版本:** 12
1590
1591**参数:**
1592
1593| 名称 | 描述 |
1594| -------- | -------- |
1595| command | 指向即将被设置的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1596| value | 整型value值。 |
1597
1598**返回:**
1599
1600返回一个特定的错误码。
1601
1602IME_ERR_OK - 表示成功。
1603
1604IME_ERR_NULL_POINTER - 非预期的空指针。
1605
1606具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1607
1608
1609### OH_PrivateCommand_SetKey()
1610
1611```
1612InputMethod_ErrorCode OH_PrivateCommand_SetKey (InputMethod_PrivateCommand * command, char key[], size_t keyLength )
1613```
1614
1615**描述**
1616
1617设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的key值。
1618
1619**起始版本:** 12
1620
1621**参数:**
1622
1623| 名称 | 描述 |
1624| -------- | -------- |
1625| command | 指向即将被设置的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1626| key | key值。 |
1627| keyLength | key长度。 |
1628
1629**返回:**
1630
1631返回一个特定的错误码。
1632
1633IME_ERR_OK - 表示成功。
1634
1635IME_ERR_NULL_POINTER - 非预期的空指针。
1636
1637具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1638
1639
1640### OH_PrivateCommand_SetStrValue()
1641
1642```
1643InputMethod_ErrorCode OH_PrivateCommand_SetStrValue (InputMethod_PrivateCommand * command, char value[], size_t valueLength )
1644```
1645
1646**描述**
1647
1648设置[InputMethod_PrivateCommand](#inputmethod_privatecommand)的字符串类型value值。
1649
1650**起始版本:** 12
1651
1652**参数:**
1653
1654| 名称 | 描述 |
1655| -------- | -------- |
1656| command | 指向即将被设置的[InputMethod_PrivateCommand](#inputmethod_privatecommand)实例的指针。 |
1657| value | 字符串类型value值。 |
1658
1659**返回:**
1660
1661返回一个特定的错误码。
1662
1663IME_ERR_OK - 表示成功。
1664
1665IME_ERR_NULL_POINTER - 非预期的空指针。
1666
1667具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1668
1669
1670### OH_TextAvoidInfo_Create()
1671
1672```
1673InputMethod_TextAvoidInfo* OH_TextAvoidInfo_Create (double positionY, double height )
1674```
1675
1676**描述**
1677
1678创建一个新的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例。
1679
1680**起始版本:** 12
1681
1682**参数:**
1683
1684| 名称 | 描述 |
1685| -------- | -------- |
1686| positionY | 表示输入框位置的Y坐标值。 |
1687| height | 表示输入框高度。 |
1688
1689**返回:**
1690
1691如果创建成功,返回一个指向新创建的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例的指针。 如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。
1692
1693
1694### OH_TextAvoidInfo_Destroy()
1695
1696```
1697void OH_TextAvoidInfo_Destroy (InputMethod_TextAvoidInfo * info)
1698```
1699
1700**描述**
1701
1702销毁一个[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例。
1703
1704**起始版本:** 12
1705
1706**参数:**
1707
1708| 名称 | 描述 |
1709| -------- | -------- |
1710| options | 表示指向即将被销毁的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例的指针。 |
1711
1712
1713### OH_TextAvoidInfo_GetHeight()
1714
1715```
1716InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight (InputMethod_TextAvoidInfo * info, double * height )
1717```
1718
1719**描述**
1720
1721从[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)获取高度值。
1722
1723**起始版本:** 12
1724
1725**参数:**
1726
1727| 名称 | 描述 |
1728| -------- | -------- |
1729| info | 指向即将被获取值的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例的指针。 |
1730| height | 输入框高度。 |
1731
1732**返回:**
1733
1734返回一个特定的错误码。
1735
1736IME_ERR_OK - 表示成功。
1737
1738IME_ERR_NULL_POINTER - 非预期的空指针。
1739
1740具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1741
1742
1743### OH_TextAvoidInfo_GetPositionY()
1744
1745```
1746InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY (InputMethod_TextAvoidInfo * info, double * positionY )
1747```
1748
1749**描述**
1750
1751从[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)获取Y坐标值。
1752
1753**起始版本:** 12
1754
1755**参数:**
1756
1757| 名称 | 描述 |
1758| -------- | -------- |
1759| info | 指向即将被获取值的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例的指针。 |
1760| positionY | positionY值,即输入框顶点与物理屏幕上侧距离的绝对值。 |
1761
1762**返回:**
1763
1764返回一个特定的错误码。
1765
1766IME_ERR_OK - 表示成功。
1767
1768IME_ERR_NULL_POINTER - 非预期的空指针。
1769
1770具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1771
1772
1773### OH_TextAvoidInfo_SetHeight()
1774
1775```
1776InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight (InputMethod_TextAvoidInfo * info, double height )
1777```
1778
1779**描述**
1780
1781设置[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)中的高度值。
1782
1783**起始版本:** 12
1784
1785**参数:**
1786
1787| 名称 | 描述 |
1788| -------- | -------- |
1789| info | 指向即将被设置值的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例的指针。 |
1790| height | 高度值。 |
1791
1792**返回:**
1793
1794返回一个特定的错误码。
1795
1796IME_ERR_OK - 表示成功。
1797
1798IME_ERR_NULL_POINTER - 非预期的空指针。
1799
1800具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1801
1802
1803### OH_TextAvoidInfo_SetPositionY()
1804
1805```
1806InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY (InputMethod_TextAvoidInfo * info, double positionY )
1807```
1808
1809**描述**
1810
1811设置[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)中的Y坐标值。
1812
1813**起始版本:** 12
1814
1815**参数:**
1816
1817| 名称 | 描述 |
1818| -------- | -------- |
1819| info | 指向即将被设置值的[InputMethod_TextAvoidInfo](#inputmethod_textavoidinfo)实例的指针。 |
1820| positionY | positionY值,即输入框顶点与物理屏幕上侧距离的绝对值。 |
1821
1822**返回:**
1823
1824返回一个特定的错误码。
1825
1826IME_ERR_OK - 表示成功。
1827
1828IME_ERR_NULL_POINTER - 非预期的空指针。
1829
1830具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1831
1832
1833### OH_TextConfig_Create()
1834
1835```
1836InputMethod_TextConfig* OH_TextConfig_Create ()
1837```
1838
1839**描述**
1840
1841创建一个新的[InputMethod_TextConfig](#inputmethod_textconfig)实例。
1842
1843**起始版本:** 12
1844
1845**返回:**
1846
1847如果创建成功,返回一个指向新创建的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。
1848
1849
1850### OH_TextConfig_Destroy()
1851
1852```
1853void OH_TextConfig_Destroy (InputMethod_TextConfig * config)
1854```
1855
1856**描述**
1857
1858销毁一个[InputMethod_TextConfig](#inputmethod_textconfig)实例。
1859
1860**起始版本:** 12
1861
1862**参数:**
1863
1864| 名称 | 描述 |
1865| -------- | -------- |
1866| config | 表示指向即将被销毁的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
1867
1868
1869### OH_TextConfig_GetCursorInfo()
1870
1871```
1872InputMethod_ErrorCode OH_TextConfig_GetCursorInfo (InputMethod_TextConfig * config, InputMethod_CursorInfo ** cursorInfo )
1873```
1874
1875**描述**
1876
1877获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的光标信息。
1878
1879**起始版本:** 12
1880
1881**参数:**
1882
1883| 名称 | 描述 |
1884| -------- | -------- |
1885| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
1886| cursorInfo | 光标信息。 |
1887
1888**返回:**
1889
1890返回一个特定的错误码。
1891
1892IME_ERR_OK - 表示成功。
1893
1894IME_ERR_NULL_POINTER - 非预期的空指针。
1895
1896具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1897
1898
1899### OH_TextConfig_GetEnterKeyType()
1900
1901```
1902InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType (InputMethod_TextConfig * config, InputMethod_EnterKeyType * enterKeyType )
1903```
1904
1905**描述**
1906
1907获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的回车键功能类型。
1908
1909**起始版本:** 12
1910
1911**参数:**
1912
1913| 名称 | 描述 |
1914| -------- | -------- |
1915| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
1916| enterKeyType | 输入框的回车键功能类型。 |
1917
1918**返回:**
1919
1920返回一个特定的错误码。
1921
1922IME_ERR_OK - 表示成功。
1923
1924IME_ERR_NULL_POINTER - 非预期的空指针。
1925
1926具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1927
1928
1929### OH_TextConfig_GetInputType()
1930
1931```
1932InputMethod_ErrorCode OH_TextConfig_GetInputType (InputMethod_TextConfig * config, InputMethod_TextInputType * inputType )
1933```
1934
1935**描述**
1936
1937获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的输入框类型。
1938
1939**起始版本:** 12
1940
1941**参数:**
1942
1943| 名称 | 描述 |
1944| -------- | -------- |
1945| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
1946| inputType | 输入框的输入类型。 |
1947
1948**返回:**
1949
1950返回一个特定的错误码。
1951
1952IME_ERR_OK - 表示成功。
1953
1954IME_ERR_NULL_POINTER - 非预期的空指针。
1955
1956具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1957
1958
1959### OH_TextConfig_GetSelection()
1960
1961```
1962InputMethod_ErrorCode OH_TextConfig_GetSelection (InputMethod_TextConfig * config, int32_t * start, int32_t * end )
1963```
1964
1965**描述**
1966
1967获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的选区范围信息。
1968
1969**起始版本:** 12
1970
1971**参数:**
1972
1973| 名称 | 描述 |
1974| -------- | -------- |
1975| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
1976| start | 所选文本的起始位置。 |
1977| end | 所选文本的结束位置。 |
1978
1979**返回:**
1980
1981返回一个特定的错误码。
1982
1983IME_ERR_OK - 表示成功。
1984
1985IME_ERR_NULL_POINTER - 非预期的空指针。
1986
1987具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
1988
1989### OH_TextConfig_GetTextAvoidInfo()
1990
1991```
1992InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo (InputMethod_TextConfig * config, InputMethod_TextAvoidInfo ** avoidInfo )
1993```
1994
1995**描述**
1996
1997获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的避让信息。
1998
1999**起始版本:** 12
2000
2001**参数:**
2002
2003| 名称 | 描述 |
2004| -------- | -------- |
2005| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2006| avoidInfo | 输入框避让信息。 |
2007
2008**返回:**
2009
2010返回一个特定的错误码。
2011
2012IME_ERR_OK - 表示成功。
2013
2014IME_ERR_NULL_POINTER - 非预期的空指针。
2015
2016具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2017
2018
2019### OH_TextConfig_GetWindowId()
2020
2021```
2022InputMethod_ErrorCode OH_TextConfig_GetWindowId (InputMethod_TextConfig * config, int32_t * windowId )
2023```
2024
2025**描述**
2026
2027获取[InputMethod_TextConfig](#inputmethod_textconfig)实例所属窗口的窗口id。
2028
2029**起始版本:** 12
2030
2031**参数:**
2032
2033| 名称 | 描述 |
2034| -------- | -------- |
2035| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2036| windowId | 绑定输入法的应用所属窗口的窗口id。 |
2037
2038**返回:**
2039
2040返回一个特定的错误码。
2041
2042IME_ERR_OK - 表示成功。
2043
2044IME_ERR_NULL_POINTER - 非预期的空指针。
2045
2046具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2047
2048
2049### OH_TextConfig_IsPreviewTextSupported()
2050
2051```
2052InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported (InputMethod_TextConfig * config, bool * supported )
2053```
2054
2055**描述**
2056
2057获取[InputMethod_TextConfig](#inputmethod_textconfig)实例的是否支持预上屏。
2058
2059**起始版本:** 12
2060
2061**参数:**
2062
2063| 名称 | 描述 |
2064| -------- | -------- |
2065| config | 指向即将被获取值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2066| supported | 表示输入框是否支持预上屏。 |
2067
2068**返回:**
2069
2070返回一个特定的错误码。
2071
2072IME_ERR_OK - 表示成功。
2073
2074IME_ERR_NULL_POINTER - 非预期的空指针。
2075
2076具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2077
2078
2079### OH_TextConfig_SetEnterKeyType()
2080
2081```
2082InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType (InputMethod_TextConfig * config, InputMethod_EnterKeyType enterKeyType )
2083```
2084
2085**描述**
2086
2087设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的回车键功能类型。
2088
2089**起始版本:** 12
2090
2091**参数:**
2092
2093| 名称 | 描述 |
2094| -------- | -------- |
2095| config | 指向即将被设置值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2096| enterKeyType | 回车键功能类型。 |
2097
2098**返回:**
2099
2100返回一个特定的错误码。
2101
2102IME_ERR_OK - 表示成功。
2103
2104IME_ERR_NULL_POINTER - 非预期的空指针。
2105
2106具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2107
2108
2109### OH_TextConfig_SetInputType()
2110
2111```
2112InputMethod_ErrorCode OH_TextConfig_SetInputType (InputMethod_TextConfig * config, InputMethod_TextInputType inputType )
2113```
2114
2115**描述**
2116
2117设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的输入框类型。
2118
2119**起始版本:** 12
2120
2121**参数:**
2122
2123| 名称 | 描述 |
2124| -------- | -------- |
2125| config | 指向即将被设置值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2126| inputType | 输入框的输入类型。 |
2127
2128**返回:**
2129
2130返回一个特定的错误码。
2131
2132IME_ERR_OK - 表示成功。
2133
2134IME_ERR_NULL_POINTER - 非预期的空指针。
2135
2136具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2137
2138
2139### OH_TextConfig_SetPreviewTextSupport()
2140
2141```
2142InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport (InputMethod_TextConfig * config, bool supported )
2143```
2144
2145**描述**
2146
2147将预上屏支持情况设置到[InputMethod_TextConfig](#inputmethod_textconfig)实例。
2148
2149**起始版本:** 12
2150
2151**参数:**
2152
2153| 名称 | 描述 |
2154| -------- | -------- |
2155| config | 指向即将被设置值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2156| supported | 表示输入框是否支持预上屏。 |
2157
2158**返回:**
2159
2160返回一个特定的错误码。
2161
2162IME_ERR_OK - 表示成功。
2163
2164IME_ERR_NULL_POINTER - 非预期的空指针。
2165
2166具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2167
2168
2169### OH_TextConfig_SetSelection()
2170
2171```
2172InputMethod_ErrorCode OH_TextConfig_SetSelection (InputMethod_TextConfig * config, int32_t start, int32_t end )
2173```
2174
2175**描述**
2176
2177设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的选中文本范围。
2178
2179**起始版本:** 12
2180
2181**参数:**
2182
2183| 名称 | 描述 |
2184| -------- | -------- |
2185| config | 指向即将被设置值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2186| start | 所选文本的起始位置。 |
2187| end | 所选文本的结束位置。 |
2188
2189**返回:**
2190
2191返回一个特定的错误码。
2192
2193IME_ERR_OK - 表示成功。
2194
2195IME_ERR_NULL_POINTER - 非预期的空指针。
2196
2197具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2198
2199
2200### OH_TextConfig_SetWindowId()
2201
2202```
2203InputMethod_ErrorCode OH_TextConfig_SetWindowId (InputMethod_TextConfig * config, int32_t windowId )
2204```
2205
2206**描述**
2207
2208设置[InputMethod_TextConfig](#inputmethod_textconfig)实例的所属窗口的窗口id。
2209
2210**起始版本:** 12
2211
2212**参数:**
2213
2214| 名称 | 描述 |
2215| -------- | -------- |
2216| config | 指向即将被设置值的[InputMethod_TextConfig](#inputmethod_textconfig)实例的指针。 |
2217| windowId | 绑定输入法的应用所属窗口的窗口id。 |
2218
2219**返回:**
2220
2221返回一个特定的错误码。
2222
2223IME_ERR_OK - 表示成功。
2224
2225IME_ERR_NULL_POINTER - 非预期的空指针。
2226
2227具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2228
2229
2230### OH_TextEditorProxy_Create()
2231
2232```
2233InputMethod_TextEditorProxy* OH_TextEditorProxy_Create ()
2234```
2235
2236**描述**
2237
2238创建一个新的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例。
2239
2240**起始版本:** 12
2241
2242**返回:**
2243
2244如果创建成功,返回一个指向新创建的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。
2245
2246
2247### OH_TextEditorProxy_Destroy()
2248
2249```
2250void OH_TextEditorProxy_Destroy (InputMethod_TextEditorProxy * proxy)
2251```
2252
2253**描述**
2254
2255销毁一个[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例。
2256
2257**起始版本:** 12
2258
2259**参数:**
2260
2261| 名称 | 描述 |
2262| -------- | -------- |
2263| proxy | 表示指向即将被销毁的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2264
2265
2266### OH_TextEditorProxy_GetDeleteBackwardFunc()
2267
2268```
2269InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteBackwardFunc * deleteBackwardFunc )
2270```
2271
2272**描述**
2273
2274从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)函数。
2275
2276**起始版本:** 12
2277
2278**参数:**
2279
2280| 名称 | 描述 |
2281| -------- | -------- |
2282| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2283| deleteBackwardFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)。 |
2284
2285**返回:**
2286
2287返回一个特定的错误码。
2288
2289IME_ERR_OK - 表示成功。
2290
2291IME_ERR_NULL_POINTER - 非预期的空指针。
2292
2293具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2294
2295
2296### OH_TextEditorProxy_GetDeleteForwardFunc()
2297
2298```
2299InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteForwardFunc * deleteForwardFunc )
2300```
2301
2302**描述**
2303
2304从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)函数。
2305
2306**起始版本:** 12
2307
2308**参数:**
2309
2310| 名称 | 描述 |
2311| -------- | -------- |
2312| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2313| deleteForwardFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)。 |
2314
2315**返回:**
2316
2317返回一个特定的错误码。
2318
2319IME_ERR_OK - 表示成功。
2320
2321IME_ERR_NULL_POINTER - 非预期的空指针。
2322
2323具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2324
2325
2326### OH_TextEditorProxy_GetFinishTextPreviewFunc()
2327
2328```
2329InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_FinishTextPreviewFunc * finishTextPreviewFunc )
2330```
2331
2332**描述**
2333
2334从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)函数。
2335
2336**起始版本:** 12
2337
2338**参数:**
2339
2340| 名称 | 描述 |
2341| -------- | -------- |
2342| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2343| finishTextPreviewFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)。 |
2344
2345**返回:**
2346
2347返回一个特定的错误码。
2348
2349IME_ERR_OK - 表示成功。
2350
2351IME_ERR_NULL_POINTER - 非预期的空指针。
2352
2353具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2354
2355
2356### OH_TextEditorProxy_GetGetLeftTextOfCursorFunc()
2357
2358```
2359InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc * getLeftTextOfCursorFunc )
2360```
2361
2362**描述**
2363
2364从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)函数。
2365
2366**起始版本:** 12
2367
2368**参数:**
2369
2370| 名称 | 描述 |
2371| -------- | -------- |
2372| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2373| getLeftTextOfCursorFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)。 |
2374
2375**返回:**
2376
2377返回一个特定的错误码。
2378
2379IME_ERR_OK - 表示成功。
2380
2381IME_ERR_NULL_POINTER - 非预期的空指针。
2382
2383具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2384
2385
2386### OH_TextEditorProxy_GetGetRightTextOfCursorFunc()
2387
2388```
2389InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc * getRightTextOfCursorFunc )
2390```
2391
2392**描述**
2393
2394从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)函数。
2395
2396**起始版本:** 12
2397
2398**参数:**
2399
2400| 名称 | 描述 |
2401| -------- | -------- |
2402| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2403| getRightTextOfCursorFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)。 |
2404
2405**返回:**
2406
2407返回一个特定的错误码。
2408
2409IME_ERR_OK - 表示成功。
2410
2411IME_ERR_NULL_POINTER - 非预期的空指针。
2412
2413具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2414
2415
2416### OH_TextEditorProxy_GetGetTextConfigFunc()
2417
2418```
2419InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextConfigFunc * getTextConfigFunc )
2420```
2421
2422**描述**
2423
2424从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)函数。
2425
2426**起始版本:** 12
2427
2428**参数:**
2429
2430| 名称 | 描述 |
2431| -------- | -------- |
2432| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2433| getTextConfigFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)。 |
2434
2435**返回:**
2436
2437返回一个特定的错误码。
2438
2439IME_ERR_OK - 表示成功。
2440
2441IME_ERR_NULL_POINTER - 非预期的空指针。
2442
2443具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2444
2445
2446### OH_TextEditorProxy_GetGetTextIndexAtCursorFunc()
2447
2448```
2449InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc * getTextIndexAtCursorFunc )
2450```
2451
2452**描述**
2453
2454从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)函数。
2455
2456**起始版本:** 12
2457
2458**参数:**
2459
2460| 名称 | 描述 |
2461| -------- | -------- |
2462| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2463| getTextIndexAtCursorFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)。 |
2464
2465**返回:**
2466
2467返回一个特定的错误码。
2468
2469IME_ERR_OK - 表示成功。
2470
2471IME_ERR_NULL_POINTER - 非预期的空指针。
2472
2473具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2474
2475
2476### OH_TextEditorProxy_GetHandleExtendActionFunc()
2477
2478```
2479InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleExtendActionFunc * handleExtendActionFunc )
2480```
2481
2482**描述**
2483
2484从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)函数。
2485
2486**起始版本:** 12
2487
2488**参数:**
2489
2490| 名称 | 描述 |
2491| -------- | -------- |
2492| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2493| handleExtendActionFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)。 |
2494
2495**返回:**
2496
2497返回一个特定的错误码。
2498
2499IME_ERR_OK - 表示成功。
2500
2501IME_ERR_NULL_POINTER - 非预期的空指针。
2502
2503具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2504
2505
2506### OH_TextEditorProxy_GetHandleSetSelectionFunc()
2507
2508```
2509InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleSetSelectionFunc * handleSetSelectionFunc )
2510```
2511
2512**描述**
2513
2514从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)函数。
2515
2516**起始版本:** 12
2517
2518**参数:**
2519
2520| 名称 | 描述 |
2521| -------- | -------- |
2522| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2523| handleSetSelectionFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)。 |
2524
2525**返回:**
2526
2527返回一个特定的错误码。
2528
2529IME_ERR_OK - 表示成功。
2530
2531IME_ERR_NULL_POINTER - 非预期的空指针。
2532
2533具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2534
2535
2536### OH_TextEditorProxy_GetInsertTextFunc()
2537
2538```
2539InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_InsertTextFunc * insertTextFunc )
2540```
2541
2542**描述**
2543
2544从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)函数。
2545
2546**起始版本:** 12
2547
2548**参数:**
2549
2550| 名称 | 描述 |
2551| -------- | -------- |
2552| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2553| insertTextFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)。 |
2554
2555**返回:**
2556
2557返回一个特定的错误码。
2558
2559IME_ERR_OK - 表示成功。
2560
2561IME_ERR_NULL_POINTER - 非预期的空指针。
2562
2563具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2564
2565
2566### OH_TextEditorProxy_GetMoveCursorFunc()
2567
2568```
2569InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_MoveCursorFunc * moveCursorFunc )
2570```
2571
2572**描述**
2573
2574从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc)函数。
2575
2576**起始版本:** 12
2577
2578**参数:**
2579
2580| 名称 | 描述 |
2581| -------- | -------- |
2582| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2583| moveCursorFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc)。 |
2584
2585**返回:**
2586
2587返回一个特定的错误码。
2588
2589IME_ERR_OK - 表示成功。
2590
2591IME_ERR_NULL_POINTER - 非预期的空指针。
2592
2593具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2594
2595
2596### OH_TextEditorProxy_GetReceivePrivateCommandFunc()
2597
2598```
2599InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc * receivePrivateCommandFunc )
2600```
2601
2602**描述**
2603
2604从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)函数。
2605
2606**起始版本:** 12
2607
2608**参数:**
2609
2610| 名称 | 描述 |
2611| -------- | -------- |
2612| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2613| receivePrivateCommandFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)。 |
2614
2615**返回:**
2616
2617返回一个特定的错误码。
2618
2619IME_ERR_OK - 表示成功。
2620
2621IME_ERR_NULL_POINTER - 非预期的空指针。
2622
2623具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2624
2625
2626### OH_TextEditorProxy_GetSendEnterKeyFunc()
2627
2628```
2629InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendEnterKeyFunc * sendEnterKeyFunc )
2630```
2631
2632**描述**
2633
2634从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc)函数。
2635
2636**起始版本:** 12
2637
2638**参数:**
2639
2640| 名称 | 描述 |
2641| -------- | -------- |
2642| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2643| sendEnterKeyFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc)。 |
2644
2645**返回:**
2646
2647返回一个特定的错误码。
2648
2649IME_ERR_OK - 表示成功。
2650
2651IME_ERR_NULL_POINTER - 非预期的空指针。
2652
2653具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2654
2655
2656### OH_TextEditorProxy_GetSendKeyboardStatusFunc()
2657
2658```
2659InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendKeyboardStatusFunc * sendKeyboardStatusFunc )
2660```
2661
2662**描述**
2663
2664从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)函数。
2665
2666**起始版本:** 12
2667
2668**参数:**
2669
2670| 名称 | 描述 |
2671| -------- | -------- |
2672| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2673| sendKeyboardStatusFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)。 |
2674
2675**返回:**
2676
2677返回一个特定的错误码。
2678
2679IME_ERR_OK - 表示成功。
2680
2681IME_ERR_NULL_POINTER - 非预期的空指针。
2682
2683具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2684
2685
2686### OH_TextEditorProxy_GetSetPreviewTextFunc()
2687
2688```
2689InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SetPreviewTextFunc * setPreviewTextFunc )
2690```
2691
2692**描述**
2693
2694从[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中获取[OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)函数。
2695
2696**起始版本:** 12
2697
2698**参数:**
2699
2700| 名称 | 描述 |
2701| -------- | -------- |
2702| proxy | 指向被读取的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2703| setPreviewTextFunc | 表示从proxy获取到的函数[OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)。 |
2704
2705**返回:**
2706
2707返回一个特定的错误码。
2708
2709IME_ERR_OK - 表示成功。
2710
2711IME_ERR_NULL_POINTER - 非预期的空指针。
2712
2713具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2714
2715
2716### OH_TextEditorProxy_SetDeleteBackwardFunc()
2717
2718```
2719InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc )
2720```
2721
2722**描述**
2723
2724将函数[OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2725
2726**起始版本:** 12
2727
2728**参数:**
2729
2730| 名称 | 描述 |
2731| -------- | -------- |
2732| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2733| deleteBackwardFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_DeleteBackwardFunc](#oh_texteditorproxy_deletebackwardfunc)。 |
2734
2735**返回:**
2736
2737返回一个特定的错误码。
2738
2739IME_ERR_OK - 表示成功。
2740
2741IME_ERR_NULL_POINTER - 非预期的空指针。
2742
2743具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2744
2745
2746### OH_TextEditorProxy_SetDeleteForwardFunc()
2747
2748```
2749InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc )
2750```
2751
2752**描述**
2753
2754将函数[OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2755
2756**起始版本:** 12
2757
2758**参数:**
2759
2760| 名称 | 描述 |
2761| -------- | -------- |
2762| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2763| deleteForwardFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_DeleteForwardFunc](#oh_texteditorproxy_deleteforwardfunc)。 |
2764
2765**返回:**
2766
2767返回一个特定的错误码。
2768
2769IME_ERR_OK - 表示成功。
2770
2771IME_ERR_NULL_POINTER - 非预期的空指针。
2772
2773具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2774
2775
2776### OH_TextEditorProxy_SetFinishTextPreviewFunc()
2777
2778```
2779InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc )
2780```
2781
2782**描述**
2783
2784将函数[OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2785
2786**起始版本:** 12
2787
2788**参数:**
2789
2790| 名称 | 描述 |
2791| -------- | -------- |
2792| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2793| finishTextPreviewFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_FinishTextPreviewFunc](#oh_texteditorproxy_finishtextpreviewfunc)。 |
2794
2795**返回:**
2796
2797返回一个特定的错误码。
2798
2799IME_ERR_OK - 表示成功。
2800
2801IME_ERR_NULL_POINTER - 非预期的空指针。
2802
2803具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2804
2805
2806### OH_TextEditorProxy_SetGetLeftTextOfCursorFunc()
2807
2808```
2809InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc )
2810```
2811
2812**描述**
2813
2814将函数[OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2815
2816**起始版本:** 12
2817
2818**参数:**
2819
2820| 名称 | 描述 |
2821| -------- | -------- |
2822| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2823| getLeftTextOfCursorFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_GetLeftTextOfCursorFunc](#oh_texteditorproxy_getlefttextofcursorfunc)。 |
2824
2825**返回:**
2826
2827返回一个特定的错误码。
2828
2829IME_ERR_OK - 表示成功。
2830
2831IME_ERR_NULL_POINTER - 非预期的空指针。
2832
2833具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2834
2835
2836### OH_TextEditorProxy_SetGetRightTextOfCursorFunc()
2837
2838```
2839InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc )
2840```
2841
2842**描述**
2843
2844将函数[OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2845
2846**起始版本:** 12
2847
2848**参数:**
2849
2850| 名称 | 描述 |
2851| -------- | -------- |
2852| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2853| getRightTextOfCursorFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_GetRightTextOfCursorFunc](#oh_texteditorproxy_getrighttextofcursorfunc)。 |
2854
2855**返回:**
2856
2857返回一个特定的错误码。
2858
2859IME_ERR_OK - 表示成功。
2860
2861IME_ERR_NULL_POINTER - 非预期的空指针。
2862
2863具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2864
2865
2866### OH_TextEditorProxy_SetGetTextConfigFunc()
2867
2868```
2869InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc )
2870```
2871
2872**描述**
2873
2874将函数[OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2875
2876**起始版本:** 12
2877
2878**参数:**
2879
2880| 名称 | 描述 |
2881| -------- | -------- |
2882| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2883| getTextConfigFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_GetTextConfigFunc](#oh_texteditorproxy_gettextconfigfunc)。 |
2884
2885**返回:**
2886
2887返回一个特定的错误码。
2888
2889IME_ERR_OK - 表示成功。
2890
2891IME_ERR_NULL_POINTER - 非预期的空指针。
2892
2893具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2894
2895
2896### OH_TextEditorProxy_SetGetTextIndexAtCursorFunc()
2897
2898```
2899InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc )
2900```
2901
2902**描述**
2903
2904将函数[OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2905
2906**起始版本:** 12
2907
2908**参数:**
2909
2910| 名称 | 描述 |
2911| -------- | -------- |
2912| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2913| getTextIndexAtCursorFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_GetTextIndexAtCursorFunc](#oh_texteditorproxy_gettextindexatcursorfunc)。 |
2914
2915**返回:**
2916
2917返回一个特定的错误码。
2918
2919IME_ERR_OK - 表示成功。
2920
2921IME_ERR_NULL_POINTER - 非预期的空指针。
2922
2923具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2924
2925
2926### OH_TextEditorProxy_SetHandleExtendActionFunc()
2927
2928```
2929InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc )
2930```
2931
2932**描述**
2933
2934将函数[OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2935
2936**起始版本:** 12
2937
2938**参数:**
2939
2940| 名称 | 描述 |
2941| -------- | -------- |
2942| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2943| handleExtendActionFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_HandleExtendActionFunc](#oh_texteditorproxy_handleextendactionfunc)。 |
2944
2945**返回:**
2946
2947返回一个特定的错误码。
2948
2949IME_ERR_OK - 表示成功。
2950
2951IME_ERR_NULL_POINTER - 非预期的空指针。
2952
2953具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2954
2955
2956### OH_TextEditorProxy_SetHandleSetSelectionFunc()
2957
2958```
2959InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc )
2960```
2961
2962**描述**
2963
2964将函数[OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2965
2966**起始版本:** 12
2967
2968**参数:**
2969
2970| 名称 | 描述 |
2971| -------- | -------- |
2972| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
2973| handleSetSelectionFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_HandleSetSelectionFunc](#oh_texteditorproxy_handlesetselectionfunc)。 |
2974
2975**返回:**
2976
2977返回一个特定的错误码。
2978
2979IME_ERR_OK - 表示成功。
2980
2981IME_ERR_NULL_POINTER - 非预期的空指针。
2982
2983具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
2984
2985
2986### OH_TextEditorProxy_SetInsertTextFunc()
2987
2988```
2989InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc )
2990```
2991
2992**描述**
2993
2994将函数[OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
2995
2996**起始版本:** 12
2997
2998**参数:**
2999
3000| 名称 | 描述 |
3001| -------- | -------- |
3002| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
3003| insertTextFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_InsertTextFunc](#oh_texteditorproxy_inserttextfunc)。 |
3004
3005**返回:**
3006
3007返回一个特定的错误码。
3008
3009IME_ERR_OK - 表示成功。
3010
3011IME_ERR_NULL_POINTER - 非预期的空指针。
3012
3013具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
3014
3015
3016### OH_TextEditorProxy_SetMoveCursorFunc()
3017
3018```
3019InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc )
3020```
3021
3022**描述**
3023
3024将函数[OH_TextEditorProxy_SetMoveCursorFunc](#oh_texteditorproxy_setmovecursorfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
3025
3026**起始版本:** 12
3027
3028**参数:**
3029
3030| 名称 | 描述 |
3031| -------- | -------- |
3032| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
3033| moveCursorFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_MoveCursorFunc](#oh_texteditorproxy_movecursorfunc)。 |
3034
3035**返回:**
3036
3037返回一个特定的错误码。
3038
3039IME_ERR_OK - 表示成功。
3040
3041IME_ERR_NULL_POINTER - 非预期的空指针。
3042
3043具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
3044
3045
3046### OH_TextEditorProxy_SetReceivePrivateCommandFunc()
3047
3048```
3049InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc )
3050```
3051
3052**描述**
3053
3054将函数[OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
3055
3056**起始版本:** 12
3057
3058**参数:**
3059
3060| 名称 | 描述 |
3061| -------- | -------- |
3062| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
3063| receivePrivateCommandFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_ReceivePrivateCommandFunc](#oh_texteditorproxy_receiveprivatecommandfunc)。 |
3064
3065**返回:**
3066
3067返回一个特定的错误码。
3068
3069IME_ERR_OK - 表示成功。
3070
3071IME_ERR_NULL_POINTER - 非预期的空指针。
3072
3073具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
3074
3075
3076### OH_TextEditorProxy_SetSendEnterKeyFunc()
3077
3078```
3079InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc )
3080```
3081
3082**描述**
3083
3084将函数[OH_TextEditorProxy_SetSendEnterKeyFunc](#oh_texteditorproxy_setsendenterkeyfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
3085
3086**起始版本:** 12
3087
3088**参数:**
3089
3090| 名称 | 描述 |
3091| -------- | -------- |
3092| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
3093| sendEnterKeyFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_SendEnterKeyFunc](#oh_texteditorproxy_sendenterkeyfunc)。 |
3094
3095**返回:**
3096
3097返回一个特定的错误码。
3098
3099IME_ERR_OK - 表示成功。
3100
3101IME_ERR_NULL_POINTER - 非预期的空指针。
3102
3103具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
3104
3105
3106### OH_TextEditorProxy_SetSendKeyboardStatusFunc()
3107
3108```
3109InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc )
3110```
3111
3112**描述**
3113
3114将函数[OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
3115
3116**起始版本:** 12
3117
3118**参数:**
3119
3120| 名称 | 描述 |
3121| -------- | -------- |
3122| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
3123| sendKeyboardStatusFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_SendKeyboardStatusFunc](#oh_texteditorproxy_sendkeyboardstatusfunc)。 |
3124
3125**返回:**
3126
3127返回一个特定的错误码。
3128
3129IME_ERR_OK - 表示成功。
3130
3131IME_ERR_NULL_POINTER - 非预期的空指针。
3132
3133具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。
3134
3135
3136### OH_TextEditorProxy_SetSetPreviewTextFunc()
3137
3138```
3139InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc (InputMethod_TextEditorProxy * proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc )
3140```
3141
3142**描述**
3143
3144将函数[OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)设置到[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)中。
3145
3146**起始版本:** 12
3147
3148**参数:**
3149
3150| 名称 | 描述 |
3151| -------- | -------- |
3152| proxy | 指向即将被设置的[InputMethod_TextEditorProxy](#inputmethod_texteditorproxy)实例的指针。 |
3153| setPreviewTextFunc | 表示被设置到proxy的函数[OH_TextEditorProxy_SetPreviewTextFunc](#oh_texteditorproxy_setpreviewtextfunc)。 |
3154
3155**返回:**
3156
3157返回一个特定的错误码。
3158
3159IME_ERR_OK - 表示成功。
3160
3161IME_ERR_NULL_POINTER - 非预期的空指针。
3162
3163具体错误码可以参考 [InputMethod_ErrorCode](#inputmethod_errorcode)。