目录

HandWrite

Overview

This module provides the handwriting capability.

System capability: SystemCapability.Stylus.Handwrite

Since: 6.0.0(20)

Summary

[h2]Files

Name Description
native_handwrite_api.h Declares the handwriting capability.

[h2]Structs

Name Description
struct HandWrite_HistoricalPoint Defines the struct of historical touch point information.

[h2]Enums

Name Description

Handwrite_ErrCode {

E_NO_ERROR = 0,

E_PARAMS = 401,

E_INNER_ERROR = 1010400001,

E_PERMISSION = 201

}

Defines the handwriting error codes.

[h2]Functions

Name Function

int32_t HMS_HandWrite_GetPredictPoint(const HandWrite_HistoricalPoint* event,

int32_t size, float *predictPointX, float *predictPointY)

Obtains the prediction point.

[h2]Functions

Name Function
int32_t HMS_HandWrite_SetRefreshDelayOff(const char* xcomponentId, const bool enable) Reduces the stylus writing latency.

Enumeration Type Description

[h2]Handwrite_ErrCode

enum Handwrite_ErrCode

Description

Defines the handwriting error codes.

Since: 6.0.0(20)

Enumerated Value Description
E_NO_ERROR = 0 Operation success.
E_PARAMS = 401 Invalid input parameter.
E_INNER_ERROR = 1010400001 Internal system error. Related resources fail to be loaded.
E_PERMISSION = 201

Permission verification failed.

Since: 26.0.0

Function Description

[h2]HMS_HandWrite_GetPredictPoint()

int32_t HMS_HandWrite_GetPredictPoint(const HandWrite_HistoricalPoint* event,
    int32_t size, float *predictPointX, float *predictPointY)

Description

Obtains the prediction point.

Since: 6.0.0(20)

Name Description
event Input historical points.
size Number of historical points.
predictPointX Pointer used to store the X coordinate of the prediction point.
predictPointY Pointer used to store the Y coordinate of the prediction point.

Returns: handwriting error code (HandWrite_ErrCode)

E_NO_ERROR 0: Operation success.

E_PARAMS 401: Invalid input parameter.

E_INNER_ERROR 1010400001: Internal system error. Related resources fail to be loaded.

Function Description

[h2]HMS_HandWrite_SetRefreshDelayOff()

int32_t HMS_HandWrite_SetRefreshDelayOff(const char* xcomponentId, const bool enable)

Description

Reduces the stylus writing latency for note-taking apps.

Since: 26.0.0

Name Description
xcomponentId ID of the custom component.
enable Whether to enable or disable the acceleration function.

Returns: handwriting error code (HandWrite_ErrCode)

E_NO_ERROR 0: Operation success.

E_PERMISSION 201: Permission verification failed.

E_INNER_ERROR 1010400001: Internal system error. Related resources fail to be loaded.