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

2026-08-25 浏览 (1)

inputmethod_cursor_info_capi.h

Overview

Provides methods for creating, destroying, reading, and writing cursor information objects.

File to include: <inputmethod/inputmethod_cursor_info_capi.h>

Library: libohinputmethod.so

System capability: SystemCapability.MiscServices.InputMethodFramework

Since: 12

Related module: InputMethod

Summary

Structs

Nametypedef KeywordDescription
InputMethod_CursorInfoInputMethod_CursorInfoRepresents the cursor information, including the coordinates, width, and height of the cursor.

Function

NameDescription
InputMethod_CursorInfo *OH_CursorInfo_Create(double left, double top, double width, double height)Creates an InputMethod_CursorInfo instance.
void OH_CursorInfo_Destroy(InputMethod_CursorInfo *cursorInfo)Destroys an InputMethod_CursorInfo instance.
InputMethod_ErrorCode OH_CursorInfo_SetRect(InputMethod_CursorInfo *cursorInfo, double left, double top, double width, double height)Sets the cursor information.
InputMethod_ErrorCode OH_CursorInfo_GetRect(InputMethod_CursorInfo *cursorInfo, double *left, double *top, double *width, double *height)Obtains the cursor information.

Function Description

OH_CursorInfo_Create()

InputMethod_CursorInfo *OH_CursorInfo_Create(double left, double top, double width, double height)

Description

Creates an InputMethod_CursorInfo instance.

Since: 12

Parameters

NameDescription
double leftAbsolute value of the distance between the cursor's leftmost point and the left edge of the physical screen, in px.
double topAbsolute value of the distance between the cursor's top point and the top edge of the physical screen, in px.
double widthWidth, in px.
double heightHeight, in px.

Returns

TypeDescription
InputMethod_CursorInfo *If the operation is successful, a pointer to the created InputMethod_CursorInfo instance is returned.
If the operation fails, NULL is returned. This may occur when the application's address space is exhausted.

OH_CursorInfo_Destroy()

void OH_CursorInfo_Destroy(InputMethod_CursorInfo *cursorInfo)

Description

Destroys an InputMethod_CursorInfo instance.

Since: 12

Parameters

NameDescription
InputMethod_CursorInfo *cursorInfoPointer to the InputMethod_CursorInfo instance to be destroyed.

OH_CursorInfo_SetRect()

InputMethod_ErrorCode OH_CursorInfo_SetRect(InputMethod_CursorInfo *cursorInfo, double left, double top, double width, double height)

Description

Sets the cursor information.

Since: 12

Parameters

NameDescription
InputMethod_CursorInfo *cursorInfoPointer to the InputMethod_CursorInfo instance.
double leftAbsolute value of the distance between the cursor's leftmost point and the left edge of the physical screen, in px.
double topAbsolute value of the distance between the cursor's top point and the top edge of the physical screen, in px.
double widthWidth, in px.
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_CursorInfo_GetRect()

InputMethod_ErrorCode OH_CursorInfo_GetRect(InputMethod_CursorInfo *cursorInfo, double *left, double *top, double *width, double *height)

Description

Obtains the cursor information.

Since: 12

Parameters

NameDescription
InputMethod_CursorInfo *cursorInfoPointer to the InputMethod_CursorInfo instance.
double *leftAbsolute value of the distance between the cursor's leftmost point and the left edge of the physical screen, in px.
double *topAbsolute value of the distance between the cursor's top point and the top edge of the physical screen, in px.
double *widthWidth, in px.
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.

你可能感兴趣的鸿蒙文章

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 鸿蒙 js-apis-inputmethod-system-panel-manager-sys

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