native_interface_xcomponent.h

Overview

Declares the APIs used to access the native XComponent.

Since:

8

Related Modules:

Native XComponent

Summary

Structs

Name Description
OH_NativeXComponent_TouchPoint Describes the touch point of the touch event.
OH_NativeXComponent_TouchEvent Describes the touch event.
OH_NativeXComponent_MouseEvent Describes the mouse event.
OH_NativeXComponent_Callback Registers a callback for the surface lifecycle and touch event.
OH_NativeXComponent_MouseEvent_Callback Registers a callback for the mouse event.

Types

Name Description
OH_NativeXComponent Provides an encapsulated OH_NativeXComponent instance.
OH_NativeXComponent_Callback Registers a callback for the surface lifecycle and touch event.
OH_NativeXComponent_MouseEvent_Callback Registers a callback for the mouse event.

Enums

Name Description
{ OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0,
OH_NATIVEXCOMPONENT_RESULT_FAILED = -1,
OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2}
Enumeratesthe API access states.
OH_NativeXComponent_TouchEventType {
OH_NATIVEXCOMPONENT_DOWN = 0,
OH_NATIVEXCOMPONENT_UP,
OH_NATIVEXCOMPONENT_MOVE,
OH_NATIVEXCOMPONENT_CANCEL,
OH_NATIVEXCOMPONENT_UNKNOWN }
Enumerates the touch event types.
OH_NativeXComponent_MouseEventAction {
OH_NATIVEXCOMPONENT_MOUSE_NONE = 0,
OH_NATIVEXCOMPONENT_MOUSE_PRESS,
OH_NATIVEXCOMPONENT_MOUSE_RELEASE,
OH_NATIVEXCOMPONENT_MOUSE_MOVE }
Enumerates the mouse event actions.
OH_NativeXComponent_MouseEventButton {
OH_NATIVEXCOMPONENT_NONE_BUTTON = 0,
OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01,
OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02,
OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04,
OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08,
OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10 }
Enumerates the mouse event buttons.

Functions

Name Description
OH_NativeXComponent_GetXComponentId (OH_NativeXComponent *component, char *id, uint64_t *size) Obtains the ID of the ArkUI XComponent.
OH_NativeXComponent_GetXComponentSize (OH_NativeXComponent *component, const void *window, uint64_t *width, uint64_t *height) Obtains the size of the surface held by the ArkUI XComponent.
OH_NativeXComponent_GetXComponentOffset (OH_NativeXComponent *component, const void *window, double *x, double *y) Obtains the offset of the ArkUI XComponent relative to the upper left vertex of the screen.
OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent *component, const void *window, OH_NativeXComponent_TouchEvent *touchEvent) Obtains the touch event scheduled by the ArkUI XComponent.
OH_NativeXComponent_GetMouseEvent (OH_NativeXComponent *component, const void *window, OH_NativeXComponent_MouseEvent *mouseEvent) Obtains the mouse event scheduled by ArkUI XComponent.
OH_NativeXComponent_RegisterCallback (OH_NativeXComponent *component, OH_NativeXComponent_Callback *callback) Registers a callback for this OH_NativeXComponent instance.
OH_NativeXComponent_RegisterMouseEventCallback (OH_NativeXComponent *component, OH_NativeXComponent_MouseEvent_Callback *callback) Registers a mouse event callback for this OH_NativeXComponent instance.

Variables

Name Description
OH_XCOMPONENT_ID_LEN_MAX = 128 Maximum length of an ArkUI XComponent ID.
OH_MAX_TOUCH_POINTS_NUMBER = 10 Maximum number of identifiable touch points in a touch event.