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

2026-08-25 浏览 (1)

inputmethod_controller_capi.h

Overview

Provides methods for binding and unbinding input methods.

File to include: <inputmethod/inputmethod_controller_capi.h>

Library: libohinputmethod.so

System capability: SystemCapability.MiscServices.InputMethodFramework

Since: 12

Related module: InputMethod

Summary

Function

NameDescription
InputMethod_ErrorCode OH_InputMethodController_Attach(InputMethod_TextEditorProxy *textEditorProxy,InputMethod_AttachOptions *options, InputMethod_InputMethodProxy **inputMethodProxy)Binds an application to the input method service.
InputMethod_ErrorCode OH_InputMethodController_AttachWithUIContext(ArkUI_ContextHandle context, InputMethod_TextEditorProxy *textEditorProxy, InputMethod_AttachOptions *options, InputMethod_InputMethodProxy **inputMethodProxy)Binds an application to the input method service.
InputMethod_ErrorCode OH_InputMethodController_Detach(InputMethod_InputMethodProxy *inputMethodProxy)Unbinds an application from the input method service.

Function Description

OH_InputMethodController_Attach()

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

Description

Binds an application to the input method service.

Since: 12

Parameters

NameDescription
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance. The caller needs to manage the textEditorProxy lifecycle. If the calling is successful, the caller cannot release textEditorProxy before the next binding or unbinding call.
InputMethod_AttachOptions *optionsPointer to the InputMethod_AttachOptions instance. This parameter is used to specify the options of attaching an input method.
InputMethod_InputMethodProxy **inputMethodProxyDouble pointer to the InputMethod_InputMethodProxy instance. The lifecycle lasts until the next binding or unbinding call.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_PARAMCHECK - Parameter error.
IME_ERR_IMCLIENT - Client error in input method.
IME_ERR_IMMS - Input method service error.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_InputMethodController_AttachWithUIContext()

InputMethod_ErrorCode OH_InputMethodController_AttachWithUIContext(ArkUI_ContextHandle context, InputMethod_TextEditorProxy *textEditorProxy, InputMethod_AttachOptions *options, InputMethod_InputMethodProxy **inputMethodProxy)

Description

Binds an application to the input method service.

Since: 23

Parameters

NameDescription
ArkUI_ContextHandle contextPointer to the ArkUI_Context instance.
InputMethod_TextEditorProxy *textEditorProxyPointer to the InputMethod_TextEditorProxy instance. The caller needs to manage the textEditorProxy lifecycle. If the calling is successful, the caller cannot release textEditorProxy before the next binding or unbinding call.
InputMethod_AttachOptions *optionsPointer to the InputMethod_AttachOptions instance. This parameter is used to specify the options of attaching an input method.
InputMethod_InputMethodProxy **inputMethodProxyDouble pointer to the InputMethod_InputMethodProxy instance. The lifecycle lasts until the next binding or unbinding call.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_PARAMCHECK - Parameter error.
IME_ERR_IMCLIENT - Client error in input method.
IME_ERR_IMMS - Input method service error.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_InputMethodController_Detach()

InputMethod_ErrorCode OH_InputMethodController_Detach(InputMethod_InputMethodProxy *inputMethodProxy)

Description

Unbinds an application from the input method service.

Since: 12

Parameters

NameDescription
InputMethod_InputMethodProxy *inputMethodProxyPointer to the InputMethod_InputMethodProxy instance obtained by calling OH_InputMethodController_Attach.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_IMCLIENT - Client error in input method.
IME_ERR_IMMS - Input method service error.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-inputmethod-inputmethod-textconfig

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

openharmony 鸿蒙 js-apis-inputmethod-subtype

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

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

openharmony 鸿蒙 capi-inputmethod

openharmony 鸿蒙 js-apis-inputmethod-panel

openharmony 鸿蒙 js-apis-inputmethodengine

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

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

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