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

Name typedef Keyword Description
InputMethod_CursorInfo InputMethod_CursorInfo Represents the cursor information, including the coordinates, width, and height of the cursor.

Function

Name Description
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

Name Description
double left Absolute value of the distance between the cursor's leftmost point and the left edge of the physical screen, in px.
double top Absolute value of the distance between the cursor's top point and the top edge of the physical screen, in px.
double width Width, in px.
double height Height, in px.

Returns

Type Description
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

Name Description
InputMethod_CursorInfo *cursorInfo Pointer 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

Name Description
InputMethod_CursorInfo *cursorInfo Pointer to the InputMethod_CursorInfo instance.
double left Absolute value of the distance between the cursor's leftmost point and the left edge of the physical screen, in px.
double top Absolute value of the distance between the cursor's top point and the top edge of the physical screen, in px.
double width Width, in px.
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_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

Name Description
InputMethod_CursorInfo *cursorInfo Pointer to the InputMethod_CursorInfo instance.
double *left Absolute value of the distance between the cursor's leftmost point and the left edge of the physical screen, in px.
double *top Absolute value of the distance between the cursor's top point and the top edge of the physical screen, in px.
double *width Width, in px.
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.