inputmethod_text_avoid_info_capi.h

Overview

Provides methods for creating, destroying, reading, and writing the text box avoidance information objects.

File to include: <inputmethod/inputmethod_text_avoid_info_capi.h>

Library: libohinputmethod.so

System capability: SystemCapability.MiscServices.InputMethodFramework

Since: 12

Related module: InputMethod

Summary

Structs

Name typedef Keyword Description
InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo Represents the information used by the input box to avoid the keyboard.

Function

Name Description
InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height) Creates an InputMethod_TextAvoidInfo instance.
void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info) Destroys an InputMethod_TextAvoidInfo instance.
InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY) Sets the Y coordinate in InputMethod_TextAvoidInfo.
InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height) Sets the height in InputMethod_TextAvoidInfo.
InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY) Obtains the Y coordinate from InputMethod_TextAvoidInfo.
InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height) Obtains the height from InputMethod_TextAvoidInfo.

Function Description

OH_TextAvoidInfo_Create()

InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height)

Description

Creates an InputMethod_TextAvoidInfo instance.

Since: 12

Parameters

Name Description
double positionY Y coordinate of the text box, in px.
double height Height of the text box, in px.

Returns

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

OH_TextAvoidInfo_Destroy()

void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info)

Description

Destroys an InputMethod_TextAvoidInfo instance.

Since: 12

Parameters

Name Description
InputMethod_TextAvoidInfo *info Pointer to the InputMethod_TextAvoidInfo instance to be destroyed.

OH_TextAvoidInfo_SetPositionY()

InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY)

Description

Sets the Y coordinate in InputMethod_TextAvoidInfo.

Since: 12

Parameters

Name Description
InputMethod_TextAvoidInfo *info Pointer to the InputMethod_TextAvoidInfo instance whose value is to be set.
double positionY Y coordinate, that is, the absolute value of the distance between the text box's top vertex and the top edge of the physical screen, in px.

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_TextAvoidInfo_SetHeight()

InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height)

Description

Sets the height in InputMethod_TextAvoidInfo.

Since: 12

Parameters

Name Description
InputMethod_TextAvoidInfo *info Pointer to the InputMethod_TextAvoidInfo instance whose value is to be set.
double height Height, in px.

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_TextAvoidInfo_GetPositionY()

InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY)

Description

Obtains the Y coordinate from InputMethod_TextAvoidInfo.

Since: 12

Parameters

Name Description
InputMethod_TextAvoidInfo *info Pointer to the InputMethod_TextAvoidInfo instance whose value is to be obtained.
double *positionY Y coordinate, that is, the absolute value of the distance between the text box's top vertex and the top edge of the physical screen, in px.

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_TextAvoidInfo_GetHeight()

InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height)

Description

Obtains the height from InputMethod_TextAvoidInfo.

Since: 12

Parameters

Name Description
InputMethod_TextAvoidInfo *info Pointer to the InputMethod_TextAvoidInfo instance whose value is to be obtained.
double *height Height of the text box, in px.

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.