Describes the surface and touch event held by the ArkUI XComponent, which can be used for the EGL/OpenGL ES and media data input and displayed on the ArkUI XComponent.
**Since:**
8
## Summary
### Files
| Name | Description |
| -------- | -------- |
| [native_interface_xcomponent.h](native__interface__xcomponent_8h.md) | Declare the APIs used to access the native XComponent.<br>File to Include: <ace/xcomponent/native_interface_xcomponent.h> |
### Structs
| Name | Description |
| -------- | -------- |
| [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | Describes the touch point of the touch event. |
| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | Describes the touch event. |
| [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) | Describes the mouse event. |
| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | Registers a callback for the surface lifecycle and touch event. |
| [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) | Registers a callback for the mouse event. |
### Types
| Name | Description |
| -------- | -------- |
| [OH_NativeXComponent](#oh_nativexcomponent) | Provides an encapsulated OH_NativeXComponent instance. |
| [OH_NativeXComponent_Callback](#oh_nativexcomponent_callback) | Registers a callback for the surface lifecycle and touch event. |
| [OH_NativeXComponent_MouseEvent_Callback](#oh_nativexcomponent_mouseevent_callback) | Registers a callback for the mouse event. |
### Enums
| Name | Description |
| -------- | -------- |
| {OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, <br>OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, <br/>OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2 } | [Enumerates](#anonymous-enum) the API access states. |
| [OH_NativeXComponent_GetXComponentId](#oh_nativexcomponent_getxcomponentid)([OH_NativeXComponent](#oh_nativexcomponent)\*component, char \*id, uint64_t \*size) | Obtains the ID of the ArkUI XComponent. |
| [OH_NativeXComponent_GetXComponentSize](#oh_nativexcomponent_getxcomponentsize)([OH_NativeXComponent](#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_getxcomponentoffset)([OH_NativeXComponent](#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_gettouchevent)([OH_NativeXComponent](#oh_nativexcomponent)\*component, const void \*window, [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md)\*touchEvent) | Obtains the touch event scheduled by the ArkUI XComponent. |
| [OH_NativeXComponent_GetTouchPointToolType](#oh_nativexcomponent_gettouchpointtooltype)([OH_NativeXComponent](#oh_nativexcomponent)\*component, uint32_t pointIndex, [OH_NativeXComponent_TouchPointToolType](#oh_nativexcomponent_touchpointtooltype)\*toolType) | Obtains the ArkUI XComponent touch point tool type. |
| [OH_NativeXComponent_GetTouchPointTiltX](#oh_nativexcomponent_gettouchpointtiltx)([OH_NativeXComponent](#oh_nativexcomponent)\*component, uint32_t pointIndex, float \*tiltX) | Obtains the angle between the tilt of the ArkUI XComponent touch point and the x-axis. |
| [OH_NativeXComponent_GetTouchPointTiltY](#oh_nativexcomponent_gettouchpointtilty)([OH_NativeXComponent](#oh_nativexcomponent)\*component, uint32_t pointIndex, float \*tiltY) | Obtains the angle between the tilt of the ArkUI XComponent touch point and the y-axis. |
| [OH_NativeXComponent_GetMouseEvent](#oh_nativexcomponent_getmouseevent)([OH_NativeXComponent](#oh_nativexcomponent)\*component, const void \*window, [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md)\*mouseEvent) | Obtains the mouse event scheduled by ArkUI XComponent. |
| [OH_NativeXComponent_RegisterCallback](#oh_nativexcomponent_registercallback)([OH_NativeXComponent](#oh_nativexcomponent)\*component, [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md)\*callback) | Registers a callback for this **OH_NativeXComponent** instance. |
| [OH_NativeXComponent_RegisterMouseEventCallback](#oh_nativexcomponent_registermouseeventcallback)([OH_NativeXComponent](#oh_nativexcomponent)\*component, [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md)\*callback) | Registers a mouse event callback for this **OH_NativeXComponent** instance. |
### Variables
| Name | Description |
| -------- | -------- |
| [OH_XCOMPONENT_ID_LEN_MAX](#oh_xcomponent_id_len_max) = 128 | Maximum length of an ArkUI XComponent ID. |
| [OH_MAX_TOUCH_POINTS_NUMBER](#oh_max_touch_points_number) = 10 | Maximum number of identifiable touch points in a touch event. |
| [OH_NativeXComponent_TouchPoint::id](#id-12) = 0 | Unique identifier of the finger. |
| [OH_NativeXComponent_TouchPoint::screenX](#screenx-13) = 0.0 | X coordinate of the touch point relative to the left edge of the screen. |
| [OH_NativeXComponent_TouchPoint::screenY](#screeny-13) = 0.0 | Y coordinate of the touch point relative to the left edge of the screen. |
| [OH_NativeXComponent_TouchPoint::x](#x-13) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent. |
| [OH_NativeXComponent_TouchPoint::y](#y-13) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent. |
| [OH_NativeXComponent_TouchPoint::type](#type-12) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event. |
| [OH_NativeXComponent_TouchPoint::size](#size-12) = 0.0 | Contact area between the finger pad and the screen. |
| [OH_NativeXComponent_TouchPoint::force](#force-12) = 0.0 | Pressure of the current touch event. |
| [OH_NativeXComponent_TouchPoint::timeStamp](#timestamp-12) = 0 | Timestamp of the current touch event. |
| [OH_NativeXComponent_TouchPoint::isPressed](#ispressed) = false | Whether the current point is pressed. |
| [OH_NativeXComponent_TouchEvent::id](#id-22) = 0 | Unique identifier of the finger. |
| [OH_NativeXComponent_TouchEvent::screenX](#screenx-23) = 0.0 | X coordinate of the touch point relative to the left edge of the screen. |
| [OH_NativeXComponent_TouchEvent::screenY](#screeny-23) = 0.0 | Y coordinate of the touch point relative to the left edge of the screen. |
| [OH_NativeXComponent_TouchEvent::x](#x-23) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent. |
| [OH_NativeXComponent_TouchEvent::y](#y-23) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent. |
| [OH_NativeXComponent_TouchEvent::type](#type-22) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event. |
| [OH_NativeXComponent_TouchEvent::size](#size-22) = 0.0 | Contact area between the finger pad and the screen. |
| [OH_NativeXComponent_TouchEvent::force](#force-22) = 0.0 | Pressure of the current touch event. |
| [OH_NativeXComponent_TouchEvent::deviceId](#deviceid) = 0 | ID of the device where the current touch event is triggered. |
| [OH_NativeXComponent_TouchEvent::timeStamp](#timestamp-22) = 0 | Timestamp of the current touch event. |
| [OH_NativeXComponent_TouchEvent::touchPoints](#touchpoints)[OH_MAX_TOUCH_POINTS_NUMBER] | Array of the current touch points. |
| [OH_NativeXComponent_TouchEvent::numPoints](#numpoints) = 0 | Number of current touch points. |
| [OH_NativeXComponent_MouseEvent::x](#x-33) = 0.0 | X coordinate of the clicked point relative to the upper left corner of the component. |
| [OH_NativeXComponent_MouseEvent::y](#y-33) = 0.0 | Y coordinate of the clicked point relative to the upper left corner of the component. |
| [OH_NativeXComponent_MouseEvent::screenX](#screenx-33) = 0.0 | X coordinate of the clicked point relative to the upper left corner of the screen. |
| [OH_NativeXComponent_MouseEvent::screenY](#screeny-33) = 0.0 | Y coordinate of the clicked point relative to the upper left corner of the screen. |
| [OH_NativeXComponent_MouseEvent::timestamp](#timestamp) = 0 | Timestamp of the current mouse event. |
| [OH_NativeXComponent_MouseEvent::action](#action) = [OH_NativeXComponent_MouseEventAction::OH_NATIVEXCOMPONENT_MOUSE_NONE](#oh_nativexcomponent_mouseeventaction) | Current mouse event action. |
| component | Indicates the pointer to an **OH_NativeXComponent** instance. |
| id | Indicates the pointer to the character buffer used to hold the ID of the OH_NativeXComponent instance.<br>Note that the null terminator is attached to the character buffer, so the size of the character buffer should be at least one unit greater than the length of the real ID.<br>The recommended size of the character buffer is [OH_XCOMPONENT_ID_LEN_MAX + 1]. |
| size | Indicates the pointer to the length of the ID. |