openharmony 鸿蒙 capi-inputmethod-text-avoid-info-capi-h

2026-08-25 浏览 (1)

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

Nametypedef KeywordDescription
InputMethod_TextAvoidInfoInputMethod_TextAvoidInfoRepresents the information used by the input box to avoid the keyboard.

Function

NameDescription
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

NameDescription
double positionYY coordinate of the text box, in px.
double heightHeight of the text box, in px.

Returns

TypeDescription
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

NameDescription
InputMethod_TextAvoidInfo *infoPointer 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

NameDescription
InputMethod_TextAvoidInfo *infoPointer to the InputMethod_TextAvoidInfo instance whose value is to be set.
double positionYY 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

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

InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height)

Description

Sets the height in InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
InputMethod_TextAvoidInfo *infoPointer to the InputMethod_TextAvoidInfo instance whose value is to be set.
double heightHeight, in px.

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

InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY)

Description

Obtains the Y coordinate from InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
InputMethod_TextAvoidInfo *infoPointer to the InputMethod_TextAvoidInfo instance whose value is to be obtained.
double *positionYY 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

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

InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height)

Description

Obtains the height from InputMethod_TextAvoidInfo.

Since: 12

Parameters

NameDescription
InputMethod_TextAvoidInfo *infoPointer to the InputMethod_TextAvoidInfo instance whose value is to be obtained.
double *heightHeight of the text box, in px.

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/O10hl6tr