native_interface_xcomponent.h

Overview

Related Modules:

Native XComponent

Description:

Declares APIs for accessing a Native XComponent.

Since: 8 Version: 1.0

Summary

Classes

Classe Name Description
OH_NativeXComponent_TouchPoint
OH_NativeXComponent_TouchEvent
OH_NativeXComponent_Callback Registers the surface lifecycle and touch event callbacks.

Macros

Macro Name and Value Description
OH_NATIVE_XCOMPONENT_OBJ   ("NATIVE_XCOMPONENT_OBJ")

Typedefs

Typedef Name Description
OH_NativeXComponent typedef struct OH_NativeXComponent
Provides an encapsulated OH_NativeXComponent instance.
OH_NativeXComponent_Callback typedef struct OH_NativeXComponent_Callback
Registers the surface lifecycle and touch event callbacks.

Enumerations

Enumeration Name Description
OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2 } Enumerates the API access states.
OH_NativeXComponent_TouchEventType {   OH_NATIVEXCOMPONENT_DOWN = 0, OH_NATIVEXCOMPONENT_UPOH_NATIVEXCOMPONENT_MOVEOH_NATIVEXCOMPONENT_CANCEL,   OH_NATIVEXCOMPONENT_UNKNOWN }

Functions

Function Description
OH_NativeXComponent_GetXComponentId (OH_NativeXComponent *component, char *id, uint64_t *size) int32_t
Obtains the ID of the ArkUI XComponent.
OH_NativeXComponent_GetXComponentSize (OH_NativeXComponent *component, const void *window, uint64_t *width, uint64_t *height) int32_t
Obtains the size of the surface held by the ArkUI XComponent.
OH_NativeXComponent_GetXComponentOffset (OH_NativeXComponent *component, const void *window, double *x, double *y) int32_t
Obtains the offset of the surface held by the ArkUI XComponent.
OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent *component, const void *window, OH_NativeXComponent_TouchEvent *touchEvent) int32_t
Obtains the touch event dispatched by the ArkUI XComponent.
OH_NativeXComponent_RegisterCallback (OH_NativeXComponent *component, OH_NativeXComponent_Callback *callback) int32_t
Registers a callback for this OH_NativeXComponent instance.