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
| Name | typedef Keyword | Description |
|---|---|---|
| InputMethod_AttachOptions | InputMethod_AttachOptions | Options for binding the input method. |
Function
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| bool showKeyboard | Pointer 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
| Type | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| bool showKeyboard | Pointer 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 requestKeyboardReason | Reason for requesting the keyboard. |
Returns
| Type | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| InputMethod_AttachOptions *options | InputMethod_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
| Name | Description |
|---|---|
| InputMethod_AttachOptions *options | Pointer to the InputMethod_AttachOptions instance whose value is to be read. |
| bool *showKeyboard | Pointer 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
| Type | Description |
|---|---|
| InputMethod_ErrorCode | An 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
| Name | Description |
|---|---|
| InputMethod_AttachOptions *options | Pointer to the InputMethod_AttachOptions instance whose value is to be read. |
| int *requestKeyboardReason | Pointer to the reason for requesting the keyboard. |
Returns
| Type | Description |
|---|---|
| InputMethod_ErrorCode | An error code. IME_ERR_OK - Success. IME_ERR_NULL_POINTER - An unexpected null pointer. For details about the error codes, see InputMethod_ErrorCode. |