1# native_interface_xcomponent.h 2 3 4## **Overview** 5 6**Related Modules:** 7 8[Native XComponent](_o_h___native_x_component.md) 9 10**Description:** 11 12Declares APIs for accessing a Native XComponent. 13 14**Since:** 158 16**Version:** 171.0 18 19## **Summary** 20 21 22### Classes 23 24 | Classe Name | Description | 25| -------- | -------- | 26| [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | | 27| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | | 28| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | Registers the surface lifecycle and touch event callbacks. | 29 30 31### Macros 32 33 | Macro Name and Value | Description | 34| -------- | -------- | 35| **OH_NATIVE_XCOMPONENT_OBJ** ("__NATIVE_XCOMPONENT_OBJ__") | | 36 37 38### Typedefs 39 40 | Typedef Name | Description | 41| -------- | -------- | 42| [OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) | typedef struct [OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)<br/>Provides an encapsulated **OH_NativeXComponent** instance. | 43| [OH_NativeXComponent_Callback](_o_h___native_x_component.md#gaf629ecc5d06f0a69aea9da3511679ea5) | typedef struct [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md)<br/>Registers the surface lifecycle and touch event callbacks. | 44 45 46### Enumerations 47 48 | Enumeration Name | Description | 49| -------- | -------- | 50| { [OH_NATIVEXCOMPONENT_RESULT_SUCCESS](_o_h___native_x_component.md#gga06fc87d81c62e9abb8790b6e5713c55baf2a815b270113979adea7b9440e0b80e) = 0, [OH_NATIVEXCOMPONENT_RESULT_FAILED](_o_h___native_x_component.md#gga06fc87d81c62e9abb8790b6e5713c55bad6e4a33f3c594e267b8101bbc8ba682f) = -1, [OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER](_o_h___native_x_component.md#gga06fc87d81c62e9abb8790b6e5713c55baa12565a3677df7c8dc60e216ed40e580) = -2 } | Enumerates the API access states. | 51| [OH_NativeXComponent_TouchEventType](_o_h___native_x_component.md#ga0a8c68dd460d7e801e7c0ff771f09182) { [OH_NATIVEXCOMPONENT_DOWN](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182a87b4dfe82e5aafd40c202484fc10dfb4) = 0, [OH_NATIVEXCOMPONENT_UP](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182ae2da3fbb127398f9a749070edf671597), [OH_NATIVEXCOMPONENT_MOVE](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182a0b97e9e7830d0363e3617e2a7d33b378), [OH_NATIVEXCOMPONENT_CANCEL](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182a8593a5e1053e9c9df74d6b0e8a9bbb0a), [OH_NATIVEXCOMPONENT_UNKNOWN](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182aff39d23c1412b3b110a19df4893651d3) } | | 52 53 54### Functions 55 56 | Function | Description | 57| -------- | -------- | 58| [OH_NativeXComponent_GetXComponentId](_o_h___native_x_component.md#ga1aa5d0ac3778b9caef35f93b54a6f677) ([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) \*component, char \*id, uint64_t \*size) | int32_t<br/>Obtains the ID of the ArkUI XComponent. | 59| [OH_NativeXComponent_GetXComponentSize](_o_h___native_x_component.md#ga8f60375298a5d9eae57d03d4c5cf5f3f) ([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) \*component, const void \*window, uint64_t \*width, uint64_t \*height) | int32_t<br/>Obtains the size of the surface held by the ArkUI XComponent. | 60| [OH_NativeXComponent_GetXComponentOffset](_o_h___native_x_component.md#ga3a594868e2d0f633026b7fea2f45812a) ([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) \*component, const void \*window, double \*x, double \*y) | int32_t<br/>Obtains the offset of the surface held by the ArkUI XComponent. | 61| [OH_NativeXComponent_GetTouchEvent](_o_h___native_x_component.md#ga5b0e85c74dab846b5b61a5e244ee60ca) ([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) \*component, const void \*window, [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) \*touchEvent) | int32_t<br/>Obtains the touch event dispatched by the ArkUI XComponent. | 62| [OH_NativeXComponent_RegisterCallback](_o_h___native_x_component.md#gaf9b8b470cd51ac0e339710926bca72e3) ([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) \*component, [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) \*callback) | int32_t<br/>Registers a callback for this **OH_NativeXComponent** instance. | 63