openharmony 鸿蒙 capi-inputmethod-attach-options-capi-h

2026-08-25 浏览 (1)

inputmethod_attach_options_capi.h

Overview

Provides methods for creating, destroying, reading, and writing the option object bound to the input method.

File to include: <inputmethod/inputmethod_attach_options_capi.h>

Library: libohinputmethod.so

System capability: SystemCapability.MiscServices.InputMethodFramework

Since: 12

Related module: InputMethod

Summary

Structs

Nametypedef KeywordDescription
InputMethod_AttachOptionsInputMethod_AttachOptionsOptions for binding the input method.

Function

NameDescription
InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard)Creates an InputMethod_AttachOptions instance.
InputMethod_AttachOptions *OH_AttachOptions_CreateWithRequestKeyboardReason(bool showKeyboard, InputMethod_RequestKeyboardReason requestKeyboardReason)Creates an InputMethod_AttachOptions instance.
void OH_AttachOptions_Destroy(InputMethod_AttachOptions *options)Destroys an InputMethod_AttachOptions instance.
InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions *options, bool *showKeyboard)Obtains the value that indicates whether to display the keyboard from InputMethod_AttachOptions.
InputMethod_ErrorCode OH_AttachOptions_GetRequestKeyboardReason(InputMethod_AttachOptions *options, int *requestKeyboardReason)Obtains the reason that triggers the input method from InputMethod_AttachOptions.

Function Description

OH_AttachOptions_Create()

InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard)

Description

Creates an InputMethod_AttachOptions instance.

Since: 12

Parameters

NameDescription
bool showKeyboardPointer to whether to display the keyboard during binding. true: The keyboard is displayed after the binding is complete. false: The keyboard is hidden after the binding is complete.

Returns

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

OH_AttachOptions_CreateWithRequestKeyboardReason()

InputMethod_AttachOptions *OH_AttachOptions_CreateWithRequestKeyboardReason(bool showKeyboard, InputMethod_RequestKeyboardReason requestKeyboardReason)

Description

Creates an InputMethod_AttachOptions instance.

Since: 15

Parameters

NameDescription
bool showKeyboardPointer to whether to display the keyboard during binding. true: The keyboard is displayed after the binding is complete. false: The keyboard is hidden after the binding is complete.
InputMethod_RequestKeyboardReason requestKeyboardReasonReason for requesting the keyboard.

Returns

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

OH_AttachOptions_Destroy()

void OH_AttachOptions_Destroy(InputMethod_AttachOptions *options)

Description

Destroys an InputMethod_AttachOptions instance.

Since: 12

Parameters

NameDescription
InputMethod_AttachOptions *optionsInputMethod_AttachOptions instance to be destroyed.

OH_AttachOptions_IsShowKeyboard()

InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions *options, bool *showKeyboard)

Description

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

Since: 12

Parameters

NameDescription
InputMethod_AttachOptions *optionsPointer to the InputMethod_AttachOptions instance whose value is to be read.
bool *showKeyboardPointer to whether to display the keyboard during binding. true: The keyboard is displayed after the binding is complete. false: The keyboard is hidden after the binding is complete.

Returns

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

OH_AttachOptions_GetRequestKeyboardReason()

InputMethod_ErrorCode OH_AttachOptions_GetRequestKeyboardReason(InputMethod_AttachOptions *options, int *requestKeyboardReason)

Description

Obtains the reason for requesting the keyboard from InputMethod_AttachOptions.

Since: 15

Parameters

NameDescription
InputMethod_AttachOptions *optionsPointer to the InputMethod_AttachOptions instance whose value is to be read.
int *requestKeyboardReasonPointer to the reason for requesting the keyboard.

Returns

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

你可能感兴趣的鸿蒙文章

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-controller-capi-h

openharmony 鸿蒙 capi-inputmethod

openharmony 鸿蒙 js-apis-inputmethod-panel

openharmony 鸿蒙 js-apis-inputmethodengine

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

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