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

2026-08-25 浏览 (1)

inputmethod_text_avoid_info_capi.h

概述

提供输入框避让信息对象的创建、销毁与读写方法。

引用文件: <inputmethod/inputmethod_text_avoid_info_capi.h>

库: libohinputmethod.so

系统能力: SystemCapability.MiscServices.InputMethodFramework

起始版本: 12

相关模块: InputMethod

汇总

结构体

名称typedef关键字描述
InputMethod_TextAvoidInfoInputMethod_TextAvoidInfo输入框避让信息。输入框用于避让键盘的信息。

函数

名称描述
InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height)创建一个新的InputMethod_TextAvoidInfo实例。
void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info)销毁一个InputMethod_TextAvoidInfo实例。
InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY)设置InputMethod_TextAvoidInfo中的Y坐标值。
InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height)设置InputMethod_TextAvoidInfo中的高度值。
InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY)InputMethod_TextAvoidInfo获取Y坐标值。
InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height)InputMethod_TextAvoidInfo获取高度值。

函数说明

OH_TextAvoidInfo_Create()

InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height)

描述

创建一个新的InputMethod_TextAvoidInfo实例。

起始版本: 12

参数:

参数项描述
double positionY表示输入框位置的Y坐标值,单位px。
double height表示输入框高度,单位px。

返回:

类型说明
InputMethod_TextAvoidInfo *如果创建成功,返回一个指向新创建的InputMethod_TextAvoidInfo实例的指针。
如果创建失败,对象返回NULL,可能的失败原因有应用地址空间满。

OH_TextAvoidInfo_Destroy()

void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info)

描述

销毁一个InputMethod_TextAvoidInfo实例。

起始版本: 12

参数:

参数项描述
InputMethod_TextAvoidInfo *info表示指向即将被销毁的InputMethod_TextAvoidInfo实例的指针。

OH_TextAvoidInfo_SetPositionY()

InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY)

描述

设置InputMethod_TextAvoidInfo中的Y坐标值。

起始版本: 12

参数:

参数项描述
InputMethod_TextAvoidInfo *info指向即将被设置值的InputMethod_TextAvoidInfo实例的指针。
double positionYY坐标值,即输入框顶点与物理屏幕上侧距离的绝对值,单位px。

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextAvoidInfo_SetHeight()

InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height)

描述

设置InputMethod_TextAvoidInfo中的高度值。

起始版本: 12

参数:

参数项描述
InputMethod_TextAvoidInfo *info指向即将被设置值的InputMethod_TextAvoidInfo实例的指针。
double height高度值,单位px。

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextAvoidInfo_GetPositionY()

InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY)

描述

InputMethod_TextAvoidInfo获取Y坐标值。

起始版本: 12

参数:

参数项描述
InputMethod_TextAvoidInfo *info指向即将被获取值的InputMethod_TextAvoidInfo实例的指针。
double *positionYY坐标值,即输入框顶点与物理屏幕上侧距离的绝对值,单位px。

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 InputMethod_ErrorCode

OH_TextAvoidInfo_GetHeight()

InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height)

描述

InputMethod_TextAvoidInfo获取高度值。

起始版本: 12

参数:

参数项描述
InputMethod_TextAvoidInfo *info指向即将被获取值的InputMethod_TextAvoidInfo实例的指针。
double *height输入框高度,单位px。

返回:

类型说明
InputMethod_ErrorCode返回一个特定的错误码。
IME_ERR_OK - 表示成功。
IME_ERR_NULL_POINTER - 非预期的空指针。
具体错误码可以参考 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/bYhivt5j