• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Native XComponent
2
3
4## Overview
5
6Describes 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. For details, see [Custom Rendering (XComponent)](../../ui/napi-xcomponent-guidelines.md).
7
8> **NOTE**
9>
10> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
11
12## Summary
13
14
15### Files
16
17| Name                                      | Description                                      |
18| ---------------------------------------- | ---------------------------------------- |
19| [native_interface_xcomponent.h](native__interface__xcomponent_8h.md) | Declares the APIs for accessing **NativeXComponent**.|
20| [native_xcomponent_key_event.h](native__xcomponent__key__event_8h.md) | Declares the enums used to access **NativeXComponent** key events.|
21
22
23### Structs
24
25| Name                                      | Description                   |
26| ---------------------------------------- | --------------------- |
27| [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | Describes the touch point of the touch event.         |
28| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | Describes the touch event.                |
29| [OH_NativeXComponent_HistoricalPoint](_o_h___native_x_component___historical_point.md) | Represents a historical touch point.|
30| [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) | Describes the mouse event.                |
31| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | Registers callbacks for the surface lifecycle and touch event.|
32| [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) | Registers callbacks for the mouse event.           |
33| [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) | Defines the expected frame rate range. |
34
35
36### Types
37
38| Name                                      | Description                                  |
39| ---------------------------------------- | ------------------------------------ |
40| [OH_NativeXComponent](#oh_nativexcomponent) | Provides an encapsulated **OH_NativeXComponent** instance.         |
41| [OH_NativeXComponent_Callback](#oh_nativexcomponent_callback) | Registers callbacks for the surface lifecycle and touch event.               |
42| [OH_NativeXComponent_MouseEvent_Callback](#oh_nativexcomponent_mouseevent_callback) | Registers callbacks for the mouse event.                          |
43| [OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) | Provides an encapsulated **OH_NativeXComponent_KeyEvent** instance.|
44| [OH_NativeXComponent_ExtraMouseEventInfo](#oh_nativexcomponent_extramouseeventinfo) | Provides an encapsulated instance of extended mouse event information.|
45| [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) | Defines surface lifecycle callback functions.|
46| [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) | Provides an encapsulated **OH_ArkUI_SurfaceHolder** instance.|
47| [OHNativeWindow](#ohnativewindow) | Provides an encapsulated **NativeWindow** instance.|
48
49
50### Enums
51
52| Name                                      | Description        |
53| ---------------------------------------- | ---------- |
54| { OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2 } | Enumerates the API access states.|
55| [OH_NativeXComponent_TouchEventType](#oh_nativexcomponent_toucheventtype) {<br>OH_NATIVEXCOMPONENT_DOWN = 0, OH_NATIVEXCOMPONENT_UP, OH_NATIVEXCOMPONENT_MOVE, OH_NATIVEXCOMPONENT_CANCEL,<br>OH_NATIVEXCOMPONENT_UNKNOWN<br>} | Enumerates the touch event types.   |
56| [OH_NativeXComponent_TouchPointToolType](#oh_nativexcomponent_touchpointtooltype) {<br>OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN = 0, OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER, OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN, OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER,<br>OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH, OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL, OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH, OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE,<br>OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS<br>} | Enumerates the touch point tool types.  |
57| [OH_NativeXComponent_EventSourceType](#oh_nativexcomponent_eventsourcetype) {<br>OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN = 0, OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE, OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN, OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD,<br>OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK, OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD<br>} | Enumerates the touch event source types.  |
58| [OH_NativeXComponent_TouchEvent_SourceTool](#oh_nativexcomponent_touchevent_sourcetool) {<br>OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN = 0, OH_NATIVEXCOMPONENT_SOURCETOOL_FINGER, OH_NATIVEXCOMPONENT_SOURCETOOL_PEN, OH_NATIVEXCOMPONENT_SOURCETOOL_RUBBER,<br>OH_NATIVEXCOMPONENT_SOURCETOOL_BRUSH, OH_NATIVEXCOMPONENT_SOURCETOOL_PENCIL, OH_NATIVEXCOMPONENT_SOURCETOOL_AIRBRUSH, OH_NATIVEXCOMPONENT_SOURCETOOL_MOUSE,<br>OH_NATIVEXCOMPONENT_SOURCETOOL_LENS, OH_NATIVEXCOMPONENT_SOURCETOOL_TOUCHPAD<br>} | Enumerates the source tool types of touch events.|
59| [OH_NativeXComponent_MouseEventAction](#oh_nativexcomponent_mouseeventaction) { OH_NATIVEXCOMPONENT_MOUSE_NONE = 0, OH_NATIVEXCOMPONENT_MOUSE_PRESS, OH_NATIVEXCOMPONENT_MOUSE_RELEASE, OH_NATIVEXCOMPONENT_MOUSE_MOVE OH_NATIVEXCOMPONENT_MOUSE_CANCEL } | Enumerates the mouse event actions.   |
60| [OH_NativeXComponent_MouseEventButton](#oh_nativexcomponent_mouseeventbutton) {<br>OH_NATIVEXCOMPONENT_NONE_BUTTON = 0, OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01, OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02, OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04,<br>OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08, OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10<br>} | Enumerates the mouse event buttons.   |
61| [OH_NativeXComponent_KeyCode](#oh_nativexcomponent_keycode) {<br>KEY_UNKNOWN = -1, KEY_FN = 0, KEY_HOME = 1, KEY_BACK = 2,KEY_MEDIA_PLAY_PAUSE = 10, KEY_MEDIA_STOP = 11, KEY_MEDIA_NEXT = 12, KEY_MEDIA_PREVIOUS = 13,<br>KEY_MEDIA_REWIND = 14, KEY_MEDIA_FAST_FORWARD = 15, KEY_VOLUME_UP = 16, KEY_VOLUME_DOWN = 17,<br>KEY_POWER = 18, KEY_CAMERA = 19, KEY_VOLUME_MUTE = 22, KEY_MUTE = 23,KEY_BRIGHTNESS_UP = 40, KEY_BRIGHTNESS_DOWN = 41, KEY_0 = 2000, KEY_1 = 2001,<br>KEY_2 = 2002, KEY_3 = 2003, KEY_4 = 2004, KEY_5 = 2005,<br>KEY_6 = 2006, KEY_7 = 2007, KEY_8 = 2008, KEY_9 = 2009,<br>KEY_STAR = 2010, KEY_POUND = 2011, KEY_DPAD_UP = 2012, KEY_DPAD_DOWN = 2013,KEY_DPAD_LEFT = 2014, KEY_DPAD_RIGHT = 2015, KEY_DPAD_CENTER = 2016,<br>KEY_A = 2017,<br>KEY_B = 2018, KEY_C = 2019, KEY_D = 2020, KEY_E = 2021,<br>KEY_F = 2022, KEY_G = 2023, KEY_H = 2024, KEY_I = 2025,<br>KEY_J = 2026, KEY_K = 2027, KEY_L = 2028, KEY_M = 2029,<br>KEY_N = 2030, KEY_O = 2031, KEY_P = 2032, KEY_Q = 2033,<br>KEY_R = 2034, KEY_S = 2035, KEY_T = 2036, KEY_U = 2037,<br>KEY_V = 2038, KEY_W = 2039, KEY_X = 2040, KEY_Y = 2041,<br>KEY_Z = 2042, KEY_COMMA = 2043, KEY_PERIOD = 2044, KEY_ALT_LEFT = 2045,<br>KEY_ALT_RIGHT = 2046, KEY_SHIFT_LEFT = 2047, KEY_SHIFT_RIGHT = 2048, KEY_TAB = 2049,<br>KEY_SPACE = 2050, KEY_SYM = 2051, KEY_EXPLORER = 2052, KEY_ENVELOPE = 2053,<br>KEY_ENTER = 2054, KEY_DEL = 2055, KEY_GRAVE = 2056, KEY_MINUS = 2057,<br>KEY_EQUALS = 2058, KEY_LEFT_BRACKET = 2059, KEY_RIGHT_BRACKET = 2060, KEY_BACKSLASH = 2061,<br>KEY_SEMICOLON = 2062, KEY_APOSTROPHE = 2063, KEY_SLASH = 2064, KEY_AT = 2065,<br>KEY_PLUS = 2066, KEY_MENU = 2067, KEY_PAGE_UP = 2068, KEY_PAGE_DOWN = 2069,<br>KEY_ESCAPE = 2070, KEY_FORWARD_DEL = 2071, KEY_CTRL_LEFT = 2072, KEY_CTRL_RIGHT = 2073,<br>KEY_CAPS_LOCK = 2074, KEY_SCROLL_LOCK = 2075, KEY_META_LEFT = 2076, KEY_META_RIGHT = 2077,<br>KEY_FUNCTION = 2078, KEY_SYSRQ = 2079, KEY_BREAK = 2080, KEY_MOVE_HOME = 2081,<br>KEY_MOVE_END = 2082, KEY_INSERT = 2083, KEY_FORWARD = 2084, KEY_MEDIA_PLAY = 2085,<br>KEY_MEDIA_PAUSE = 2086, KEY_MEDIA_CLOSE = 2087, KEY_MEDIA_EJECT = 2088, KEY_MEDIA_RECORD = 2089,<br>KEY_F1 = 2090, KEY_F2 = 2091, KEY_F3 = 2092, KEY_F4 = 2093,<br>KEY_F5 = 2094, KEY_F6 = 2095, KEY_F7 = 2096, KEY_F8 = 2097,<br>KEY_F9 = 2098, KEY_F10 = 2099, KEY_F11 = 2100, KEY_F12 = 2101,<br>KEY_NUM_LOCK = 2102, KEY_NUMPAD_0 = 2103, KEY_NUMPAD_1 = 2104, KEY_NUMPAD_2 = 2105,<br>KEY_NUMPAD_3 = 2106, KEY_NUMPAD_4 = 2107, KEY_NUMPAD_5 = 2108, KEY_NUMPAD_6 = 2109,<br>KEY_NUMPAD_7 = 2110, KEY_NUMPAD_8 = 2111, KEY_NUMPAD_9 = 2112, KEY_NUMPAD_DIVIDE = 2113,<br>KEY_NUMPAD_MULTIPLY = 2114, KEY_NUMPAD_SUBTRACT = 2115, KEY_NUMPAD_ADD = 2116, KEY_NUMPAD_DOT = 2117,<br>KEY_NUMPAD_COMMA = 2118, KEY_NUMPAD_ENTER = 2119, KEY_NUMPAD_EQUALS = 2120, KEY_NUMPAD_LEFT_PAREN = 2121,<br>KEY_NUMPAD_RIGHT_PAREN = 2122, KEY_VIRTUAL_MULTITASK = 2210, KEY_SLEEP = 2600, KEY_ZENKAKU_HANKAKU = 2601,<br>KEY_102ND = 2602, KEY_RO = 2603, KEY_KATAKANA = 2604, KEY_HIRAGANA = 2605,<br>KEY_HENKAN = 2606, KEY_KATAKANA_HIRAGANA = 2607, KEY_MUHENKAN = 2608, KEY_LINEFEED = 2609,<br>KEY_MACRO = 2610, KEY_NUMPAD_PLUSMINUS = 2611, KEY_SCALE = 2612, KEY_HANGUEL = 2613,<br>KEY_HANJA = 2614, KEY_YEN = 2615, KEY_STOP = 2616, KEY_AGAIN = 2617,<br>KEY_PROPS = 2618, KEY_UNDO = 2619, KEY_COPY = 2620, KEY_OPEN = 2621,<br>KEY_PASTE = 2622, KEY_FIND = 2623, KEY_CUT = 2624, KEY_HELP = 2625,<br>KEY_CALC = 2626, KEY_FILE = 2627, KEY_BOOKMARKS = 2628, KEY_NEXT = 2629,<br>KEY_PLAYPAUSE = 2630, KEY_PREVIOUS = 2631, KEY_STOPCD = 2632, KEY_CONFIG = 2634,<br>KEY_REFRESH = 2635, KEY_EXIT = 2636, KEY_EDIT = 2637, KEY_SCROLLUP = 2638,<br>KEY_SCROLLDOWN = 2639, KEY_NEW = 2640, KEY_REDO = 2641, KEY_CLOSE = 2642,<br>KEY_PLAY = 2643, KEY_BASSBOOST = 2644, KEY_PRINT = 2645, KEY_CHAT = 2646,<br>KEY_FINANCE = 2647, KEY_CANCEL = 2648, KEY_KBDILLUM_TOGGLE = 2649, KEY_KBDILLUM_DOWN = 2650,<br>KEY_KBDILLUM_UP = 2651, KEY_SEND = 2652, KEY_REPLY = 2653, KEY_FORWARDMAIL = 2654,<br>KEY_SAVE = 2655, KEY_DOCUMENTS = 2656, KEY_VIDEO_NEXT = 2657, KEY_VIDEO_PREV = 2658,<br>KEY_BRIGHTNESS_CYCLE = 2659, KEY_BRIGHTNESS_ZERO = 2660, KEY_DISPLAY_OFF = 2661, KEY_BTN_MISC = 2662,<br>KEY_GOTO = 2663, KEY_INFO = 2664, KEY_PROGRAM = 2665, KEY_PVR = 2666,<br>KEY_SUBTITLE = 2667, KEY_FULL_SCREEN = 2668, KEY_KEYBOARD = 2669, KEY_ASPECT_RATIO = 2670,<br>KEY_PC = 2671, KEY_TV = 2672, KEY_TV2 = 2673, KEY_VCR = 2674,<br>KEY_VCR2 = 2675, KEY_SAT = 2676, KEY_CD = 2677, KEY_TAPE = 2678,<br>KEY_TUNER = 2679, KEY_PLAYER = 2680, KEY_DVD = 2681, KEY_AUDIO = 2682,<br>KEY_VIDEO = 2683, KEY_MEMO = 2684, KEY_CALENDAR = 2685, KEY_RED = 2686,<br>KEY_GREEN = 2687, KEY_YELLOW = 2688, KEY_BLUE = 2689, KEY_CHANNELUP = 2690,<br>KEY_CHANNELDOWN = 2691, KEY_LAST = 2692, KEY_RESTART = 2693, KEY_SLOW = 2694,<br>KEY_SHUFFLE = 2695, KEY_VIDEOPHONE = 2696, KEY_GAMES = 2697, KEY_ZOOMIN = 2698,<br>KEY_ZOOMOUT = 2699, KEY_ZOOMRESET = 2700, KEY_WORDPROCESSOR = 2701, KEY_EDITOR = 2702,<br>KEY_SPREADSHEET = 2703, KEY_GRAPHICSEDITOR = 2704, KEY_PRESENTATION = 2705, KEY_DATABASE = 2706,<br>KEY_NEWS = 2707, KEY_VOICEMAIL = 2708, KEY_ADDRESSBOOK = 2709, KEY_MESSENGER = 2710,<br>KEY_BRIGHTNESS_TOGGLE = 2711, KEY_SPELLCHECK = 2712, KEY_COFFEE = 2713, KEY_MEDIA_REPEAT = 2714,<br>KEY_IMAGES = 2715, KEY_BUTTONCONFIG = 2716, KEY_TASKMANAGER = 2717, KEY_JOURNAL = 2718,<br>KEY_CONTROLPANEL = 2719, KEY_APPSELECT = 2720, KEY_SCREENSAVER = 2721, KEY_ASSISTANT = 2722,<br>KEY_KBD_LAYOUT_NEXT = 2723, KEY_BRIGHTNESS_MIN = 2724, KEY_BRIGHTNESS_MAX = 2725, KEY_KBDINPUTASSIST_PREV = 2726,<br>KEY_KBDINPUTASSIST_NEXT = 2727, KEY_KBDINPUTASSIST_PREVGROUP = 2728, KEY_KBDINPUTASSIST_NEXTGROUP = 2729, KEY_KBDINPUTASSIST_ACCEPT = 2730,<br>KEY_KBDINPUTASSIST_CANCEL = 2731, KEY_FRONT = 2800, KEY_SETUP = 2801, KEY_WAKEUP = 2802,<br>KEY_SENDFILE = 2803, KEY_DELETEFILE = 2804, KEY_XFER = 2805, KEY_PROG1 = 2806,<br>KEY_PROG2 = 2807, KEY_MSDOS = 2808, KEY_SCREENLOCK = 2809, KEY_DIRECTION_ROTATE_DISPLAY = 2810,<br>KEY_CYCLEWINDOWS = 2811, KEY_COMPUTER = 2812, KEY_EJECTCLOSECD = 2813, KEY_ISO = 2814,<br>KEY_MOVE = 2815, KEY_F13 = 2816, KEY_F14 = 2817, KEY_F15 = 2818,<br>KEY_F16 = 2819, KEY_F17 = 2820, KEY_F18 = 2821, KEY_F19 = 2822,<br>KEY_F20 = 2823, KEY_F21 = 2824, KEY_F22 = 2825, KEY_F23 = 2826,<br>KEY_F24 = 2827, KEY_PROG3 = 2828, KEY_PROG4 = 2829, KEY_DASHBOARD = 2830,<br>KEY_SUSPEND = 2831, KEY_HP = 2832, KEY_SOUND = 2833, KEY_QUESTION = 2834,<br>KEY_CONNECT = 2836, KEY_SPORT = 2837, KEY_SHOP = 2838, KEY_ALTERASE = 2839,<br>KEY_SWITCHVIDEOMODE = 2841, KEY_BATTERY = 2842, KEY_BLUETOOTH = 2843, KEY_WLAN = 2844,<br>KEY_UWB = 2845, KEY_WWAN_WIMAX = 2846, KEY_RFKILL = 2847, KEY_CHANNEL = 3001,<br>KEY_BTN_0 = 3100, KEY_BTN_1 = 3101, KEY_BTN_2 = 3102, KEY_BTN_3 = 3103,<br>KEY_BTN_4 = 3104, KEY_BTN_5 = 3105, KEY_BTN_6 = 3106, KEY_BTN_7 = 3107,<br>KEY_BTN_8 = 3108, KEY_BTN_9 = 3109<br>} | Enumerates the mouse event key codes.  |
62| [OH_NativeXComponent_KeyAction](#oh_nativexcomponent_keyaction) { OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN = -1, OH_NATIVEXCOMPONENT_KEY_ACTION_DOWN = 0, OH_NATIVEXCOMPONENT_KEY_ACTION_UP } | Enumerates the key event actions.   |
63|[ArkUI_XComponent_ImageAnalyzerState](#arkui_xcomponent_imageanalyzerstate) { ARKUI_XCOMPONENT_AI_ANALYSIS_FINISHED = 0, ARKUI_XCOMPONENT_AI_ANALYSIS_DISABLED = 110000, ARKUI_XCOMPONENT_AI_ANALYSIS_UNSUPPORTED = 110001, ARKUI_XCOMPONENT_AI_ANALYSIS_ONGOING = 110002, ARKUI_XCOMPONENT_AI_ANALYSIS_STOPPED = 110003}|Enumerates the AI image analyzer error codes of the XComponent.|
64
65
66### Functions
67
68| Name                                      | Description                                    |
69| ---------------------------------------- | -------------------------------------- |
70| [OH_NativeXComponent_GetXComponentId](#oh_nativexcomponent_getxcomponentid) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, char \*id, uint64_t \*size) | Obtains the ID of the ArkUI XComponent.           |
71| [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. |
72| [OH_NativeXComponent_GetXComponentOffset](#oh_nativexcomponent_getxcomponentoffset) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, double \*x, double \*y) | Obtains the offset of the surface held by the **XComponent** relative to the upper left corner of its parent component.|
73| [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.       |
74| [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.       |
75| [OH_NativeXComponent_GetTouchPointTiltX](#oh_nativexcomponent_gettouchpointtiltx) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*tiltX) | Obtains the angle between the Y-Z plane of the ArkUI XComponent touch point and the x-axis.    |
76| [OH_NativeXComponent_GetTouchPointTiltY](#oh_nativexcomponent_gettouchpointtilty) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*tiltY) | Obtains the angle between the X-Z plane of the ArkUI XComponent touch point and the y-axis.    |
77| [OH_NativeXComponent_GetTouchPointWindowX](#oh_nativexcomponent_gettouchpointwindowx) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*windowX) | Obtains the X coordinate of the touch point relative to the upper left corner of the application window where the ArkUI XComponent is located.    |
78| [OH_NativeXComponent_GetTouchPointWindowY](#oh_nativexcomponent_gettouchpointwindowy) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*windowY) | Obtains the Y coordinate of the touch point relative to the upper left corner of the application window where the ArkUI XComponent is located.    |
79| [OH_NativeXComponent_GetTouchPointDisplayX](#oh_nativexcomponent_gettouchpointdisplayx) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*displayX) | Obtains the X coordinate of the touch point relative to the upper left corner of the screen where the ArkUI XComponent is located.    |
80| [OH_NativeXComponent_GetTouchPointDisplayY](#oh_nativexcomponent_gettouchpointdisplayy) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*displayY) | Obtains the Y coordinate of the touch point relative to the upper left corner of the screen where the ArkUI XComponent is located.    |
81| [OH_NativeXComponent_GetHistoricalPoints](#oh_nativexcomponent_gethistoricalpoints) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, int32_t \*size, [OH_NativeXComponent_HistoricalPoint](_o_h___native_x_component___historical_point.md) \*\*historicalPoints) | Obtains the historical touch points of the XComponent.|
82| [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.       |
83| [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.          |
84| [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 the mouse event callback for this **OH_NativeXComponent** instance.      |
85| [OH_NativeXComponent_RegisterFocusEventCallback](#oh_nativexcomponent_registerfocuseventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers the focus event callback for this **OH_NativeXComponent** instance.      |
86| [OH_NativeXComponent_RegisterKeyEventCallback](#oh_nativexcomponent_registerkeyeventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers the key event callback for this **OH_NativeXComponent** instance.      |
87| [OH_NativeXComponent_RegisterKeyEventCallbackWithResult](#oh_nativexcomponent_registerkeyeventcallbackwithresult) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, bool(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers a key event callback with a return value for this **OH_NativeXComponent** instance.      |
88| [OH_NativeXComponent_RegisterBlurEventCallback](#oh_nativexcomponent_registerblureventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers the blur event callback for this **OH_NativeXComponent** instance.      |
89| [OH_NativeXComponent_GetKeyEvent](#oh_nativexcomponent_getkeyevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*\*keyEvent) | Obtains the key event scheduled by the ArkUI XComponent.       |
90| [OH_NativeXComponent_GetKeyEventAction](#oh_nativexcomponent_getkeyeventaction) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, [OH_NativeXComponent_KeyAction](#oh_nativexcomponent_keyaction) \*action) | Obtains the action of the specified key event.                          |
91| [OH_NativeXComponent_GetKeyEventCode](#oh_nativexcomponent_getkeyeventcode) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, [OH_NativeXComponent_KeyCode](#oh_nativexcomponent_keycode) \*code) | Obtains the key code of the specified key event.                         |
92| [OH_NativeXComponent_GetKeyEventSourceType](#oh_nativexcomponent_getkeyeventsourcetype) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, [OH_NativeXComponent_EventSourceType](#oh_nativexcomponent_eventsourcetype) \*sourceType) | Obtains the source type of the specified key event.                       |
93| [OH_NativeXComponent_GetKeyEventDeviceId](#oh_nativexcomponent_getkeyeventdeviceid) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, int64_t \*deviceId) | Obtains the device ID of the specified key event.                        |
94| [OH_NativeXComponent_GetKeyEventTimestamp](#oh_nativexcomponent_getkeyeventtimestamp) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, int64_t \*timeStamp) | Obtains the timestamp of the specified key event.                         |
95| [OH_NativeXComponent_SetExpectedFrameRateRange](#oh_nativexcomponent_setexpectedframeraterange) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) \*range) | Sets the expected frame rate range.                                          |
96| [OH_NativeXComponent_RegisterOnFrameCallback](#oh_nativexcomponent_registeronframecallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint64_t timestamp, uint64_t targetTimestamp)) | Registers the display update callback for this **OH_NativeXComponent** instance and enables the callback for each frame.|
97| [OH_NativeXComponent_UnregisterOnFrameCallback](#oh_nativexcomponent_unregisteronframecallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component) | Deregisters the display update callback for this **OH_NativeXComponent** instance and disables the callback for each frame.|
98| int32_t [OH_NativeXComponent_AttachNativeRootNode](#oh_nativexcomponent_attachnativerootnode) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) root) | Attaches the UI component created through the native API of ArkUI to this **OH_NativeXComponent** instance. |
99| int32_t [OH_NativeXComponent_DetachNativeRootNode](#oh_nativexcomponent_detachnativerootnode) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) root) | Detaches the native component of ArkUI from this **OH_NativeXComponent** instance. |
100| int32_t [OH_NativeXComponent_RegisterUIInputEventCallback](#oh_nativexcomponent_registeruiinputeventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_UIInputEvent](_ark_u_i___event_module.md#arkui_uiinputevent) \*event, [ArkUI_UIInputEvent_Type](_ark_u_i___event_module.md#arkui_uiinputevent_type) type), [ArkUI_UIInputEvent_Type](_ark_u_i___event_module.md#arkui_uiinputevent_type) type) | Registers a UI input event callback for an **OH_NativeXComponent** instance and enables the callback to be invoked when a UI input event is received. |
101| int32_t [OH_NativeXComponent_RegisterOnTouchInterceptCallback](#oh_nativexcomponent_registerontouchinterceptcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_HitTestMode](_ark_u_i___event_module.md#hittestmode)(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_UIInputEvent](_ark_u_i___event_module.md#arkui_uiinputevent) \*event)) | Registers a custom event intercept callback for an **OH_NativeXComponent** and enables the callback during the hit test. |
102| int32_t [OH_NativeXComponent_SetNeedSoftKeyboard](#oh_nativexcomponent_setneedsoftkeyboard) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, bool isNeedSoftKeyboard) | Sets whether the soft keyboard is required for an **OH_NativeXComponent** instance. |
103| int32_t [OH_NativeXComponent_RegisterSurfaceShowCallback](#oh_nativexcomponent_registersurfaceshowcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers a surface display callback for an **OH_NativeXComponent** instance. The callback is invoked after the application is switched to the foreground.|
104| int32_t [OH_NativeXComponent_RegisterSurfaceHideCallback](#oh_nativexcomponent_registersurfacehidecallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers a surface hiding callback for an **OH_NativeXComponent** instance. The callback is invoked after the application is switched to the background.|
105| int32_t [OH_NativeXComponent_GetTouchEventSourceType](#oh_nativexcomponent_gettoucheventsourcetype) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, int32_t pointId, [OH_NativeXComponent_EventSourceType](#oh_nativexcomponent_eventsourcetype) \*sourceType) | Obtains the touch event source type of an **OH_NativeXComponent** instance. |
106| [OH_NativeXComponent](#oh_nativexcomponent) \* [OH_NativeXComponent_GetNativeXComponent](#oh_nativexcomponent_getnativexcomponent) ([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node) | Obtains a pointer of the **OH_NativeXComponent** type based on the specified component instance created by the native API. |
107| int32_t [OH_NativeXComponent_GetNativeAccessibilityProvider](#oh_nativexcomponent_getnativeaccessibilityprovider)([OH_NativeXComponent](#oh_nativexcomponent)* component, [ArkUI_AccessibilityProvider](./arkui_native_interface_accessibility.md#arkui_accessibilityprovider)** handle); | Obtains a pointer of the **ArkUI_AccessibilityProvider** type based on an **OH_NativeXComponent** instance.|
108| int32_t [OH_NativeXComponent_RegisterKeyEventCallbackWithResult](#oh_nativexcomponent_registerkeyeventcallbackwithresult) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, bool(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers a key event callback with a return value for this **OH_NativeXComponent** instance. |
109|int32_t [OH_ArkUI_XComponent_StartImageAnalyzer](#oh_arkui_xcomponent_startimageanalyzer) ([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, void \*userData,void (\*callback)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, [ArkUI_XComponent_ImageAnalyzerState](#arkui_xcomponent_imageanalyzerstate) statusCode, void \*userData))|Starts AI image analysis for this XComponent instance.|
110|int32_t [OH_ArkUI_XComponent_StopImageAnalyzer](#oh_arkui_xcomponent_stopimageanalyzer)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node)|Stops AI image analysis for this XComponent instance.|
111|[OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* [OH_ArkUI_SurfaceCallback_Create](#oh_arkui_surfacecallback_create)()|Creates an **OH_ArkUI_SurfaceCallback** object.|
112|void [OH_ArkUI_SurfaceCallback_Dispose](#oh_arkui_surfacecallback_dispose)([OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback)|Disposes of an **OH_ArkUI_SurfaceCallback** object.|
113|[OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* [OH_ArkUI_SurfaceHolder_Create](#oh_arkui_surfaceholder_create)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node)|Creates an **OH_ArkUI_SurfaceHolder** object for an XComponent.|
114|void [OH_ArkUI_SurfaceHolder_Dispose](#oh_arkui_surfaceholder_dispose)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder)|Disposes of an **OH_ArkUI_SurfaceHolder** object.|
115|int32_t [OH_ArkUI_SurfaceHolder_SetUserData](#oh_arkui_surfaceholder_setuserdata)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder, void* userData)|Stores custom data in an **OH_ArkUI_SurfaceHolder** instance.|
116|void* [OH_ArkUI_SurfaceHolder_GetUserData](#oh_arkui_surfaceholder_getuserdata)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder)|Obtains the custom data stored in an **OH_ArkUI_SurfaceHolder** instance.|
117|void [OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent](#oh_arkui_surfacecallback_setsurfacecreatedevent)([OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback, void (\*onSurfaceCreated)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)\* surfaceHolder))|Sets the creation callback event in the surface lifecycle callback.|
118|void [OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent](#oh_arkui_surfacecallback_setsurfacechangedevent)([OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback, void (\*onSurfaceChanged)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)\* surfaceHolder, uint64_t width, uint64_t height))|Sets the size change callback event in the surface lifecycle callback.|
119|void [OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent](#oh_arkui_surfacecallback_setsurfacedestroyedevent)([OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback, void (\*onSurfaceDestroyed)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)\* surfaceHolder))|Sets the destruction callback event in the surface lifecycle callback.|
120|int32_t [OH_ArkUI_SurfaceHolder_AddSurfaceCallback](#oh_arkui_surfaceholder_addsurfacecallback)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder, [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback)|Adds a surface lifecycle callback to an **OH_ArkUI_SurfaceHolder** instance.|
121|int32_t [OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback](#oh_arkui_surfaceholder_removesurfacecallback)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder, [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback)|Removes a previously added surface lifecycle callback from an **OH_ArkUI_SurfaceHolder** instance.|
122|[OHNativeWindow](#ohnativewindow)* [OH_ArkUI_XComponent_GetNativeWindow](#oh_arkui_xcomponent_getnativewindow)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder)|Obtains the **NativeWindow** instance associated with an **OH_ArkUI_SurfaceHolder** instance.|
123|int32_t [OH_ArkUI_XComponent_SetAutoInitialize](#oh_arkui_xcomponent_setautoinitialize)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, bool autoInitialize)|Sets whether the **XComponent** component needs to automatically initialize the surface.|
124|int32_t [OH_ArkUI_XComponent_Initialize](#oh_arkui_xcomponent_initialize)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node)|Initializes the surface held by the **XComponent** component.|
125|int32_t [OH_ArkUI_XComponent_Finalize](#oh_arkui_xcomponent_finalize)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node)|Destroys the surface held by the **XComponent** component.|
126|int32_t [OH_ArkUI_XComponent_IsInitialized](#oh_arkui_xcomponent_isinitialized)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, bool* isInitialized)|Checks whether the surface held by the **XComponent** component is initialized.|
127|int32_t [OH_NativeXComponent_GetExtraMouseEventInfo](#oh_nativexcomponent_getextramouseeventinfo)([OH_NativeXComponent](#oh_nativexcomponent)* component, [OH_NativeXComponent_ExtraMouseEventInfo](#oh_nativexcomponent_extramouseeventinfo)** extraMouseEventInfo)| Obtains extended mouse event information from an **OH_NativeXComponent** instance.|
128|int32_t [OH_NativeXComponent_GetMouseEventModifierKeyStates](#oh_nativexcomponent_getmouseeventmodifierkeystates)([OH_NativeXComponent_ExtraMouseEventInfo](#oh_nativexcomponent_extramouseeventinfo)* extraMouseEventInfo, uint64_t* keys)|Obtains the state of modifier keys from an **OH_NativeXComponent_ExtraMouseEventInfo** instance.|
129|int32_t [OH_NativeXComponent_GetKeyEventModifierKeyStates](#oh_nativexcomponent_getkeyeventmodifierkeystates)([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent)* keyEvent, uint64_t* keys)|Obtains the state of modifier keys from a key event.|
130|int32_t [OH_NativeXComponent_GetKeyEventNumLockState](#oh_nativexcomponent_getkeyeventnumlockstate)([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent)* keyEvent, bool* isNumLockOn) | Obtains the state of the NumLock key from a key event.|
131|int32_t [OH_NativeXComponent_GetKeyEventCapsLockState](#oh_nativexcomponent_getkeyeventcapslockstate)([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent)* keyEvent, bool* isCapsLockOn)| Obtains the state of the CapsLock key from a key event.|
132|int32_t [OH_NativeXComponent_GetKeyEventScrollLockState](#oh_nativexcomponent_getkeyeventscrolllockstate)([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent)* keyEvent, bool* isScrollLockOn) | Obtains the state of the ScrollLock key from a key event.|
133|int32_t [OH_ArkUI_XComponent_SetExpectedFrameRateRange](#oh_arkui_xcomponent_setexpectedframeraterange)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) range)|Sets the expected frame rate range for the XComponent.|
134|int32_t [OH_ArkUI_XComponent_RegisterOnFrameCallback](#oh_arkui_xcomponent_registeronframecallback)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node,void (*callback)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, uint64_t timestamp, uint64_t targetTimestamp))|Registers a frame callback function for the XComponent.|
135|int32_t [OH_ArkUI_XComponent_UnregisterOnFrameCallback](#oh_arkui_xcomponent_unregisteronframecallback)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node)|Unregisters the frame callback function for the XComponent.|
136|int32_t [OH_ArkUI_XComponent_SetNeedSoftKeyboard](#oh_arkui_xcomponent_setneedsoftkeyboard)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node, bool needSoftKeyboard) | Sets whether the soft keyboard is required for the XComponent.|
137|[ArkUI_AccessibilityProvider](_o_h___native_x_component.md#oh_arkui_accessibilityprovider_create)* [OH_ArkUI_AccessibilityProvider_Create](#oh_arkui_accessibilityprovider_create)([ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) node) | Creates an **ArkUI_AccessibilityProvider** instance for the XComponent.|
138|void [OH_ArkUI_AccessibilityProvider_Dispose](#oh_arkui_accessibilityprovider_dispose)([ArkUI_AccessibilityProvider](_o_h___native_x_component.md#oh_arkui_accessibilityprovider_create)* provider)|Destroys the [ArkUI_AccessibilityProvider](arkui_native_interface_accessibility.md#arkui_accessibilityprovider) instance created using [OH_ArkUI_AccessibilityProvider_Create](#oh_arkui_accessibilityprovider_create).|
139|void [OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent](#oh_arkui_surfacecallback_setsurfaceshowevent)([OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback,void (\*onSurfaceShow)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder))|Sets a surface display callback for this **OH_ArkUI_SurfaceCallback** instance. The callback is invoked when the application window has returned to the foreground from the background.|
140|void [OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent](#oh_arkui_surfacecallback_setsurfacehideevent)([OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback)* callback,void (\*onSurfaceHide)([OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder)* surfaceHolder))|Sets a surface hiding callback for this **OH_ArkUI_SurfaceCallback** instance. The callback is invoked when the application window has entered the background from the foreground.|
141
142### Variables
143
144| Name                                      | Description                            |
145| ---------------------------------------- | ------------------------------ |
146| [OH_XCOMPONENT_ID_LEN_MAX](#oh_xcomponent_id_len_max) = 128 | Maximum length of the ArkUI XComponent ID. |
147| [OH_MAX_TOUCH_POINTS_NUMBER](#oh_max_touch_points_number) = 10 | Maximum number of identifiable touch points in a touch event.           |
148| [OH_NativeXComponent_TouchPoint::id](#id-13) = 0 | Unique identifier of the finger.                     |
149| [OH_NativeXComponent_TouchPoint::screenX](#screenx-14) = 0.0 | X coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.|
150| [OH_NativeXComponent_TouchPoint::screenY](#screeny-14) = 0.0 | Y coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.|
151| [OH_NativeXComponent_TouchPoint::x](#x-14) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent.    |
152| [OH_NativeXComponent_TouchPoint::y](#y-14) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent.    |
153| [OH_NativeXComponent_TouchPoint::type](#type-13) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event.                    |
154| [OH_NativeXComponent_TouchPoint::size](#size-13) = 0.0 | Contact area between the finger pad and the screen.                 |
155| [OH_NativeXComponent_TouchPoint::force](#force-13) = 0.0 | Pressure of the touch event.                    |
156| [OH_NativeXComponent_TouchPoint::timeStamp](#timestamp-13) = 0 | Timestamp of the touch event.                   |
157| [OH_NativeXComponent_TouchPoint::isPressed](#ispressed) = false | Whether the current point is pressed.                     |
158| [OH_NativeXComponent_TouchEvent::id](#id-23) = 0 | Unique identifier of the finger.                     |
159| [OH_NativeXComponent_TouchEvent::screenX](#screenx-24) = 0.0 | X coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.              |
160| [OH_NativeXComponent_TouchEvent::screenY](#screeny-24) = 0.0 | Y coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.              |
161| [OH_NativeXComponent_TouchEvent::x](#x-24) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent.    |
162| [OH_NativeXComponent_TouchEvent::y](#y-24) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent.    |
163| [OH_NativeXComponent_TouchEvent::type](#type-23) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event.                    |
164| [OH_NativeXComponent_TouchEvent::size](#size-23) = 0.0 | Contact area between the finger pad and the screen.                 |
165| [OH_NativeXComponent_TouchEvent::force](#force-23) = 0.0 | Pressure of the touch event.                    |
166| [OH_NativeXComponent_TouchEvent::deviceId](#deviceid) = 0 | ID of the device where the current touch event is triggered.               |
167| [OH_NativeXComponent_TouchEvent::timeStamp](#timestamp-23) = 0 | Timestamp of the touch event.                   |
168| [OH_NativeXComponent_TouchEvent::touchPoints](#touchpoints) [OH_MAX_TOUCH_POINTS_NUMBER] | Array of the touch points.                     |
169| [OH_NativeXComponent_TouchEvent::numPoints](#numpoints) = 0 | Number of current touch points.                     |
170| [OH_NativeXComponent_MouseEvent::x](#x-34) = 0.0 | X coordinate of the clicked point relative to the upper left corner of the component.          |
171| [OH_NativeXComponent_MouseEvent::y](#y-34) = 0.0 | Y coordinate of the clicked point relative to the upper left corner of the component.          |
172| [OH_NativeXComponent_MouseEvent::screenX](#screenx-34) = 0.0 | X coordinate of the clicked point relative to the upper left corner of the screen.            |
173| [OH_NativeXComponent_MouseEvent::screenY](#screeny-34) = 0.0 | Y coordinate of the clicked point relative to the upper left corner of the screen.            |
174| [OH_NativeXComponent_MouseEvent::timestamp](#timestamp) = 0 | Timestamp of the mouse event.                   |
175| [OH_NativeXComponent_MouseEvent::action](#action) = [OH_NativeXComponent_MouseEventAction::OH_NATIVEXCOMPONENT_MOUSE_NONE](#oh_nativexcomponent_mouseeventaction) | Action of the mouse event.                     |
176| [OH_NativeXComponent_MouseEvent::button](#button) = [OH_NativeXComponent_MouseEventButton::OH_NATIVEXCOMPONENT_NONE_BUTTON](#oh_nativexcomponent_mouseeventbutton) | Mouse event button.                       |
177| [OH_NativeXComponent_Callback::OnSurfaceCreated](#onsurfacecreated) | Invoked when a surface is created.                 |
178| [OH_NativeXComponent_Callback::OnSurfaceChanged](#onsurfacechanged) | Invoked when the surface changes.                |
179| [OH_NativeXComponent_Callback::OnSurfaceDestroyed](#onsurfacedestroyed) | Invoked when the surface is destroyed.               |
180| [OH_NativeXComponent_Callback::DispatchTouchEvent](#dispatchtouchevent) | Invoked when a touch event is triggered.                  |
181| [OH_NativeXComponent_MouseEvent_Callback::DispatchMouseEvent](#dispatchmouseevent) | Invoked when a mouse event is triggered.                  |
182| [OH_NativeXComponent_MouseEvent_Callback::DispatchHoverEvent](#dispatchhoverevent) | Invoked when a hover event is triggered.                  |
183| [OH_NativeXComponent_HistoricalPoint::id](#id-33) = 0 | Unique identifier of the finger.                     |
184| [OH_NativeXComponent_HistoricalPoint::screenX](#screenx-44) = 0.0 | X coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.|
185| [OH_NativeXComponent_HistoricalPoint::screenY](#screeny-44) = 0.0 | Y coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.|
186| [OH_NativeXComponent_HistoricalPoint::x](#x-44) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent.          |
187| [OH_NativeXComponent_HistoricalPoint::y](#y-44) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent.          |
188| [OH_NativeXComponent_HistoricalPoint::type](#type-33) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event.                    |
189| [OH_NativeXComponent_HistoricalPoint::size](#size-33) = 0.0 | Contact area between the finger pad and the screen.                 |
190| [OH_NativeXComponent_HistoricalPoint::force](#force-33) = 0.0 | Pressure of the touch event.                    |
191| [OH_NativeXComponent_HistoricalPoint::timeStamp](#timestamp-33) | Timestamp of the touch event. It is interval between the time when the event is triggered and the time when the system starts, in nanoseconds.|
192| [OH_NativeXComponent_HistoricalPoint::titlX](#titlx) | Angle between the projection on the x-y plane and the z-axis of the touch event.|
193| [OH_NativeXComponent_HistoricalPoint::titlY](#titly) | Angle between the projection on the y-z plane and the z-axis of the current touch event.|
194| [OH_NativeXComponent_HistoricalPoint::sourceTool](#sourcetool) | Source tool of the touch event.|
195
196
197## Type Description
198
199
200### OH_NativeXComponent
201
202```
203typedef struct OH_NativeXComponent OH_NativeXComponent
204```
205
206**Description**
207
208Provides an encapsulated **OH_NativeXComponent** instance.
209
210**Since**
211
2128
213
214
215### OH_NativeXComponent_Callback
216
217```
218typedef struct OH_NativeXComponent_Callback OH_NativeXComponent_Callback
219```
220
221**Description**
222
223Registers callbacks for the surface lifecycle and touch event.
224
225**Since**
226
2278
228
229
230### OH_NativeXComponent_KeyEvent
231
232```
233typedef struct OH_NativeXComponent_KeyEvent OH_NativeXComponent_KeyEvent
234```
235
236**Description**
237
238Provides an encapsulated **OH_NativeXComponent_KeyEvent** instance.
239
240> **NOTE**
241>
242> This struct can be accessed through APIs such as [OH_NativeXComponent_GetKeyEventAction](#oh_nativexcomponent_getkeyeventaction), [OH_NativeXComponent_GetKeyEventCode](#oh_nativexcomponent_getkeyeventcode), [OH_NativeXComponent_GetKeyEventDeviceId](#oh_nativexcomponent_getkeyeventdeviceid), [OH_NativeXComponent_GetKeyEventSourceType](#oh_nativexcomponent_getkeyeventsourcetype), and [OH_NativeXComponent_GetKeyEventTimestamp](#oh_nativexcomponent_getkeyeventtimestamp) to obtain parameters within the struct.
243
244**Since**
245
24610
247
248
249### OH_NativeXComponent_MouseEvent_Callback
250
251```
252typedef struct OH_NativeXComponent_MouseEvent_Callback OH_NativeXComponent_MouseEvent_Callback
253```
254
255**Description**
256
257Registers callbacks for the mouse event.
258
259**Since**
260
2619
262
263
264### OH_ArkUI_SurfaceCallback
265
266```
267typedef struct OH_ArkUI_SurfaceCallback OH_ArkUI_SurfaceCallback
268```
269
270**Description**
271
272Defines surface lifecycle callback functions.
273
274> **NOTE**
275>
276> The specific definition of this type is not directly exposed. Instances of this type can be created by calling the [OH_ArkUI_SurfaceCallback_Create](#oh_arkui_surfacecallback_create) API and destroyed by calling the [OH_ArkUI_SurfaceCallback_Dispose](#oh_arkui_surfacecallback_dispose) API.
277
278**Since**
279
28019
281
282
283### OH_ArkUI_SurfaceHolder
284
285```
286typedef struct OH_ArkUI_SurfaceHolder OH_ArkUI_SurfaceHolder
287```
288
289**Description**
290
291Provides an encapsulated **OH_ArkUI_SurfaceHolder** instance.
292
293> **NOTE**
294>
295> The specific definition of this type is not directly exposed. Instances of this type can be created by calling the [OH_ArkUI_SurfaceHolder_Create](#oh_arkui_surfaceholder_create) API and destroyed by calling the [OH_ArkUI_SurfaceHolder_Dispose](#oh_arkui_surfaceholder_dispose) API.
296
297**Since**
298
29919
300
301
302### OHNativeWindow
303
304```
305typedef struct NativeWindow OHNativeWindow
306```
307
308**Description**
309
310Provides an encapsulated **NativeWindow** instance.
311
312> **NOTE**
313>
314> The specific definition of this type is not directly exposed. Instances of this type can be created by calling the [OH_ArkUI_XComponent_GetNativeWindow](#oh_arkui_xcomponent_getnativewindow) API.
315
316**Since**
317
31819
319
320
321### OH_NativeXComponent_ExtraMouseEventInfo
322
323```
324typedef struct OH_NativeXComponent_ExtraMouseEventInfo OH_NativeXComponent_ExtraMouseEventInfo
325```
326
327**Description**
328
329Provides an encapsulated instance of extended mouse event information.
330
331> **NOTE**
332>
333> The specific definition of this type is not directly exposed. You call the [OH_NativeXComponent_GetMouseEventModifierKeyStates](#oh_nativexcomponent_getmouseeventmodifierkeystates) API to obtain the pressed states of modifier keys (**Ctrl**, **Shift**, and **Alt**).
334
335**Since**
336
33720
338
339
340## Enum Description
341
342
343### anonymous enum
344
345```
346anonymous enum
347```
348
349**Description**
350
351Enumerates the API access states.
352
353| Value                                     | Description   |
354| ---------------------------------------- | ----- |
355| OH_NATIVEXCOMPONENT_RESULT_SUCCESS       | Success.|
356| OH_NATIVEXCOMPONENT_RESULT_FAILED        | Failure.|
357| OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER | Invalid parameter.|
358
359**Since**
360
3618
362
363
364### OH_NativeXComponent_EventSourceType
365
366```
367enum OH_NativeXComponent_EventSourceType
368```
369
370**Description**
371
372Enumerates the touch event source types.
373
374| Value                                     | Description                                                  |
375| ------------------------------------------- | ------------------------------------------------------ |
376| OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN     | Unknown source type.                                    |
377| OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE       | Source that generates a mouse multi-click event.                      |
378| OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN | Source that generates a touchscreen multi-touch event.                |
379| OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD    | Source that generates a touchpad multi-touch event.                |
380| OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK    | Source that generates a joystick multi-touch event.                |
381| OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD<sup>10+</sup>    | Source that generates a key event.           |
382
383**Since**
384
3859
386
387
388### OH_NativeXComponent_TouchEvent_SourceTool
389
390```
391enum OH_NativeXComponent_TouchEvent_SourceTool
392```
393
394**Description**
395
396Enumerates the source tool types of touch events.
397
398| Value                                     | Description                                                  |
399| ------------------------------------------- | ------------------------------------------------------ |
400| OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN     | Unknown source tool.                                    |
401| OH_NATIVEXCOMPONENT_SOURCETOOL_FINGER       | Finger.                      |
402| OH_NATIVEXCOMPONENT_SOURCETOOL_PEN | Pen.                |
403| OH_NATIVEXCOMPONENT_SOURCETOOL_RUBBER    | Eraser.                |
404| OH_NATIVEXCOMPONENT_SOURCETOOL_BRUSH    | Brush.                |
405| OH_NATIVEXCOMPONENT_SOURCETOOL_PENCIL    | Pencil.           |
406| OH_NATIVEXCOMPONENT_SOURCETOOL_AIRBRUSH | Airbrush.|
407| OH_NATIVEXCOMPONENT_SOURCETOOL_MOUSE | Mouse pointer.|
408| OH_NATIVEXCOMPONENT_SOURCETOOL_LENS | Lens.|
409| OH_NATIVEXCOMPONENT_SOURCETOOL_TOUCHPAD | Touchpad.|
410
411**Since**
412
41310
414
415
416### OH_NativeXComponent_KeyAction
417
418```
419enum OH_NativeXComponent_KeyAction
420```
421
422**Description**
423
424Enumerates the key event actions.
425
426| Value                                   | Description      |
427| -------------------------------------- | -------- |
428| OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN | Unknown key event action.|
429| OH_NATIVEXCOMPONENT_KEY_ACTION_DOWN    | Button press. |
430| OH_NATIVEXCOMPONENT_KEY_ACTION_UP      | Button release. |
431
432**Since**
433
43410
435
436
437### OH_NativeXComponent_KeyCode
438
439```
440enum OH_NativeXComponent_KeyCode
441```
442
443**Description**
444
445Enumerates the mouse event key codes.
446
447| Value                         | Description                         |
448| ---------------------------- | --------------------------- |
449| KEY_UNKNOWN                  | Unknown key.                       |
450| KEY_FN                       | Function (Fn) key.                    |
451| KEY_HOME                     | Function (Home) key.                  |
452| KEY_BACK                     | Back key.                        |
453| KEY_MEDIA_PLAY_PAUSE         | Multimedia key - play/pause.            |
454| KEY_MEDIA_STOP               | Multimedia key - stop.               |
455| KEY_MEDIA_NEXT               | Multimedia key - next song.              |
456| KEY_MEDIA_PREVIOUS           | Multimedia key - previous song.              |
457| KEY_MEDIA_REWIND             | Multimedia key - rewind.               |
458| KEY_MEDIA_FAST_FORWARD       | Multimedia key - fast-forward.               |
459| KEY_VOLUME_UP                | Volume Up key.                      |
460| KEY_VOLUME_DOWN              | Volume Down key.                      |
461| KEY_POWER                    | Power key.                        |
462| KEY_CAMERA                   | Camera key.                        |
463| KEY_VOLUME_MUTE              | Speaker Mute key.                     |
464| KEY_MUTE                     | Microphone Mute key.                      |
465| KEY_BRIGHTNESS_UP            | Brightness key - turn up.             |
466| KEY_BRIGHTNESS_DOWN          | Brightness key - turn down.             |
467| KEY_0                        | Key **0**.                      |
468| KEY_1                        | Key **1**.                      |
469| KEY_2                        | Key **2**.                      |
470| KEY_3                        | Key **3**.                      |
471| KEY_4                        | Key **4**.                      |
472| KEY_5                        | Key **5**.                      |
473| KEY_6                        | Key **6**.                      |
474| KEY_7                        | Key **7**.                      |
475| KEY_8                        | Key **8**.                      |
476| KEY_9                        | Key **9**.                      |
477| KEY_STAR                     | Key **\***.                     |
478| KEY_POUND                    | Key **\#**.                     |
479| KEY_DPAD_UP                  | Navigation key - up.                |
480| KEY_DPAD_DOWN                | Navigation key - down.                |
481| KEY_DPAD_LEFT                | Navigation key - left.                |
482| KEY_DPAD_RIGHT               | Navigation key - right.                |
483| KEY_DPAD_CENTER              | Navigation key - OK.               |
484| KEY_A                        | Key **A**.                      |
485| KEY_B                        | Key **B**.                      |
486| KEY_C                        | Key **C**.                      |
487| KEY_D                        | Key **D**.                      |
488| KEY_E                        | Key **E**.                      |
489| KEY_F                        | Key **F**.                      |
490| KEY_G                        | Key **G**.                      |
491| KEY_H                        | Key **H**.                      |
492| KEY_I                        | Key **I**.                      |
493| KEY_J                        | Key **J**.                      |
494| KEY_K                        | Key **K**.                      |
495| KEY_L                        | Key **L**.                      |
496| KEY_M                        | Key **M**.                      |
497| KEY_N                        | Key **N**.                      |
498| KEY_O                        | Key **O**.                      |
499| KEY_P                        | Key **P**.                      |
500| KEY_Q                        | Key **Q**.                      |
501| KEY_R                        | Key **R**.                      |
502| KEY_S                        | Key **S**.                      |
503| KEY_T                        | Key **T**.                      |
504| KEY_U                        | Key **U**.                      |
505| KEY_V                        | Key **V**.                      |
506| KEY_W                        | Key **W**.                      |
507| KEY_X                        | Key **X**.                      |
508| KEY_Y                        | Key **Y**.                      |
509| KEY_Z                        | Key **Z**.                      |
510| KEY_COMMA                    | Key **,**.                      |
511| KEY_PERIOD                   | Key **.**.                      |
512| KEY_ALT_LEFT                 | Left Alt key.                      |
513| KEY_ALT_RIGHT                | Right Alt key.                      |
514| KEY_SHIFT_LEFT               | Left Shift key.                    |
515| KEY_SHIFT_RIGHT              | Right Shift key.                    |
516| KEY_TAB                      | Tab key.                       |
517| KEY_SPACE                    | Space key.                        |
518| KEY_SYM                      | Symbol key.                    |
519| KEY_EXPLORER                 | Explorer key, which is used to start the explorer application.      |
520| KEY_ENVELOPE                 | Email key, which is used to start the email application.    |
521| KEY_ENTER                    | Enter key.                        |
522| KEY_DEL                      | Backspace/Delete key.                        |
523| KEY_GRAVE                    | Key **`**.                      |
524| KEY_MINUS                    | Key **-**.                      |
525| KEY_EQUALS                   | Key **=**.                      |
526| KEY_LEFT_BRACKET             | Key **[**.                      |
527| KEY_RIGHT_BRACKET            | Key **]**.                      |
528| KEY_BACKSLASH                | Key \\.                      |
529| KEY_SEMICOLON                | Key **;**.                      |
530| KEY_APOSTROPHE               | Key **'**.           |
531| KEY_SLASH                    | Key **/**.                      |
532| KEY_AT                       | Key **\@**.                     |
533| KEY_PLUS                     | Key **+**.                      |
534| KEY_MENU                     | Menu key.                        |
535| KEY_PAGE_UP                  | Page Up key.                      |
536| KEY_PAGE_DOWN                | Page Down key.                      |
537| KEY_ESCAPE                   | ESC key.                       |
538| KEY_FORWARD_DEL              | Forward Delete key.                        |
539| KEY_CTRL_LEFT                | Left Ctrl key.                     |
540| KEY_CTRL_RIGHT               | Right Ctrl key.                     |
541| KEY_CAPS_LOCK                | Caps Lock key.                      |
542| KEY_SCROLL_LOCK              | Scroll Lock key.                      |
543| KEY_META_LEFT                | Left Meta key.                     |
544| KEY_META_RIGHT               | Right Meta key.                     |
545| KEY_FUNCTION                 | Function key.                        |
546| KEY_SYSRQ                    | System Request/Print Screen key.                 |
547| KEY_BREAK                    | Break/Pause key.               |
548| KEY_MOVE_HOME                | Move to Home key.                   |
549| KEY_MOVE_END                 | Move to End key.                   |
550| KEY_INSERT                   | Insert key.                        |
551| KEY_FORWARD                  | Forward key.                        |
552| KEY_MEDIA_PLAY               | Multimedia key - play.               |
553| KEY_MEDIA_PAUSE              | Multimedia key - pause.               |
554| KEY_MEDIA_CLOSE              | Multimedia key - close.               |
555| KEY_MEDIA_EJECT              | Multimedia key - eject.               |
556| KEY_MEDIA_RECORD             | Multimedia key - record.               |
557| KEY_F1                       | F1 key.                     |
558| KEY_F2                       | F2 key.                     |
559| KEY_F3                       | F3 key.                     |
560| KEY_F4                       | F4 key.                     |
561| KEY_F5                       | F5 key.                     |
562| KEY_F6                       | F6 key.                     |
563| KEY_F7                       | F7 key.                     |
564| KEY_F8                       | F8 key.                     |
565| KEY_F9                       | F9 key.                     |
566| KEY_F10                      | F10 key.                    |
567| KEY_F11                      | F11 key.                    |
568| KEY_F12                      | F12 key.                    |
569| KEY_NUM_LOCK                 | Number Lock key.                       |
570| KEY_NUMPAD_0                 | Key **0** on numeric keypad.                   |
571| KEY_NUMPAD_1                 | Key **1** on numeric keypad.                   |
572| KEY_NUMPAD_2                 | Key **2** on numeric keypad.                   |
573| KEY_NUMPAD_3                 | Key **3** on numeric keypad.                   |
574| KEY_NUMPAD_4                 | Key **4** on numeric keypad.                   |
575| KEY_NUMPAD_5                 | Key **5** on numeric keypad.                   |
576| KEY_NUMPAD_6                 | Key **6** on numeric keypad.                   |
577| KEY_NUMPAD_7                 | Key **7** on numeric keypad.                   |
578| KEY_NUMPAD_8                 | Key **8** on numeric keypad.                   |
579| KEY_NUMPAD_9                 | Key **9** on numeric keypad.                   |
580| KEY_NUMPAD_DIVIDE            | Key **/** on numeric keypad.                   |
581| KEY_NUMPAD_MULTIPLY          | Key ***** on numeric keypad.                  |
582| KEY_NUMPAD_SUBTRACT          | Key **-** on numeric keypad.                   |
583| KEY_NUMPAD_ADD               | Key **+** on numeric keypad.                   |
584| KEY_NUMPAD_DOT               | Key **.** on numeric keypad.                   |
585| KEY_NUMPAD_COMMA             | Key **,** on numeric keypad.                   |
586| KEY_NUMPAD_ENTER             | Enter key on numeric keypad.                    |
587| KEY_NUMPAD_EQUALS            | Key **=** on numeric keypad.                   |
588| KEY_NUMPAD_LEFT_PAREN        | Key **(** on numeric keypad.                   |
589| KEY_NUMPAD_RIGHT_PAREN       | Key **)** on numeric keypad.                   |
590| KEY_VIRTUAL_MULTITASK        | Multi-task key.                     |
591| KEY_SLEEP                    | Sleep key.                        |
592| KEY_ZENKAKU_HANKAKU          | Zenkaku/Hankaku key.                   |
593| KEY_102ND                    | 102nd key.                    |
594| KEY_RO                       | Ro key.                      |
595| KEY_KATAKANA                 | Katakana key.                     |
596| KEY_HIRAGANA                 | Hiragana key.                     |
597| KEY_HENKAN                   | Henkan key.                      |
598| KEY_KATAKANA_HIRAGANA        | Katakana/Hiragana key.                 |
599| KEY_MUHENKAN                 | Muhenkan key.                     |
600| KEY_LINEFEED                 | Linefeed key.                        |
601| KEY_MACRO                    | Macro key.                         |
602| KEY_NUMPAD_PLUSMINUS         | Plus/Minus key on the numeric keypad.               |
603| KEY_SCALE                    | Scale key.                        |
604| KEY_HANGUEL                  | Hanguel key.                      |
605| KEY_HANJA                    | Hanja key.                      |
606| KEY_YEN                      | Yen key.                        |
607| KEY_STOP                     | Stop key.                        |
608| KEY_AGAIN                    | Again key.                        |
609| KEY_PROPS                    | Props key.                        |
610| KEY_UNDO                     | Undo key.                        |
611| KEY_COPY                     | Copy key.                        |
612| KEY_OPEN                     | Open key.                        |
613| KEY_PASTE                    | Paste key.                        |
614| KEY_FIND                     | Find key.                        |
615| KEY_CUT                      | Cut key.                        |
616| KEY_HELP                     | Help key.                        |
617| KEY_CALC                     | Calc key, which is used to start the calculator application.       |
618| KEY_FILE                     | File key.                       |
619| KEY_BOOKMARKS                | Bookmarks key.                        |
620| KEY_NEXT                     | Next key.                      |
621| KEY_PLAYPAUSE                | Play/Pause key.                     |
622| KEY_PREVIOUS                 | Previous key.                      |
623| KEY_STOPCD                   | Stop CD key.                      |
624| KEY_CONFIG                   | Config key.                        |
625| KEY_REFRESH                  | Refresh key.                        |
626| KEY_EXIT                     | Exit key.                        |
627| KEY_EDIT                     | Edit key.                        |
628| KEY_SCROLLUP                 | Scroll Up key.                      |
629| KEY_SCROLLDOWN               | Scroll Down key.                      |
630| KEY_NEW                      | New key.                        |
631| KEY_REDO                     | Redo key.                        |
632| KEY_CLOSE                    | Close key.                        |
633| KEY_PLAY                     | Play key.                        |
634| KEY_BASSBOOST                | Bass Boost key.                      |
635| KEY_PRINT                    | Print key.                        |
636| KEY_CHAT                     | Chat key.                        |
637| KEY_FINANCE                  | Finance key.                        |
638| KEY_CANCEL                   | Cancel key.                        |
639| KEY_KBDILLUM_TOGGLE          | Keyboard Illumination Toggle key.                    |
640| KEY_KBDILLUM_DOWN            | Keyboard Illumination Up key.                    |
641| KEY_KBDILLUM_UP              | Keyboard Illumination Down key.                    |
642| KEY_SEND                     | Send key.                        |
643| KEY_REPLY                    | Reply key.                        |
644| KEY_FORWARDMAIL              | Forward Mail key.                      |
645| KEY_SAVE                     | Save key.                        |
646| KEY_DOCUMENTS                | Documents key.                        |
647| KEY_VIDEO_NEXT               | Next Video key.                     |
648| KEY_VIDEO_PREV               | Previous Video key.                     |
649| KEY_BRIGHTNESS_CYCLE         | Brightness Cycle key.                      |
650| KEY_BRIGHTNESS_ZERO          | Brightness Zero key.                    |
651| KEY_DISPLAY_OFF              | Display Off Key.                      |
652| KEY_BTN_MISC                 | Misc Button key.                 |
653| KEY_GOTO                     | Goto key.                        |
654| KEY_INFO                     | Info key.                      |
655| KEY_PROGRAM                  | Program key.                        |
656| KEY_PVR                      | PVR key.                |
657| KEY_SUBTITLE                 | Subtitle key.                        |
658| KEY_FULL_SCREEN              | Full Screen key.                        |
659| KEY_KEYBOARD                 | Keyboard.                         |
660| KEY_ASPECT_RATIO             | Aspect Ratio key.                   |
661| KEY_PC                       | Port Control key.                      |
662| KEY_TV                       | TV key.                        |
663| KEY_TV2                      | TV key 2.                       |
664| KEY_VCR                      | VCR key.                     |
665| KEY_VCR2                     | VCR key 2.                    |
666| KEY_SAT                      | SAT key.            |
667| KEY_CD                       | CD key.                        |
668| KEY_TAPE                     | Tape key.                        |
669| KEY_TUNER                    | Tuner key.                       |
670| KEY_PLAYER                   | Player key.                       |
671| KEY_DVD                      | DVD key.                       |
672| KEY_AUDIO                    | Audio key.                        |
673| KEY_VIDEO                    | Video key.                        |
674| KEY_MEMO                     | Memo key.                       |
675| KEY_CALENDAR                 | Calendar key.                        |
676| KEY_RED                      | Red indicator.                      |
677| KEY_GREEN                    | Green indicator.                      |
678| KEY_YELLOW                   | Yellow indicator.                      |
679| KEY_BLUE                     | Blue indicator.                      |
680| KEY_CHANNELUP                | Channel Up key.                      |
681| KEY_CHANNELDOWN              | Channel Down key.                      |
682| KEY_LAST                     | Last key.                        |
683| KEY_RESTART                  | Restart key.                        |
684| KEY_SLOW                     | Slow key.                        |
685| KEY_SHUFFLE                  | Shuffle key.                      |
686| KEY_VIDEOPHONE               | Videophone key.                      |
687| KEY_GAMES                    | Games key.                        |
688| KEY_ZOOMIN                   | Zoom in key.                        |
689| KEY_ZOOMOUT                  | Zoom out key.                        |
690| KEY_ZOOMRESET                | Zoom Reset key.                      |
691| KEY_WORDPROCESSOR            | Word Processor key.                      |
692| KEY_EDITOR                   | Editor key.                       |
693| KEY_SPREADSHEET              | Spreadsheet key.                      |
694| KEY_GRAPHICSEDITOR           | Graphics Editor key.                     |
695| KEY_PRESENTATION             | Presentation key.                      |
696| KEY_DATABASE                 | Database key.                      |
697| KEY_NEWS                     | News key.                        |
698| KEY_VOICEMAIL                | Voicemail key.                       |
699| KEY_ADDRESSBOOK              | Address book key.                        |
700| KEY_MESSENGER                | Messenger key.                        |
701| KEY_BRIGHTNESS_TOGGLE        | Brightness Toggle key.                      |
702| KEY_SPELLCHECK               | Spell Check key.                     |
703| KEY_COFFEE                   | Coffee key, which is used to launch screen lock or screen saver.                 |
704| KEY_MEDIA_REPEAT             | Media Repeat key.                      |
705| KEY_IMAGES                   | Images key.                        |
706| KEY_BUTTONCONFIG             | Button Configuration key.                      |
707| KEY_TASKMANAGER              | Task Manager key.                      |
708| KEY_JOURNAL                  | Log key.                       |
709| KEY_CONTROLPANEL             | Control Panel key.                      |
710| KEY_APPSELECT                | App Select key.                    |
711| KEY_SCREENSAVER              | Screen Saver key.                    |
712| KEY_ASSISTANT                | Assistant key.                        |
713| KEY_KBD_LAYOUT_NEXT          | Next Keyboard Layout key.                   |
714| KEY_BRIGHTNESS_MIN           | Min Brightness key.                      |
715| KEY_BRIGHTNESS_MAX           | Max Brightness key.                      |
716| KEY_KBDINPUTASSIST_PREV      | Keyboard Input-assisted Previous key.        |
717| KEY_KBDINPUTASSIST_NEXT      | Keyboard Input-assisted Next key.            |
718| KEY_KBDINPUTASSIST_PREVGROUP | Keyboard Input-assisted Previous key.        |
719| KEY_KBDINPUTASSIST_NEXTGROUP | Keyboard Input-assisted Next key.            |
720| KEY_KBDINPUTASSIST_ACCEPT    | Keyboard Input-assisted Accept key.          |
721| KEY_KBDINPUTASSIST_CANCEL    | Keyboard Input-assisted Cancel key.          |
722| KEY_FRONT                    | Front key, which is used to launch the windshield defogger.                  |
723| KEY_SETUP                    | Setup key.                        |
724| KEY_WAKEUP                   | Wakeup key.                        |
725| KEY_SENDFILE                 | Send File key.                     |
726| KEY_DELETEFILE               | Delete File key.                     |
727| KEY_XFER                     | XFER key, which is used to start file transfer.               |
728| KEY_PROG1                    | Program key 1.                       |
729| KEY_PROG2                    | Program key 2.                       |
730| KEY_MSDOS                    | MS-DOS key.           |
731| KEY_SCREENLOCK               | Screen Lock key.                      |
732| KEY_DIRECTION_ROTATE_DISPLAY | Directional Rotation Display key.                    |
733| KEY_CYCLEWINDOWS             | Windows Cycle key.                 |
734| KEY_COMPUTER                 | Keys.                         |
735| KEY_EJECTCLOSECD             | Eject CD key.                      |
736| KEY_ISO                      | ISO key.                       |
737| KEY_MOVE                     | Move key.                        |
738| KEY_F13                      | F13 key.                    |
739| KEY_F14                      | F14 key.                    |
740| KEY_F15                      | F15 key.                    |
741| KEY_F16                      | F16 key.                    |
742| KEY_F17                      | F17 key.                    |
743| KEY_F18                      | F18 key.                    |
744| KEY_F19                      | F19 key.                    |
745| KEY_F20                      | F20 key.                    |
746| KEY_F21                      | F21 key.                    |
747| KEY_F22                      | F22 key.                    |
748| KEY_F23                      | F23 key.                    |
749| KEY_F24                      | F24 key.                    |
750| KEY_PROG3                    | Program key 3.                       |
751| KEY_PROG4                    | Program key 4.                       |
752| KEY_DASHBOARD                | Dashboard.                        |
753| KEY_SUSPEND                  | Suspend key.                        |
754| KEY_HP                       | HP key.                      |
755| KEY_SOUND                    | Sound key.                        |
756| KEY_QUESTION                 | Question key.                       |
757| KEY_CONNECT                  | Connect key.                        |
758| KEY_SPORT                    | Sport key.                       |
759| KEY_SHOP                     | Shop key.                        |
760| KEY_ALTERASE                 | Alternate key.                        |
761| KEY_SWITCHVIDEOMODE          | Switch Video Mode key (monitor, LCD, and TV, etc.).|
762| KEY_BATTERY                  | Battery key.                       |
763| KEY_BLUETOOTH                | Bluetooth key.                       |
764| KEY_WLAN                     | WLAN key.                      |
765| KEY_UWB                      | Ultra-wideband key.                   |
766| KEY_WWAN_WIMAX               | WWAN WiMAX key.          |
767| KEY_RFKILL                   | RF Kill key.                  |
768| KEY_CHANNEL                  | Channel key.                      |
769| KEY_BTN_0                    | Button 0.                        |
770| KEY_BTN_1                    | Button 1.                        |
771| KEY_BTN_2                    | Button 2.                        |
772| KEY_BTN_3                    | Button 3.                        |
773| KEY_BTN_4                    | Button 4.                        |
774| KEY_BTN_5                    | Button 5.                        |
775| KEY_BTN_6                    | Button 6.                        |
776| KEY_BTN_7                    | Button 7.                        |
777| KEY_BTN_8                    | Button 8.                        |
778| KEY_BTN_9                    | Button 9.                        |
779
780**Since**
781
78210
783
784
785### OH_NativeXComponent_MouseEventAction
786
787```
788enum OH_NativeXComponent_MouseEventAction
789```
790
791**Description**
792
793Enumerates the mouse event actions.
794
795| Value                              | Description              |
796| --------------------------------- | ---------------- |
797| OH_NATIVEXCOMPONENT_MOUSE_NONE    | Invalid mouse event.   |
798| OH_NATIVEXCOMPONENT_MOUSE_PRESS   | Mouse button press.  |
799| OH_NATIVEXCOMPONENT_MOUSE_RELEASE | Mouse button release.  |
800| OH_NATIVEXCOMPONENT_MOUSE_MOVE    | Mouse movement.|
801| OH_NATIVEXCOMPONENT_MOUSE_CANCEL    | Mouse button canceling.<br>**Since**: 18|
802
803**Since**
804
8059
806
807
808### OH_NativeXComponent_MouseEventButton
809
810```
811enum OH_NativeXComponent_MouseEventButton
812```
813
814**Description**
815
816Enumerates the mouse event buttons.
817
818| Value                               | Description               |
819| ---------------------------------- | ----------------- |
820| OH_NATIVEXCOMPONENT_NONE_BUTTON    | No button.  |
821| OH_NATIVEXCOMPONENT_LEFT_BUTTON    | Left mouse button.   |
822| OH_NATIVEXCOMPONENT_RIGHT_BUTTON   | Right mouse button.   |
823| OH_NATIVEXCOMPONENT_MIDDLE_BUTTON  | Middle mouse button.   |
824| OH_NATIVEXCOMPONENT_BACK_BUTTON    | Back button on the left of the mouse.|
825| OH_NATIVEXCOMPONENT_FORWARD_BUTTON | Forward key on the left of the mouse.|
826
827**Since**
828
8299
830
831
832### OH_NativeXComponent_TouchEventType
833
834```
835enum OH_NativeXComponent_TouchEventType
836```
837
838**Description**
839
840Enumerates the touch event types.
841
842| Value                        | Description                   |
843| --------------------------- | --------------------- |
844| OH_NATIVEXCOMPONENT_DOWN    | The touch event is triggered when a finger is pressed.         |
845| OH_NATIVEXCOMPONENT_UP      | The touch event is triggered when a finger is lifted.         |
846| OH_NATIVEXCOMPONENT_MOVE    | The touch event is triggered when a finger is moved on the screen.|
847| OH_NATIVEXCOMPONENT_CANCEL  | The event is triggered when a touch event is canceled.         |
848| OH_NATIVEXCOMPONENT_UNKNOWN | Invalid touch type.             |
849
850**Since**
851
8528
853
854
855### OH_NativeXComponent_TouchPointToolType
856
857```
858enum OH_NativeXComponent_TouchPointToolType
859```
860
861**Description**
862
863Enumerates the touch point tool types.
864
865| Value                                   | Description      |
866| -------------------------------------- | -------- |
867| OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN  | Unknown tool type.|
868| OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER   | Finger.  |
869| OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN      | Stylus.  |
870| OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER   | Rubber. |
871| OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH    | Brush.  |
872| OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL   | Pencil.  |
873| OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH | Air brush.  |
874| OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE    | Mouse.  |
875| OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS     | Lens. |
876
877**Since**
878
8799
880
881### ArkUI_XComponent_ImageAnalyzerState
882
883```
884enum ArkUI_XComponent_ImageAnalyzerState
885```
886
887**Description**
888
889Enumerates the AI image analyzer error codes of the XComponent.
890
891| Value                                   | Description    |
892| --------------------------------------   | -------- |
893| ARKUI_XCOMPONENT_AI_ANALYSIS_FINISHED    | AI image analysis is complete.|
894| ARKUI_XCOMPONENT_AI_ANALYSIS_DISABLED    | AI image analysis is disabled.|
895| ARKUI_XCOMPONENT_AI_ANALYSIS_UNSUPPORTED | The device does not support AI image analysis.|
896| ARKUI_XCOMPONENT_AI_ANALYSIS_ONGOING     | AI image analysis is in progress.|
897| ARKUI_XCOMPONENT_AI_ANALYSIS_STOPPED     | AI image analysis has been stopped.|
898
899**Since**
900
90118
902
903## Function Description
904
905### OH_NativeXComponent_AttachNativeRootNode()
906
907```
908int32_t OH_NativeXComponent_AttachNativeRootNode (OH_NativeXComponent * component, ArkUI_NodeHandle root )
909```
910**Description**
911
912Attaches the UI component created through the native API of ArkUI to this **OH_NativeXComponent** instance.
913
914**Since**: 12
915
916**Deprecated from**: 20
917
918**Substitute**: [OH_ArkUI_NodeContent_AddNode](./_ark_u_i___native_module.md#oh_arkui_nodecontent_addnode)
919
920**Parameters**
921
922| Name| Description|
923| -------- | -------- |
924| component | Pointer to the **OH_NativeXComponent** instance. |
925| root | Pointer to the component instance created through the native API. |
926
927**Returns**
928
929**0**: success
930
931**-2**: parameter error
932
933
934### OH_NativeXComponent_DetachNativeRootNode()
935
936```
937int32_t OH_NativeXComponent_DetachNativeRootNode (OH_NativeXComponent * component, ArkUI_NodeHandle root )
938```
939**Description**
940
941Detaches the native component of ArkUI from this **OH_NativeXComponent** instance.
942
943**Since**: 12
944
945**Deprecated from**: 20
946
947**Substitute**: [OH_ArkUI_NodeContent_RemoveNode](./_ark_u_i___native_module.md#oh_arkui_nodecontent_removenode)
948
949**Parameters**
950
951| Name| Description|
952| -------- | -------- |
953| component | Pointer to the **OH_NativeXComponent** instance. |
954| root | Pointer to the component instance created through the native API. |
955
956**Returns**
957
958**0**: success
959
960**-2**: parameter error
961
962
963
964### OH_NativeXComponent_GetKeyEvent()
965
966```
967int32_t OH_NativeXComponent_GetKeyEvent (OH_NativeXComponent * component, OH_NativeXComponent_KeyEvent ** keyEvent )
968```
969
970**Description**
971
972Obtains the key event scheduled by the ArkUI XComponent.
973
974**Parameters**
975
976| Name       | Description                           |
977| --------- | ----------------------------- |
978| component | Pointer to the **OH_NativeXComponent** instance.|
979| keyEvent  | Pointer to the current key event.             |
980
981**Returns**
982
983Result code.
984
985**Since**
986
98710
988
989
990### OH_NativeXComponent_GetKeyEventAction()
991
992```
993int32_t OH_NativeXComponent_GetKeyEventAction (OH_NativeXComponent_KeyEvent * keyEvent, OH_NativeXComponent_KeyAction * action )
994```
995
996**Description**
997
998Obtains the action of the specified key event.
999
1000**Parameters**
1001
1002| Name      | Description                                    |
1003| -------- | -------------------------------------- |
1004| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.|
1005| action   | Pointer to the key event action.                        |
1006
1007**Returns**
1008
1009Result code.
1010
1011**Since**
1012
101310
1014
1015
1016### OH_NativeXComponent_GetKeyEventCode()
1017
1018```
1019int32_t OH_NativeXComponent_GetKeyEventCode (OH_NativeXComponent_KeyEvent * keyEvent, OH_NativeXComponent_KeyCode * code )
1020```
1021
1022**Description**
1023
1024Obtains the key code of the specified key event.
1025
1026**Parameters**
1027
1028| Name      | Description                                    |
1029| -------- | -------------------------------------- |
1030| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.|
1031| code     | Pointer to the key code of the key event.                       |
1032
1033**Returns**
1034
1035Result code.
1036
1037**Since**
1038
103910
1040
1041
1042### OH_NativeXComponent_GetKeyEventDeviceId()
1043
1044```
1045int32_t OH_NativeXComponent_GetKeyEventDeviceId (OH_NativeXComponent_KeyEvent * keyEvent, int64_t * deviceId )
1046```
1047
1048**Description**
1049
1050Obtains the device ID of the specified key event.
1051
1052**Parameters**
1053
1054| Name      | Description                                    |
1055| -------- | -------------------------------------- |
1056| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.|
1057| deviceId | Pointer to the device ID of the key event.                      |
1058
1059**Returns**
1060
1061Result code.
1062
1063**Since**
1064
106510
1066
1067
1068### OH_NativeXComponent_GetKeyEventSourceType()
1069
1070```
1071int32_t OH_NativeXComponent_GetKeyEventSourceType (OH_NativeXComponent_KeyEvent * keyEvent, OH_NativeXComponent_EventSourceType * sourceType )
1072```
1073
1074**Description**
1075
1076Obtains the source type of the specified key event.
1077
1078**Parameters**
1079
1080| Name        | Description                                    |
1081| ---------- | -------------------------------------- |
1082| keyEvent   | Pointer to the **OH_NativeXComponent_KeyEvent** instance.|
1083| sourceType | Pointer to the source type of the key event.                     |
1084
1085**Returns**
1086
1087Result code.
1088
1089**Since**
1090
109110
1092
1093
1094### OH_NativeXComponent_GetKeyEventTimestamp()
1095
1096```
1097int32_t OH_NativeXComponent_GetKeyEventTimestamp (OH_NativeXComponent_KeyEvent * keyEvent, int64_t * timeStamp )
1098```
1099
1100**Description**
1101
1102Obtains the timestamp of the specified key event.
1103
1104**Parameters**
1105
1106| Name       | Description                                    |
1107| --------- | -------------------------------------- |
1108| keyEvent  | Pointer to the **OH_NativeXComponent_KeyEvent** instance.|
1109| timeStamp | Pointer to the timestamp of the key event.                       |
1110
1111**Returns**
1112
1113Result code.
1114
1115**Since**
1116
111710
1118
1119
1120### OH_NativeXComponent_GetHistoricalPoints()
1121
1122```
1123int32_t OH_NativeXComponent_GetHistoricalPoints (OH_NativeXComponent * component, const void * window, int32_t * size, OH_NativeXComponent_HistoricalPoint ** historicalPoints )
1124```
1125
1126**Description**
1127
1128Obtains the historical touch point data for the touch event of an **OH_NativeXComponent** instance. Some input devices report touch points at very high frequencies (up to 1 ms intervals). However, since UI updates typically do not require such high-frequency updates, the system consolidates touch events and reports them once per frame. All touch points collected during the current frame are preserved as historical touch points for applications that need direct access to this raw data.
1129
1130**Parameters**
1131
1132| Name        | Description                           |
1133| ---------- | ----------------------------- |
1134| component  | Pointer to the **OH_NativeXComponent** instance.|
1135| window     | Handle to the **NativeWindow** instance.             |
1136| size       | Length of the historical touch point array.     |
1137| historicalPoints | Pointer to the historical touch point array.               |
1138
1139**Returns**
1140
1141Result code.
1142
1143**Since**
1144
114510
1146
1147
1148### OH_NativeXComponent_GetMouseEvent()
1149
1150```
1151int32_t OH_NativeXComponent_GetMouseEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_MouseEvent * mouseEvent )
1152```
1153
1154**Description**
1155
1156Obtains the mouse event scheduled by the ArkUI XComponent.
1157
1158**Parameters**
1159
1160| Name        | Description                           |
1161| ---------- | ----------------------------- |
1162| component  | Pointer to the **OH_NativeXComponent** instance.|
1163| window     | Handle to the **NativeWindow** instance.             |
1164| mouseEvent | Pointer to the current mouse event.               |
1165
1166**Returns**
1167
1168Result code.
1169
1170**Since**
1171
11729
1173
1174### OH_NativeXComponent_GetNativeXComponent()
1175
1176```
1177OH_NativeXComponent* OH_NativeXComponent_GetNativeXComponent (ArkUI_NodeHandle node)
1178```
1179**Description**
1180
1181Obtains the pointer to an **OH_NativeXComponent** instance based on the specified component instance created by the native API.
1182
1183**Since**: 12
1184
1185**Parameters**
1186
1187| Name| Description|
1188| -------- | -------- |
1189| node | Pointer to the component instance created through the native API. |
1190
1191**Returns**
1192
1193Pointer to the **OH_NativeXComponent** instance.
1194
1195
1196### OH_NativeXComponent_GetTouchEvent()
1197
1198```
1199int32_t OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_TouchEvent * touchEvent )
1200```
1201
1202**Description**
1203
1204Obtains the touch event scheduled by the ArkUI XComponent.
1205
1206**Parameters**
1207
1208| Name        | Description                           |
1209| ---------- | ----------------------------- |
1210| component  | Pointer to the **OH_NativeXComponent** instance.|
1211| window     | Handle to the **NativeWindow** instance.            |
1212| touchEvent | Pointer to the current touch event.               |
1213
1214**Returns**
1215
1216Result code.
1217
1218**Since**
1219
12208
1221
1222
1223### OH_NativeXComponent_GetTouchPointTiltX()
1224
1225```
1226int32_t OH_NativeXComponent_GetTouchPointTiltX (OH_NativeXComponent * component, uint32_t pointIndex, float * tiltX )
1227```
1228
1229**Description**
1230
1231Obtains the angle between the Y-Z plane of the ArkUI XComponent touch point and the x-axis.
1232
1233**Parameters**
1234
1235| Name        | Description                           |
1236| ---------- | ----------------------------- |
1237| component  | Pointer to the **OH_NativeXComponent** instance.|
1238| pointIndex | Pointer to the index of the touch point.                  |
1239| tiltX      | Pointer to the angle between the Y-Z plane of the touch point and the x-axis.                 |
1240
1241**Returns**
1242
1243Result code.
1244
1245**Since**
1246
12479
1248
1249
1250### OH_NativeXComponent_GetTouchPointTiltY()
1251
1252```
1253int32_t OH_NativeXComponent_GetTouchPointTiltY (OH_NativeXComponent * component, uint32_t pointIndex, float * tiltY )
1254```
1255
1256**Description**
1257
1258Obtains the angle between the X-Z plane of the ArkUI XComponent touch point and the y-axis.
1259
1260**Parameters**
1261
1262| Name        | Description                           |
1263| ---------- | ----------------------------- |
1264| component  | Pointer to the **OH_NativeXComponent** instance.|
1265| pointIndex | Pointer to the index of the touch point.                  |
1266| tiltY      | Pointer to the angle between the X-Z plane of the touch point and the y-axis.                 |
1267
1268**Returns**
1269
1270Result code.
1271
1272**Since**
1273
12749
1275
1276
1277### OH_NativeXComponent_GetTouchPointWindowX()
1278
1279```
1280int32_t OH_NativeXComponent_GetTouchPointWindowX(OH_NativeXComponent * component, uint32_t pointIndex, float * windowX )
1281```
1282
1283**Description**
1284
1285Obtains the X coordinate of the touch point relative to the upper left corner of the application window where the ArkUI XComponent is located.
1286
1287**Parameters**
1288
1289| Name        | Description                           |
1290| ---------- | ----------------------------- |
1291| component  | Pointer to the **OH_NativeXComponent** instance.       |
1292| pointIndex | Pointer to the index of the touch point.                         |
1293| windowX    | Pointer to the X coordinate of the touch point relative to the upper left corner of the application window. |
1294
1295**Returns**
1296
1297Result code.
1298
1299**Since**
1300
130112
1302
1303
1304### OH_NativeXComponent_GetTouchPointWindowY()
1305
1306```
1307int32_t OH_NativeXComponent_GetTouchPointWindowY(OH_NativeXComponent * component, uint32_t pointIndex, float * windowY )
1308```
1309
1310**Description**
1311
1312Obtains the Y coordinate of the touch point relative to the upper left corner of the application window where the ArkUI XComponent is located.
1313
1314**Parameters**
1315
1316| Name        | Description                           |
1317| ---------- | ----------------------------- |
1318| component  | Pointer to the **OH_NativeXComponent** instance.       |
1319| pointIndex | Pointer to the index of the touch point.                         |
1320| windowY    | Pointer to the Y coordinate of the touch point relative to the upper left corner of the application window. |
1321
1322**Returns**
1323
1324Result code.
1325
1326**Since**
1327
132812
1329
1330
1331### OH_NativeXComponent_GetTouchPointDisplayX()
1332
1333```
1334int32_t OH_NativeXComponent_GetTouchPointDisplayX(OH_NativeXComponent * component, uint32_t pointIndex, float * displayX )
1335```
1336
1337**Description**
1338
1339Obtains the X coordinate of the touch point relative to the upper left corner of the screen where the ArkUI XComponent is located.
1340
1341**Parameters**
1342
1343| Name        | Description                           |
1344| ---------- | ----------------------------- |
1345| component  | Pointer to the **OH_NativeXComponent** instance.       |
1346| pointIndex | Pointer to the index of the touch point.                         |
1347| displayX    | Pointer to the X coordinate of the touch point relative to the upper left corner of the screen. |
1348
1349**Returns**
1350
1351Result code.
1352
1353**Since**
1354
135512
1356
1357
1358### OH_NativeXComponent_GetTouchPointDisplayY()
1359
1360```
1361int32_t OH_NativeXComponent_GetTouchPointDisplayY(OH_NativeXComponent * component, uint32_t pointIndex, float * displayY )
1362```
1363
1364**Description**
1365
1366Obtains the Y coordinate of the touch point relative to the upper left corner of the screen where the ArkUI XComponent is located.
1367
1368**Parameters**
1369
1370| Name        | Description                           |
1371| ---------- | ----------------------------- |
1372| component  | Pointer to the **OH_NativeXComponent** instance.       |
1373| pointIndex | Pointer to the index of the touch point.                         |
1374| displayY    | Pointer to the Y coordinate of the touch point relative to the upper left corner of the screen. |
1375
1376**Returns**
1377
1378Result code.
1379
1380**Since**
1381
138212
1383
1384
1385### OH_NativeXComponent_GetTouchPointToolType()
1386
1387```
1388int32_t OH_NativeXComponent_GetTouchPointToolType (OH_NativeXComponent * component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType * toolType )
1389```
1390
1391**Description**
1392
1393Obtains the ArkUI XComponent touch point tool type.
1394
1395**Parameters**
1396
1397| Name        | Description                           |
1398| ---------- | ----------------------------- |
1399| component  | Pointer to the **OH_NativeXComponent** instance.|
1400| pointIndex | Pointer to the index of the touch point.                  |
1401| toolType   | Pointer to the tool type.                 |
1402
1403**Returns**
1404
1405Result code.
1406
1407**Since**
1408
14099
1410
1411
1412### OH_NativeXComponent_GetXComponentId()
1413
1414```
1415int32_t OH_NativeXComponent_GetXComponentId (OH_NativeXComponent * component, char * id, uint64_t * size )
1416```
1417
1418**Description**
1419
1420Obtains the ID of ArkUI XComponent.
1421
1422**Parameters**
1423
1424| Name     | Description                                                        |
1425| --------- | ------------------------------------------------------------ |
1426| component | Pointer to the **OH_NativeXComponent** instance.                     |
1427| id        | Pointer to the character buffer for storing the ID of the **OH_NativeXComponent** instance. Note that null terminators will be 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. The recommended size is [OH_XCOMPONENT_ID_LEN_MAX + 1].|
1428| size      | Pointer to the length of the ID, used to receive the length information of the ID.                |
1429
1430**Returns**
1431
1432Result code.
1433
1434**Since**
1435
14368
1437
1438
1439### OH_NativeXComponent_GetXComponentOffset()
1440
1441```
1442int32_t OH_NativeXComponent_GetXComponentOffset (OH_NativeXComponent * component, const void * window, double * x, double * y )
1443```
1444
1445**Description**
1446
1447Obtains the offset of the surface held by the XComponent relative to the upper left corner of its parent component.
1448
1449**Parameters**
1450
1451| Name       | Description                           |
1452| --------- | ----------------------------- |
1453| component | Pointer to the **OH_NativeXComponent** instance.|
1454| window    | Handle to the **NativeWindow** instance.            |
1455| x         | Pointer to the X coordinate of the current surface relative to the upper left corner of the XComponent's parent component.        |
1456| y         | Pointer to the Y coordinate of the current surface relative to the upper left corner of the XComponent's parent component.        |
1457
1458**Returns**
1459
1460Result code.
1461
1462**Since**
1463
14648
1465
1466
1467### OH_NativeXComponent_GetXComponentSize()
1468
1469```
1470int32_t OH_NativeXComponent_GetXComponentSize (OH_NativeXComponent * component, const void * window, uint64_t * width, uint64_t * height )
1471```
1472
1473**Description**
1474
1475Obtains the size of the surface held by the ArkUI XComponent.
1476
1477**Parameters**
1478
1479| Name       | Description                           |
1480| --------- | ----------------------------- |
1481| component | Pointer to the **OH_NativeXComponent** instance.|
1482| window    | Handle to the **NativeWindow** instance.            |
1483| width     | Pointer to the width of the current surface.          |
1484| height    | Pointer to the height of the current surface.          |
1485
1486**Returns**
1487
1488Result code.
1489
1490**Since**
1491
14928
1493
1494
1495### OH_NativeXComponent_RegisterBlurEventCallback()
1496
1497```
1498int32_t OH_NativeXComponent_RegisterBlurEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window))
1499```
1500
1501**Description**
1502
1503Registers the blur event callback for this **OH_NativeXComponent** instance.
1504
1505**Parameters**
1506
1507| Name       | Description                           |
1508| --------- | ----------------------------- |
1509| component | Pointer to the **OH_NativeXComponent** instance.|
1510| callback  | Pointer to the blur event callback.<br> - **window**: handle to the **NativeWindow** instance.              |
1511
1512**Returns**
1513
1514Result code.
1515
1516**Since**
1517
151810
1519
1520
1521### OH_NativeXComponent_RegisterCallback()
1522
1523```
1524int32_t OH_NativeXComponent_RegisterCallback (OH_NativeXComponent * component, OH_NativeXComponent_Callback * callback )
1525```
1526
1527**Description**
1528
1529Registers a callback for this **OH_NativeXComponent** instance.
1530
1531**Parameters**
1532
1533| Name       | Description                           |
1534| --------- | ----------------------------- |
1535| component | Pointer to the **OH_NativeXComponent** instance.|
1536| callback  | Pointer to the surface lifecycle and touch event callback.   |
1537
1538**Returns**
1539
1540Result code.
1541
1542**Since**
1543
15448
1545
1546
1547### OH_NativeXComponent_RegisterFocusEventCallback()
1548
1549```
1550int32_t OH_NativeXComponent_RegisterFocusEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window))
1551```
1552
1553**Description**
1554
1555Registers the focus event callback for this **OH_NativeXComponent** instance.
1556
1557**Parameters**
1558
1559| Name       | Description                           |
1560| --------- | ----------------------------- |
1561| component | Pointer to the **OH_NativeXComponent** instance.|
1562| callback  | Pointer to the focus event callback.<br> - **window**: handle to the **NativeWindow** instance.              |
1563
1564**Returns**
1565
1566Result code.
1567
1568**Since**
1569
157010
1571
1572
1573### OH_NativeXComponent_RegisterKeyEventCallback()
1574
1575```
1576int32_t OH_NativeXComponent_RegisterKeyEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window))
1577```
1578
1579**Description**
1580
1581Registers the key event callback for this **OH_NativeXComponent** instance.
1582
1583**Parameters**
1584
1585| Name       | Description                           |
1586| --------- | ----------------------------- |
1587| component | Pointer to the **OH_NativeXComponent** instance.|
1588| callback  | Pointer to the key event callback.<br> - **window**: handle to the **NativeWindow** instance.              |
1589
1590**Returns**
1591
1592Result code.
1593
1594**Since**
1595
159610
1597
1598
1599### OH_NativeXComponent_RegisterKeyEventCallbackWithResult()
1600
1601```
1602int32_t OH_NativeXComponent_RegisterKeyEventCallbackWithResult (OH_NativeXComponent * component, bool(*callback)(OH_NativeXComponent *component, void *window))
1603```
1604
1605**Description**
1606
1607Registers a key event callback with a return value for this **OH_NativeXComponent** instance. The callback must return a result (**true** or **false**). If the callback returns **true**, the event will not be further propagated. If it returns **false**, the event will continue to be processed according to the normal event handling flow.
1608
1609**Parameters**
1610
1611| Name       | Description                           |
1612| --------- | ----------------------------- |
1613| component | Pointer to the **OH_NativeXComponent** instance.|
1614| callback  | Pointer to the key event callback.<br> - **window**: handle to the **NativeWindow** instance.|
1615
1616**Returns**
1617
1618Result code.
1619
1620**Since**
1621
162214
1623
1624
1625### OH_NativeXComponent_RegisterMouseEventCallback()
1626
1627```
1628int32_t OH_NativeXComponent_RegisterMouseEventCallback (OH_NativeXComponent * component, OH_NativeXComponent_MouseEvent_Callback * callback )
1629```
1630
1631**Description**
1632
1633Registers the mouse event callback for this **OH_NativeXComponent** instance.
1634
1635**Parameters**
1636
1637| Name       | Description                           |
1638| --------- | ----------------------------- |
1639| component | Pointer to the **OH_NativeXComponent** instance.|
1640| callback  | Pointer to the mouse event callback.               |
1641
1642**Returns**
1643
1644Result code.
1645
1646**Since**
1647
16489
1649
1650### OH_NativeXComponent_RegisterOnFrameCallback()
1651
1652```
1653int32_t OH_NativeXComponent_RegisterOnFrameCallback (OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent *component, uint64_t timestamp, uint64_t targetTimestamp))
1654```
1655**Description**
1656
1657Registers the display update callback for this **OH_NativeXComponent** instance and enables the callback for each frame.
1658
1659**Parameters**
1660
1661| Name| Description|
1662| -------- | -------- |
1663| component | Pointer to the **OH_NativeXComponent** instance. |
1664| callback | Pointer to the display update callback.<br> - **timestamp**: time when the current frame arrives, in nanoseconds.<br> - **targetTimestamp**: expected arrival time of the next frame, in nanoseconds.|
1665
1666**Returns**
1667
1668Result code.
1669
1670**Since**
1671
167211
1673
1674### OH_NativeXComponent_RegisterOnTouchInterceptCallback()
1675
1676```
1677int32_t OH_NativeXComponent_RegisterOnTouchInterceptCallback (OH_NativeXComponent * component, HitTestMode(*callback)(OH_NativeXComponent *component, ArkUI_UIInputEvent *event))
1678```
1679**Description**
1680
1681Registers a custom event intercept callback for an **OH_NativeXComponent** and enables the callback during the hit test.
1682UI input–related operations are not supported on event objects received through this callback. For full functionality, use the **NODE_ON_TOUCH_INTERCEPT** event on native nodes instead.
1683
1684**Since**: 12
1685
1686**Parameters**
1687
1688| Name| Description|
1689| -------- | -------- |
1690| component | Pointer to the **OH_NativeXComponent** instance. |
1691| callback | Pointer to the custom event intercept callback.<br> - **event**: pointer to the UI input event.|
1692
1693**Returns**
1694
1695**0**: The operation is successful.
1696**401**: Any parameter error occurs.
1697
1698### OH_NativeXComponent_RegisterUIInputEventCallback()
1699
1700```
1701int32_t OH_NativeXComponent_RegisterUIInputEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, ArkUI_UIInputEvent *event, ArkUI_UIInputEvent_Type type), ArkUI_UIInputEvent_Type type )
1702```
1703**Description**
1704
1705Registers a UI input event callback for an **OH_NativeXComponent** instance and enables the callback to be invoked when a UI input event is received. Currently, only axis events are supported.
1706
1707**Since**: 12
1708
1709**Parameters**
1710
1711| Name| Description|
1712| -------- | -------- |
1713| component | Pointer to the **OH_NativeXComponent** instance. |
1714| callback | Pointer to the UI input event callback.<br> - **event**: pointer to the UI input event. |
1715| type | Type of the current UI input event. |
1716
1717**Returns**
1718
1719Result code.
1720
1721### OH_NativeXComponent_SetExpectedFrameRateRange()
1722
1723```
1724int32_t OH_NativeXComponent_SetExpectedFrameRateRange (OH_NativeXComponent * component, OH_NativeXComponent_ExpectedRateRange * range )
1725```
1726**Description**
1727
1728Sets the expected frame rate range.
1729
1730**Parameters**
1731
1732| Name| Description|
1733| -------- | -------- |
1734| component | Pointer to the **OH_NativeXComponent** instance. |
1735| range | Pointer to the expected frame rate range.|
1736
1737**Returns**
1738
1739Result code.
1740
1741**Since**
1742
174311
1744
1745
1746### OH_NativeXComponent_UnregisterOnFrameCallback()
1747
1748```
1749int32_t OH_NativeXComponent_UnregisterOnFrameCallback (OH_NativeXComponent * component)
1750```
1751**Description**
1752
1753Deregisters the display update callback for this **OH_NativeXComponent** instance and disables the callback for each frame.
1754
1755**Parameters**
1756
1757| Name| Description|
1758| -------- | -------- |
1759| component | Pointer to the **OH_NativeXComponent** instance. |
1760
1761**Returns**
1762
1763Result code.
1764
1765**Since**
1766
176711
1768
1769### OH_NativeXComponent_SetNeedSoftKeyboard()
1770
1771```
1772int32_t OH_NativeXComponent_SetNeedSoftKeyboard(OH_NativeXComponent* component, bool isNeedSoftKeyboard)
1773```
1774
1775**Description**
1776
1777Sets whether the soft keyboard is required for an **OH_NativeXComponent** instance.
1778
1779**Parameters**
1780
1781| Name              | Description                                         |
1782| ------------------ | --------------------------------------------- |
1783| component          | Pointer to the **OH_NativeXComponent** instance.      |
1784| isNeedSoftKeyboard | Whether the soft keyboard is required for the **OH_NativeXComponent** instance.|
1785
1786**Returns**
1787
1788Result code.
1789
1790**Since**
1791
179212
1793
1794### OH_NativeXComponent_RegisterSurfaceShowCallback()
1795
1796```
1797int32_t OH_NativeXComponent_RegisterSurfaceShowCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window))
1798```
1799
1800**Description**
1801
1802Registers a surface display callback for an **OH_NativeXComponent** instance. The callback is invoked after the application is switched to the foreground.
1803
1804**Parameters**
1805
1806| Name       | Description                           |
1807| --------- | ----------------------------- |
1808| component | Pointer to the **OH_NativeXComponent** instance.|
1809| callback  | Pointer to the surface display callback.<br> - **window**: handle to the **NativeWindow** instance.              |
1810
1811**Returns**
1812
1813Result code.
1814
1815**Since**
1816
181712
1818
1819### OH_NativeXComponent_RegisterSurfaceHideCallback()
1820
1821```
1822int32_t OH_NativeXComponent_RegisterSurfaceHideCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window))
1823```
1824
1825**Description**
1826
1827Registers a surface hiding callback for an **OH_NativeXComponent** instance. The callback is invoked after the application is switched to the background.
1828
1829**Parameters**
1830
1831| Name       | Description                           |
1832| --------- | ----------------------------- |
1833| component | Pointer to the **OH_NativeXComponent** instance.|
1834| callback  | Pointer to the surface hiding callback.<br> - **window**: handle to the **NativeWindow** instance.              |
1835
1836**Returns**
1837
1838Result code.
1839
1840**Since**
1841
184212
1843
1844### OH_NativeXComponent_GetTouchEventSourceType()
1845
1846```
1847int32_t OH_NativeXComponent_GetTouchEventSourceType (OH_NativeXComponent* component, int32_t pointId, OH_NativeXComponent_EventSourceType* sourceType)
1848```
1849
1850**Description**
1851
1852Obtains the touch event source type of an **OH_NativeXComponent** instance.
1853
1854**Parameters**
1855
1856| Name       | Description                           |
1857| --------- | ----------------------------- |
1858| component | Pointer to the **OH_NativeXComponent** instance.|
1859| pointId  | ID of the touch point.<br>**NOTE**<br>The touch event source type can be correctly returned only when the ID passed in is the ID of the touch point that triggers the touch event. Otherwise, **OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER** is returned.|
1860| sourceType  | Pointer to the touch event source type.|
1861
1862**Returns**
1863
1864**OH_NATIVEXCOMPONENT_RESULT_SUCCESS**: The operation is successful.
1865
1866**OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER**: A parameter error occurs.
1867
1868**OH_NATIVEXCOMPONENT_RESULT_FAILED**: Any other error occurs.
1869
1870**Since**
1871
187212
1873
1874### OH_NativeXComponent_GetNativeAccessibilityProvider()
1875
1876```
1877int32_t OH_NativeXComponent_GetNativeAccessibilityProvider(
1878    OH_NativeXComponent* component, ArkUI_AccessibilityProvider** handle)
1879```
1880
1881**Description**
1882
1883Obtains the accessibility provider handle for an ArkUI XComponent.
1884
1885**Parameters**
1886
1887| Name     | Description                                   |
1888| --------- | --------------------------------------- |
1889| component | Pointer to the **OH_NativeXComponent** instance.|
1890| handle    | Pointer to an **ArkUI_AccessibilityProvider** instance.               |
1891
1892**Returns**
1893
1894**OH_NATIVEXCOMPONENT_RESULT_SUCCESS**: The operation is successful.
1895
1896**OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER**: A parameter error occurs.
1897
1898**OH_NATIVEXCOMPONENT_RESULT_FAILED**: Any other error occurs.
1899
1900**Since**
1901
190213
1903
1904### OH_ArkUI_XComponent_StartImageAnalyzer()
1905
1906```
1907int32_t OH_ArkUI_XComponent_StartImageAnalyzer(ArkUI_NodeHandle node, void* userData,
1908    void (*callback)(ArkUI_NodeHandle node, ArkUI_XComponent_ImageAnalyzerState statusCode, void* userData))
1909```
1910
1911**Description**
1912
1913Starts AI image analysis for this XComponent instance. Before calling this API, make sure the AI image analyzer is enabled.
1914
1915**Since**
1916
191718
1918
1919**Parameters**
1920
1921| Name     | Description                                   |
1922| --------- | --------------------------------------- |
1923| node | XComponent instance.|
1924| userData    | Pointer to the data that you need to obtain when the callback function is executed.               |
1925|callback| Callback function triggered when the AI image analysis status is updated.<br> - **statusCode**: one of the input parameters of the callback function, indicating the current image analysis status.|
1926
1927> **NOTE**
1928>
1929> The AI image analysis process initiated by this API is executed asynchronously. The return of the API does not indicate that the AI image analysis has produced results.
1930>
1931> When this API is called, it captures the frame at the moment of the call for analysis. Care should be taken to choose the right timing to start the analysis to avoid inconsistencies between the captured frame and the analysis content.
1932>
1933> When the AI image analysis status is updated, the passed callback function will be triggered.
1934
1935**Returns**
1936
1937[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
1938
1939[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
1940
1941### OH_ArkUI_XComponent_StopImageAnalyzer()
1942
1943```
1944int32_t OH_ArkUI_XComponent_StopImageAnalyzer(ArkUI_NodeHandle node)
1945```
1946
1947**Description**
1948
1949Stops AI image analysis for this XComponent instance.
1950
1951**Since**
1952
195318
1954
1955**Parameters**
1956
1957| Name     | Description                                   |
1958| --------- | --------------------------------------- |
1959| node | XComponent instance.|
1960
1961> **NOTE**
1962>
1963> After AI image analysis is stopped, the content displayed as a result of the image AI analysis will be destroyed.
1964
1965**Returns**
1966
1967[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
1968
1969[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
1970
1971### OH_ArkUI_SurfaceCallback_Create()
1972
1973```
1974OH_ArkUI_SurfaceCallback* OH_ArkUI_SurfaceCallback_Create()
1975```
1976
1977**Description**
1978
1979Creates an [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) object.
1980
1981**Since**
1982
198319
1984
1985**Returns**
1986
1987Pointer to the created [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) object.
1988
1989### OH_ArkUI_SurfaceCallback_Dispose()
1990
1991```
1992void OH_ArkUI_SurfaceCallback_Dispose(OH_ArkUI_SurfaceCallback* callback)
1993```
1994
1995**Description**
1996
1997Disposes of an [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) object.
1998
1999**Since**
2000
200119
2002
2003**Parameters**
2004
2005| Name     | Description                                   |
2006| --------- | --------------------------------------- |
2007| callback | Pointer to the [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) object to be disposed of.|
2008
2009### OH_ArkUI_SurfaceHolder_Create()
2010
2011```
2012OH_ArkUI_SurfaceHolder* OH_ArkUI_SurfaceHolder_Create(ArkUI_NodeHandle node)
2013```
2014
2015**Description**
2016
2017Creates an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) object for an XComponent.
2018
2019**Since**
2020
202119
2022
2023**Parameters**
2024
2025| Name     | Description                                   |
2026| --------- | --------------------------------------- |
2027| node | Pointer to the XComponent instance created through the native API. |
2028
2029**Returns**
2030
2031Pointer to the created [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) object.
2032
2033### OH_ArkUI_SurfaceHolder_Dispose()
2034
2035```
2036void OH_ArkUI_SurfaceHolder_Dispose(OH_ArkUI_SurfaceHolder* surfaceHolder)
2037```
2038
2039**Description**
2040
2041Disposes of an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) object.
2042
2043**Since**
2044
204519
2046
2047**Parameters**
2048
2049| Name     | Description                                   |
2050| --------- | --------------------------------------- |
2051| surfaceHolder |  Pointer to the [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance to be disposed of.|
2052
2053### OH_ArkUI_SurfaceHolder_SetUserData()
2054
2055```
2056int32_t OH_ArkUI_SurfaceHolder_SetUserData(OH_ArkUI_SurfaceHolder* surfaceHolder, void* userData)
2057```
2058
2059**Description**
2060
2061Stores custom data in an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.
2062
2063**Since**
2064
206519
2066
2067**Parameters**
2068
2069| Name     | Description                                   |
2070| --------- | --------------------------------------- |
2071| surfaceHolder |  Pointer to the [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance where the custom data will be stored.|
2072| userData |  Pointer to the custom data to be stored.|
2073
2074**Returns**
2075
2076[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2077
2078[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2079
2080### OH_ArkUI_SurfaceHolder_GetUserData()
2081
2082```
2083void* OH_ArkUI_SurfaceHolder_GetUserData(OH_ArkUI_SurfaceHolder* surfaceHolder);
2084```
2085
2086**Description**
2087
2088Obtains the custom data stored in an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.
2089
2090**Since**
2091
209219
2093
2094**Parameters**
2095
2096| Name     | Description                                   |
2097| --------- | --------------------------------------- |
2098| surfaceHolder |  Pointer to the [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance where the custom data is stored.|
2099
2100**Returns**
2101
2102Custom data.
2103
2104### OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent()
2105
2106```
2107void OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent(OH_ArkUI_SurfaceCallback* callback, void (*onSurfaceCreated)(OH_ArkUI_SurfaceHolder* surfaceHolder))
2108```
2109
2110**Description**
2111
2112Sets the creation callback event in the surface lifecycle callback.
2113
2114**Since**
2115
211619
2117
2118**Parameters**
2119
2120| Name     | Description                                   |
2121| --------- | --------------------------------------- |
2122| callback |  Pointer to the surface lifecycle callback.|
2123| onSurfaceCreated |  Callback event triggered when the surface is created.<br> - **surfaceHolder**: pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.|
2124
2125### OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent()
2126
2127```
2128void OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent(OH_ArkUI_SurfaceCallback* callback, void (*onSurfaceChanged)(OH_ArkUI_SurfaceHolder* surfaceHolder, uint64_t width, uint64_t height))
2129```
2130
2131**Description**
2132
2133Sets the size change callback event in the surface lifecycle callback.
2134
2135**Since**
2136
213719
2138
2139**Parameters**
2140
2141| Name     | Description                                   |
2142| --------- | --------------------------------------- |
2143| callback |  Pointer to the surface lifecycle callback.|
2144| onSurfaceChanged |  Callback event triggered when the surface size changes. <br> - **surfaceHolder**: pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.<br> - **width**: new width of the surface after the size change.<br> - **height**: new height of the surface after the size change.|
2145
2146### OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent()
2147
2148```
2149void OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent(OH_ArkUI_SurfaceCallback* callback, void (*onSurfaceDestroyed)(OH_ArkUI_SurfaceHolder* surfaceHolder))
2150```
2151
2152**Description**
2153
2154Sets the destruction callback event in the surface lifecycle callback.
2155
2156**Since**
2157
215819
2159
2160**Parameters**
2161
2162| Name     | Description                                   |
2163| --------- | --------------------------------------- |
2164| callback |  Pointer to the surface lifecycle callback.|
2165| onSurfaceDestroyed |  Callback event triggered when the surface is destroyed.<br> - **surfaceHolder**: pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.|
2166
2167### OH_ArkUI_SurfaceHolder_AddSurfaceCallback()
2168
2169```
2170int32_t OH_ArkUI_SurfaceHolder_AddSurfaceCallback(OH_ArkUI_SurfaceHolder* surfaceHolder, OH_ArkUI_SurfaceCallback* callback)
2171```
2172
2173**Description**
2174
2175Adds a surface lifecycle callback to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.
2176
2177**Since**
2178
217919
2180
2181**Parameters**
2182
2183| Name     | Description                                   |
2184| --------- | --------------------------------------- |
2185| surfaceHolder |  Pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.|
2186| callback |  Pointer to the new callback.|
2187
2188**Returns**
2189
2190[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2191
2192[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2193
2194### OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback()
2195
2196```
2197int32_t OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback(OH_ArkUI_SurfaceHolder* surfaceHolder, OH_ArkUI_SurfaceCallback* callback)
2198```
2199
2200**Description**
2201
2202Removes a previously added surface lifecycle callback from an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.
2203
2204**Since**
2205
220619
2207
2208**Parameters**
2209
2210| Name     | Description                                   |
2211| --------- | --------------------------------------- |
2212| surfaceHolder |  Pointer to the [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance from which the callback will be removed.|
2213| callback |  Pointer to the callback to be removed.|
2214
2215**Returns**
2216
2217[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2218
2219[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2220
2221### OH_ArkUI_XComponent_GetNativeWindow()
2222
2223```
2224OHNativeWindow* OH_ArkUI_XComponent_GetNativeWindow(OH_ArkUI_SurfaceHolder* surfaceHolder)
2225```
2226
2227**Description**
2228
2229Obtains the **NativeWindow** instance associated with an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.
2230
2231**Since**
2232
223319
2234
2235**Parameters**
2236
2237| Name     | Description                                   |
2238| --------- | --------------------------------------- |
2239| surfaceHolder |  Pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.|
2240
2241**Returns**
2242
2243NativeWindow associated with the **OH_ArkUI_SurfaceHolder** instance.
2244
2245### OH_ArkUI_XComponent_SetAutoInitialize()
2246
2247```
2248int32_t OH_ArkUI_XComponent_SetAutoInitialize(ArkUI_NodeHandle node, bool autoInitialize)
2249```
2250
2251**Description**
2252
2253Sets whether the **XComponent** component needs to automatically initialize the surface.
2254
2255**Since**
2256
225719
2258
2259**Parameters**
2260
2261| Name     | Description                                   |
2262| --------- | --------------------------------------- |
2263| node |  Pointer to the **XComponent** component instance.|
2264| autoInitialize |  Whether the XComponent needs to automatically initialize the surface. If **autoInitialize** is **true**, the **OnSurfaceCreated** callback will be triggered when the component is attached to the tree, and the **OnSurfaceDestroyed** callback will be triggered when the component is detached from the tree. The default value of **autoInitialize** is **true**.|
2265
2266**Returns**
2267
2268[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2269
2270[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2271
2272### OH_ArkUI_XComponent_Initialize()
2273
2274```
2275int32_t OH_ArkUI_XComponent_Initialize(ArkUI_NodeHandle node)
2276```
2277
2278**Description**
2279
2280Initializes the surface held by the **XComponent** component.
2281
2282**Since**
2283
228419
2285
2286**Parameters**
2287
2288| Name     | Description                                   |
2289| --------- | --------------------------------------- |
2290| node |  Pointer to the **XComponent** component instance.|
2291
2292**Returns**
2293
2294[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2295
2296[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2297
2298[ARKUI_ERROR_CODE_XCOMPONENT_STATE_INVALID](_ark_u_i___native_module.md#arkui_errorcode): The surface held by the **XComponent** component has been initialized.
2299
2300### OH_ArkUI_XComponent_Finalize()
2301
2302```
2303int32_t OH_ArkUI_XComponent_Finalize(ArkUI_NodeHandle node)
2304```
2305
2306**Description**
2307
2308Destroys the surface held by the **XComponent** component.
2309
2310**Since**
2311
231219
2313
2314**Parameters**
2315
2316| Name     | Description                                   |
2317| --------- | --------------------------------------- |
2318| node |  Pointer to the **XComponent** component instance.|
2319
2320**Returns**
2321
2322[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2323
2324[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2325
2326[ARKUI_ERROR_CODE_XCOMPONENT_STATE_INVALID](_ark_u_i___native_module.md#arkui_errorcode): The surface held by the **XComponent** component has been destroyed.
2327
2328### OH_ArkUI_XComponent_IsInitialized()
2329
2330```
2331int32_t OH_ArkUI_XComponent_IsInitialized(ArkUI_NodeHandle node, bool* isInitialized)
2332```
2333
2334**Description**
2335
2336Checks whether the surface held by the **XComponent** component is initialized.
2337
2338**Since**
2339
234019
2341
2342**Parameters**
2343
2344| Name     | Description                                   |
2345| --------- | --------------------------------------- |
2346| node |  Pointer to the **XComponent** component instance.|
2347| isInitialized |  Whether the surface held by the **XComponent** component is initialized.|
2348
2349**Returns**
2350
2351[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2352
2353[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2354
2355### OH_NativeXComponent_GetExtraMouseEventInfo()
2356
2357```
2358int32_t OH_NativeXComponent_GetExtraMouseEventInfo(OH_NativeXComponent* component, OH_NativeXComponent_ExtraMouseEventInfo** extraMouseEventInfo)
2359```
2360
2361**Description**
2362
2363Obtains extended mouse event information from an [OH_NativeXComponent](#oh_nativexcomponent) instance.
2364
2365**Since**
2366
236720
2368
2369**Parameters**
2370
2371| Name| Description|
2372| -------- | -------- |
2373| component | Pointer to the [OH_NativeXComponent](#oh_nativexcomponent) instance. |
2374| extraMouseEventInfo | Address of a pointer to the [OH_NativeXComponent_ExtraMouseEventInfo](#oh_nativexcomponent_extramouseeventinfo) type. |
2375
2376> **NOTE**
2377>
2378> This API must be called within the scope of the mouse event callback function. Do not call this API or use the **OH_NativeXComponent_ExtraMouseEventInfo** instance outside the scope of the mouse event callback.
2379>
2380> The pointer to the **OH_NativeXComponent_ExtraMouseEventInfo** type obtained through this API must not be destroyed using the **delete** statement.
2381>
2382> Passing a null pointer for either the **component** or **extraMouseEventInfo** parameter is considered an invalid input.
2383
2384**Returns**
2385
2386[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2387
2388[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2389
2390### OH_NativeXComponent_GetMouseEventModifierKeyStates()
2391
2392```
2393int32_t OH_NativeXComponent_GetMouseEventModifierKeyStates(OH_NativeXComponent_ExtraMouseEventInfo* extraMouseEventInfo, uint64_t* keys)
2394```
2395
2396**Description**
2397
2398Obtains the state of modifier keys from an [OH_NativeXComponent_ExtraMouseEventInfo](#oh_nativexcomponent_extramouseeventinfo) instance.
2399
2400**Since**
2401
240220
2403
2404**Parameters**
2405
2406| Name| Description|
2407| -------- | -------- |
2408| extraMouseEventInfo | Pointer to the extended mouse event information instance. |
2409| keys | Address of a 64-bit unsigned integer to receive the modifier key press state information. |
2410
2411> **NOTE**
2412>
2413> This API can be used to obtain the press state of the **Ctrl**, **Shift**, and **Alt** keys.
2414>
2415> The modifier key press state information obtained through this API is stored in a 64-bit unsigned integer. To determine the state of a specific modifier key, perform a bitwise AND (&) operation between the 64-bit unsigned integer and the enumerated values of the [ArkUI_ModifierKeyName](./_ark_u_i___event_module.md#arkui_modifierkeyname) type. A result of **0** indicates that the modifier key is not pressed, while a result of **1** indicates that the modifier key is pressed. For example, using the **ARKUI_MODIFIER_KEY_CTRL** enumerated value with the obtained **keys** value through the AND (&) operation allows you to obtain the press state of the **Ctrl** key.
2416>
2417> Passing a null pointer for either the **component** or **keys** parameter is considered an invalid input.
2418
2419**Returns**
2420
2421[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2422
2423[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2424
2425### OH_NativeXComponent_GetKeyEventModifierKeyStates()
2426
2427```
2428int32_t OH_NativeXComponent_GetKeyEventModifierKeyStates(OH_NativeXComponent_KeyEvent* keyEvent, uint64_t* keys)
2429```
2430
2431**Description**
2432
2433Obtains the state of modifier keys from a key event.
2434
2435**Since**
2436
243720
2438
2439**Parameters**
2440
2441| Name| Description|
2442| -------- | -------- |
2443| keyEvent | Pointer to the key event. |
2444| keys | Address of a 64-bit unsigned integer to receive the modifier key press state information. |
2445
2446> **NOTE**
2447>
2448> The modifier key press state information obtained through this API is stored in a 64-bit unsigned integer. To determine the state of a specific modifier key, perform a bitwise AND (&) operation between the 64-bit unsigned integer and the enumerated values of the [ArkUI_ModifierKeyName](./_ark_u_i___event_module.md#arkui_modifierkeyname) type. A result of **0** indicates that the modifier key is not pressed, while a result of **1** indicates that the modifier key is pressed.
2449>
2450> Passing a null pointer for either the **keyEvent** or **keys** parameter is considered an invalid input.
2451
2452**Returns**
2453
2454[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2455
2456[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2457
2458### OH_NativeXComponent_GetKeyEventNumLockState()
2459
2460```
2461int32_t OH_NativeXComponent_GetKeyEventNumLockState(OH_NativeXComponent_KeyEvent* keyEvent, bool* isNumLockOn)
2462```
2463
2464**Description**
2465
2466Obtains the state of the NumLock key from a key event.
2467
2468**Since**
2469
247020
2471
2472**Parameters**
2473
2474| Name| Description|
2475| -------- | -------- |
2476| keyEvent | Pointer to the key event. |
2477| isNumLockOn | Address of a boolean variable to receive the state of the NumLock key. |
2478
2479> **NOTE**
2480>
2481> The state of the NumLock key is stored in a boolean variable. The value **true** means that the NumLock key is active, and **false** means the opposite.
2482>
2483> Passing a null pointer for either the **keyEvent** or **isNumLockOn** parameter is considered an invalid input.
2484
2485**Returns**
2486
2487[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2488
2489[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2490
2491### OH_NativeXComponent_GetKeyEventCapsLockState()
2492
2493```
2494int32_t OH_NativeXComponent_GetKeyEventCapsLockState(OH_NativeXComponent_KeyEvent* keyEvent, bool* isCapsLockOn)
2495```
2496
2497**Description**
2498
2499Obtains the state of the CapsLock key from a key event.
2500
2501**Since**
2502
250320
2504
2505**Parameters**
2506
2507| Name| Description|
2508| -------- | -------- |
2509| keyEvent | Pointer to the key event. |
2510| isCapsLockOn | Address of a boolean variable to receive the state of the CapsLock key. |
2511
2512> **NOTE**
2513>
2514> The state of the CapsLock key is stored in a boolean variable. The value **true** means that the CapsLock key is active, and **false** means the opposite.
2515>
2516> Passing a null pointer for either the **keyEvent** or **isCapsLockOn** parameter is considered an invalid input.
2517
2518**Returns**
2519
2520[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2521
2522[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2523
2524### OH_NativeXComponent_GetKeyEventScrollLockState()
2525
2526```
2527int32_t OH_NativeXComponent_GetKeyEventScrollLockState(OH_NativeXComponent_KeyEvent* keyEvent, bool* isScrollLockOn)
2528```
2529
2530**Description**
2531
2532Obtains the state of the ScrollLock key from a key event.
2533
2534**Since**
2535
253620
2537
2538**Parameters**
2539
2540| Name| Description|
2541| -------- | -------- |
2542| keyEvent | Pointer to the key event. |
2543| isScrollLockOn | Address of a boolean variable to receive the state of the ScrollLock key. |
2544
2545> **NOTE**
2546>
2547> The state of the ScrollLock key is stored in a boolean variable. The value **true** means that the ScrollLock key is active, and **false** means the opposite.
2548>
2549> Passing a null pointer for either the **keyEvent** or **isScrollLockOn** parameter is considered an invalid input.
2550
2551**Returns**
2552
2553[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2554
2555[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2556
2557### OH_ArkUI_XComponent_SetExpectedFrameRateRange()
2558
2559```
2560int32_t OH_ArkUI_XComponent_SetExpectedFrameRateRange(
2561    ArkUI_NodeHandle node, OH_NativeXComponent_ExpectedRateRange range)
2562```
2563
2564**Description**
2565
2566Sets the expected frame rate range for the XComponent.
2567
2568**Since**
2569
257020
2571
2572**Parameters**
2573
2574| Name| Description|
2575| -------- | -------- |
2576| node | XComponent instance. |
2577| range | Expected frame rate information object of the [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) type. |
2578
2579> **NOTE**
2580>
2581> The XComponent instance passed to this API must be created using the [ArkUI NDK API](../../ui/ndk-access-the-arkts-page.md) or constructed through [NativeXComponentParameters](./arkui-ts/ts-basic-components-xcomponent.md#nativexcomponentparameters19).
2582>
2583> For the [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) object:<br>- The value of the [min](#min) member must be less than or equal to the value of the [max](#max) member.<br>- The value of the [expected](#expected) member must be greater than or equal to the value of the [min](#min) member and less than or equal to the value of the [max](#max) member.
2584
2585**Returns**
2586
2587[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2588
2589[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2590
2591### OH_ArkUI_XComponent_RegisterOnFrameCallback()
2592
2593```
2594int32_t OH_ArkUI_XComponent_RegisterOnFrameCallback(ArkUI_NodeHandle node,
2595    void (*callback)(ArkUI_NodeHandle node, uint64_t timestamp, uint64_t targetTimestamp))
2596```
2597
2598**Description**
2599
2600Registers a frame callback function for the XComponent.
2601
2602**Since**
2603
260420
2605
2606**Parameters**
2607
2608| Name| Description|
2609| -------- | -------- |
2610| node | XComponent instance. |
2611| callback | Pointer to the frame callback function.<br> - **timestamp**: time when the current frame arrives, in nanoseconds.<br> - **targetTimestamp**: expected arrival time of the next frame, in nanoseconds.   |
2612
2613> **NOTE**
2614>
2615> The XComponent instance passed to this API must be created using the [ArkUI NDK API](../../ui/ndk-access-the-arkts-page.md) or constructed through [NativeXComponentParameters](./arkui-ts/ts-basic-components-xcomponent.md#nativexcomponentparameters19).
2616
2617**Returns**
2618
2619[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2620
2621[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2622
2623### OH_ArkUI_XComponent_UnregisterOnFrameCallback()
2624
2625```
2626int32_t OH_ArkUI_XComponent_UnregisterOnFrameCallback(ArkUI_NodeHandle node)
2627```
2628
2629**Description**
2630
2631Unregisters the frame callback function for the XComponent.
2632
2633**Since**
2634
263520
2636
2637**Parameters**
2638
2639| Name| Description|
2640| -------- | -------- |
2641| node | XComponent instance. |
2642
2643> **NOTE**
2644>
2645> The XComponent instance passed to this API must be created using the [ArkUI NDK API](../../ui/ndk-access-the-arkts-page.md) or constructed through [NativeXComponentParameters](./arkui-ts/ts-basic-components-xcomponent.md#nativexcomponentparameters19).
2646
2647**Returns**
2648
2649[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2650
2651[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2652
2653### OH_ArkUI_XComponent_SetNeedSoftKeyboard()
2654
2655```
2656int32_t OH_ArkUI_XComponent_SetNeedSoftKeyboard(ArkUI_NodeHandle node, bool needSoftKeyboard)
2657```
2658
2659**Description**
2660
2661Sets whether the soft keyboard is required for the XComponent.
2662
2663**Since**
2664
266520
2666
2667**Parameters**
2668
2669| Name| Description|
2670| -------- | -------- |
2671| node | XComponent instance. |
2672|needSoftKeyboard|Whether the soft keyboard is required.|
2673
2674> **NOTE**
2675>
2676> The XComponent instance passed to this API must be created using the [ArkUI NDK API](../../ui/ndk-access-the-arkts-page.md) or constructed through [NativeXComponentParameters](./arkui-ts/ts-basic-components-xcomponent.md#nativexcomponentparameters19).
2677>
2678> The default value of **needSoftKeyboard** of the XComponent is **false**.
2679
2680**Returns**
2681
2682[ARKUI_ERROR_CODE_NO_ERROR](_ark_u_i___native_module.md#arkui_errorcode): The operation is successful.
2683
2684[ARKUI_ERROR_CODE_PARAM_INVALID](_ark_u_i___native_module.md#arkui_errorcode): A parameter error occurs.
2685
2686### OH_ArkUI_AccessibilityProvider_Create()
2687
2688```
2689ArkUI_AccessibilityProvider* OH_ArkUI_AccessibilityProvider_Create(ArkUI_NodeHandle node)
2690```
2691
2692**Description**
2693
2694Creates an [ArkUI_AccessibilityProvider](arkui_native_interface_accessibility.md#arkui_accessibilityprovider) instance for the XComponent.
2695
2696**Since**
2697
269820
2699
2700**Parameters**
2701
2702| Name| Description|
2703| -------- | -------- |
2704| node | XComponent instance. |
2705
2706> **NOTE**
2707>
2708> The XComponent instance passed to this API must be created using the [ArkUI NDK API](../../ui/ndk-access-the-arkts-page.md) or constructed through [NativeXComponentParameters](./arkui-ts/ts-basic-components-xcomponent.md#nativexcomponentparameters19).
2709
2710**Returns**
2711
2712Pointer of the [ArkUI_AccessibilityProvider](arkui_native_interface_accessibility.md#arkui_accessibilityprovider) type.
2713
2714### OH_ArkUI_AccessibilityProvider_Dispose()
2715
2716```
2717void OH_ArkUI_AccessibilityProvider_Dispose(ArkUI_AccessibilityProvider* provider)
2718```
2719
2720**Description**
2721
2722Destroys the [ArkUI_AccessibilityProvider](arkui_native_interface_accessibility.md#arkui_accessibilityprovider) instance created using [OH_ArkUI_AccessibilityProvider_Create](#oh_arkui_accessibilityprovider_create).
2723
2724**Since**
2725
272620
2727
2728**Parameters**
2729
2730| Name| Description|
2731| -------- | -------- |
2732| provider | [ArkUI_AccessibilityProvider](arkui_native_interface_accessibility.md#arkui_accessibilityprovider) instance created using [OH_ArkUI_AccessibilityProvider_Create](#oh_arkui_accessibilityprovider_create). |
2733
2734### OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent()
2735
2736```
2737void OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent(
2738    OH_ArkUI_SurfaceCallback* callback,
2739    void (*onSurfaceShow)(OH_ArkUI_SurfaceHolder* surfaceHolder))
2740```
2741
2742**Description**
2743
2744Sets a surface display callback for this [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) instance. The callback is invoked when the application window has returned to the foreground from the background.
2745
2746**Since**
2747
274820
2749
2750**Parameters**
2751
2752| Name| Description|
2753| -------- | -------- |
2754| callback | Pointer to the [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) instance.|
2755|onSurfaceShow|Pointer to the surface display callback.<br> - **surfaceHolder**: pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.|
2756
2757### OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent()
2758
2759```
2760void OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent(
2761    OH_ArkUI_SurfaceCallback* callback,
2762    void (*onSurfaceHide)(OH_ArkUI_SurfaceHolder* surfaceHolder))
2763```
2764
2765**Description**
2766
2767Sets a surface hiding callback for this [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) instance. The callback is invoked when the application window has entered the background from the foreground.
2768
2769**Since**
2770
277120
2772
2773**Parameters**
2774
2775| Name| Description|
2776| -------- | -------- |
2777| callback | Pointer to the [OH_ArkUI_SurfaceCallback](#oh_arkui_surfacecallback) instance.|
2778|onSurfaceHide|Pointer to the surface hiding callback.<br> - **surfaceHolder**: pointer to an [OH_ArkUI_SurfaceHolder](#oh_arkui_surfaceholder) instance.|
2779
2780<!--  -->
2781
2782## Variable Description
2783
2784
2785### OH_XCOMPONENT_ID_LEN_MAX
2786
2787```
2788const uint32_t OH_XCOMPONENT_ID_LEN_MAX = 128
2789```
2790
2791
2792**Description**
2793
2794
2795Maximum length of the ArkUI XComponent ID.
2796
2797
2798**Since**
2799
2800
28018
2802
2803
2804### OH_MAX_TOUCH_POINTS_NUMBER
2805
2806```
2807const uint32_t OH_MAX_TOUCH_POINTS_NUMBER = 10
2808```
2809
2810**Description**
2811
2812Maximum number of identifiable touch points in a touch event.
2813
2814**Since**
2815
28168
2817
2818
2819### action
2820
2821```
2822OH_NativeXComponent_MouseEventAction OH_NativeXComponent_MouseEvent::action
2823```
2824
2825**Description**
2826
2827Action of the mouse event.
2828
2829**Since**
2830
28318
2832
2833
2834### button
2835
2836```
2837OH_NativeXComponent_MouseEventButton OH_NativeXComponent_MouseEvent::button
2838```
2839
2840**Description**
2841
2842Mouse event button.
2843
2844**Since**
2845
28468
2847
2848
2849### deviceId
2850
2851```
2852int64_t OH_NativeXComponent_TouchEvent::deviceId = 0
2853```
2854
2855**Description**
2856
2857ID of the device where the current touch event is triggered.
2858
2859**Since**
2860
28618
2862
2863
2864### DispatchHoverEvent
2865
2866```
2867void(* OH_NativeXComponent_MouseEvent_Callback::DispatchHoverEvent) (OH_NativeXComponent *component, bool isHover)
2868```
2869
2870**Description**
2871
2872Invoked when a hover event is triggered.
2873
2874**Parameters**
2875
2876| Name       | Description                           |
2877| --------- | ----------------------------- |
2878| component | Pointer to the **OH_NativeXComponent** instance.|
2879| isHover  | Whether the mouse pointer or stylus is hovering over the component.<br>**true**: The mouse pointer or stylus has entered the component.<br>**false**: The mouse pointer or stylus has left the component.|
2880
2881**Since**
2882
28838
2884
2885
2886### DispatchMouseEvent
2887
2888```
2889void(* OH_NativeXComponent_MouseEvent_Callback::DispatchMouseEvent) (OH_NativeXComponent *component, void *window)
2890```
2891
2892**Description**
2893
2894Invoked when a mouse event is triggered.
2895
2896**Parameters**
2897
2898| Name       | Description                           |
2899| --------- | ----------------------------- |
2900| component | Pointer to the **OH_NativeXComponent** instance.|
2901| window  | Handle to the **NativeWindow** instance.             |
2902
2903**Since**
2904
29058
2906
2907
2908### DispatchTouchEvent
2909
2910```
2911void(* OH_NativeXComponent_Callback::DispatchTouchEvent) (OH_NativeXComponent *component, void *window)
2912```
2913
2914**Description**
2915
2916Invoked when a touch event is triggered.
2917
2918**Parameters**
2919
2920| Name       | Description                           |
2921| --------- | ----------------------------- |
2922| component | Pointer to the **OH_NativeXComponent** instance.|
2923| window  | Handle to the **NativeWindow** instance.             |
2924
2925**Since**
2926
29278
2928
2929
2930### force [1/3]
2931
2932```
2933float OH_NativeXComponent_TouchPoint::force = 0.0
2934```
2935
2936**Description**
2937
2938Pressure of the touch event.
2939
2940**Since**
2941
29428
2943
2944
2945### force [2/3]
2946
2947```
2948float OH_NativeXComponent_TouchEvent::force = 0.0
2949```
2950
2951**Description**
2952
2953Pressure of the touch event.
2954
2955**Since**
2956
29578
2958
2959
2960### force [3/3]
2961
2962```
2963float OH_NativeXComponent_HistoricalPoint::force = 0.0
2964```
2965
2966**Description**
2967
2968Pressure of the touch event.
2969
2970**Since**
2971
297210
2973
2974
2975### id [1/3]
2976
2977```
2978int32_t OH_NativeXComponent_TouchPoint::id = 0
2979```
2980
2981**Description**
2982
2983Unique identifier of the finger.
2984
2985**Since**
2986
29878
2988
2989
2990### id [2/3]
2991
2992```
2993int32_t OH_NativeXComponent_TouchEvent::id = 0
2994```
2995
2996**Description**
2997
2998Unique identifier of the finger.
2999
3000**Since**
3001
30028
3003
3004
3005### id [3/3]
3006
3007```
3008int32_t OH_NativeXComponent_HistoricalPoint::id = 0
3009```
3010
3011**Description**
3012
3013Unique identifier of the finger.
3014
3015**Since**
3016
301710
3018
3019
3020### isPressed
3021
3022```
3023bool OH_NativeXComponent_TouchPoint::isPressed = false
3024```
3025
3026**Description**
3027
3028Whether the current point is pressed.
3029
3030**Since**
3031
30328
3033
3034
3035### numPoints
3036
3037```
3038uint32_t OH_NativeXComponent_TouchEvent::numPoints = 0
3039```
3040
3041**Description**
3042
3043Number of current touch points. The value **1** indicates single-finger touch, while a value greater than **1** indicates multi-finger touch.
3044
3045**Since**
3046
30478
3048
3049
3050### OnSurfaceChanged
3051
3052```
3053void(* OH_NativeXComponent_Callback::OnSurfaceChanged) (OH_NativeXComponent *component, void *window)
3054```
3055
3056**Description**
3057
3058Invoked when the surface changes.
3059
3060**Parameters**
3061
3062| Name       | Description                           |
3063| --------- | ----------------------------- |
3064| component | Pointer to the **OH_NativeXComponent** instance.|
3065| window  | Handle to the **NativeWindow** instance.             |
3066
3067**Since**
3068
30698
3070
3071
3072### OnSurfaceCreated
3073
3074```
3075void(* OH_NativeXComponent_Callback::OnSurfaceCreated) (OH_NativeXComponent *component, void *window)
3076```
3077
3078**Description**
3079
3080Invoked when a surface is created.
3081
3082**Parameters**
3083
3084| Name       | Description                           |
3085| --------- | ----------------------------- |
3086| component | Pointer to the **OH_NativeXComponent** instance.|
3087| window  | Handle to the **NativeWindow** instance.             |
3088
3089**Since**
3090
30918
3092
3093
3094### OnSurfaceDestroyed
3095
3096```
3097void(* OH_NativeXComponent_Callback::OnSurfaceDestroyed) (OH_NativeXComponent *component, void *window)
3098```
3099
3100**Description**
3101
3102Invoked when the surface is destroyed.
3103
3104**Parameters**
3105
3106| Name       | Description                           |
3107| --------- | ----------------------------- |
3108| component | Pointer to the **OH_NativeXComponent** instance.|
3109| window  | Handle to the **NativeWindow** instance.             |
3110
3111**Since**
3112
31138
3114
3115
3116### screenX [1/4]
3117
3118```
3119float OH_NativeXComponent_TouchPoint::screenX = 0.0
3120```
3121
3122**Description**
3123
3124X coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.
3125
3126**Since**
3127
31288
3129
3130
3131### screenX [2/4]
3132
3133```
3134float OH_NativeXComponent_TouchEvent::screenX = 0.0
3135```
3136
3137**Description**
3138
3139X coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.
3140
3141**Since**
3142
31438
3144
3145
3146### screenX [3/4]
3147
3148```
3149float OH_NativeXComponent_MouseEvent::screenX
3150```
3151
3152**Description**
3153
3154X coordinate of the click point relative to the upper left corner of the application screen where the XComponent is located.
3155
3156**Since**
3157
31588
3159
3160
3161### screenX [4/4]
3162
3163```
3164float OH_NativeXComponent_HistoricalPoint::screenX
3165```
3166
3167**Description**
3168
3169X coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.
3170
3171**Since**
3172
317310
3174
3175
3176### screenY [1/4]
3177
3178```
3179float OH_NativeXComponent_TouchPoint::screenY = 0.0
3180```
3181
3182**Description**
3183
3184Y coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.
3185
3186**Since**
3187
31888
3189
3190
3191### screenY [2/4]
3192
3193```
3194float OH_NativeXComponent_TouchEvent::screenY = 0.0
3195```
3196
3197**Description**
3198
3199Y coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.
3200
3201**Since**
3202
32038
3204
3205
3206### screenY [3/4]
3207
3208```
3209float OH_NativeXComponent_MouseEvent::screenY
3210```
3211
3212**Description**
3213
3214Y coordinate of the click point relative to the upper left corner of the application window where the XComponent is located.
3215
3216**Since**
3217
32188
3219
3220
3221### screenY [4/4]
3222
3223```
3224float OH_NativeXComponent_HistoricalPoint::screenY
3225```
3226
3227**Description**
3228
3229Y coordinate of the touch point relative to the upper left corner of the application window where the XComponent is located.
3230
3231**Since**
3232
323310
3234
3235
3236### size [1/3]
3237
3238```
3239double OH_NativeXComponent_TouchPoint::size = 0.0
3240```
3241
3242**Description**
3243
3244Contact area between the finger pad and the screen.
3245
3246**Since**
3247
32488
3249
3250
3251### size [2/3]
3252
3253```
3254double OH_NativeXComponent_TouchEvent::size = 0.0
3255```
3256
3257**Description**
3258
3259Contact area between the finger pad and the screen.
3260
3261**Since**
3262
32638
3264
3265
3266### size [3/3]
3267
3268```
3269double OH_NativeXComponent_HistoricalPoint::size = 0.0
3270```
3271
3272**Description**
3273
3274Contact area between the finger pad and the screen.
3275
3276**Since**
3277
327810
3279
3280
3281### timeStamp [1/3]
3282
3283```
3284long long OH_NativeXComponent_TouchPoint::timeStamp = 0
3285```
3286
3287**Description**
3288
3289Timestamp of the touch event. It is interval between the time when the event is triggered and the time when the system starts, in nanoseconds.
3290
3291**Since**
3292
32938
3294
3295
3296### timeStamp [2/3]
3297
3298```
3299long long OH_NativeXComponent_TouchEvent::timeStamp = 0
3300```
3301
3302**Description**
3303
3304Timestamp of the touch event. It is interval between the time when the event is triggered and the time when the system starts, in nanoseconds.
3305
3306**Since**
3307
33088
3309
3310
3311### timeStamp [3/3]
3312
3313```
3314int64_t OH_NativeXComponent_HistoricalPoint::timeStamp = 0
3315```
3316
3317**Description**
3318
3319Timestamp of the touch event. It is interval between the time when the event is triggered and the time when the system starts, in nanoseconds.
3320
3321**Since**
3322
332310
3324
3325
3326### timestamp
3327
3328```
3329int64_t OH_NativeXComponent_MouseEvent::timestamp
3330```
3331
3332**Description**
3333
3334Timestamp of the mouse event. It is interval between the time when the event is triggered and the time when the system starts, in nanoseconds.
3335
3336**Since**
3337
33388
3339
3340
3341### touchPoints
3342
3343```
3344OH_NativeXComponent_TouchPoint OH_NativeXComponent_TouchEvent::touchPoints[OH_MAX_TOUCH_POINTS_NUMBER]
3345```
3346
3347**Description**
3348
3349Array of the touch points.
3350
3351**Since**
3352
33538
3354
3355
3356### type [1/3]
3357
3358```
3359OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchPoint::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN
3360```
3361
3362**Description**
3363
3364Touch type of the touch event.
3365
3366**Since**
3367
33688
3369
3370
3371### type [2/3]
3372
3373```
3374OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchEvent::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN
3375```
3376
3377**Description**
3378
3379Touch type of the touch event.
3380
3381**Since**
3382
33838
3384
3385
3386### type [3/3]
3387
3388```
3389OH_NativeXComponent_TouchEventType OH_NativeXComponent_HistoricalPoint::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN
3390```
3391
3392**Description**
3393
3394Touch type of the touch event.
3395
3396**Since**
3397
339810
3399
3400
3401### x [1/4]
3402
3403```
3404float OH_NativeXComponent_TouchPoint::x = 0.0
3405```
3406
3407**Description**
3408
3409X coordinate of the touch point relative to the left edge of the XComponent.
3410
3411**Since**
3412
34138
3414
3415
3416### x [2/4]
3417
3418```
3419float OH_NativeXComponent_TouchEvent::x = 0.0
3420```
3421
3422**Description**
3423
3424X coordinate of the touch point relative to the left edge of the XComponent.
3425
3426**Since**
3427
34288
3429
3430
3431### x [3/4]
3432
3433```
3434float OH_NativeXComponent_MouseEvent::x
3435```
3436
3437**Description**
3438
3439X coordinate of the clicked point relative to the upper left corner of the component.
3440
3441**Since**
3442
34438
3444
3445
3446### x [4/4]
3447
3448```
3449float OH_NativeXComponent_HistoricalPoint::x
3450```
3451
3452**Description**
3453
3454X coordinate of the touch point relative to the left edge of the XComponent.
3455
3456**Since**
3457
345810
3459
3460
3461### y [1/4]
3462
3463```
3464float OH_NativeXComponent_TouchPoint::y = 0.0
3465```
3466
3467**Description**
3468
3469Y coordinate of the touch point relative to the upper edge of the XComponent.
3470
3471**Since**
3472
34738
3474
3475
3476### y [2/4]
3477
3478```
3479float OH_NativeXComponent_TouchEvent::y = 0.0
3480```
3481
3482**Description**
3483
3484Y coordinate of the touch point relative to the upper edge of the XComponent.
3485
3486**Since**
3487
34888
3489
3490
3491### y [3/4]
3492
3493```
3494float OH_NativeXComponent_MouseEvent::y
3495```
3496
3497**Description**
3498
3499Y coordinate of the clicked point relative to the upper left corner of the component.
3500
3501**Since**
3502
35038
3504
3505
3506### y [4/4]
3507
3508```
3509float OH_NativeXComponent_HistoricalPoint::y
3510```
3511
3512**Description**
3513
3514Y coordinate of the touch point relative to the upper edge of the XComponent.
3515
3516**Since**
3517
351810
3519
3520
3521### expected
3522
3523```
3524int32_t OH_NativeXComponent_ExpectedRateRange::expected
3525```
3526**Description**
3527
3528Expected frame rate range.
3529
3530**Since**
3531
353211
3533
3534### max
3535
3536```
3537int32_t OH_NativeXComponent_ExpectedRateRange::max
3538```
3539**Description**
3540
3541Maximum value of the expected frame rate range.
3542
3543**Since**
3544
354511
3546
3547
3548### min
3549
3550```
3551int32_t OH_NativeXComponent_ExpectedRateRange::min
3552```
3553**Description**
3554
3555Minimum value of the expected frame rate range.
3556
3557**Since**
3558
355911
3560
3561### titlX
3562
3563```
3564float OH_NativeXComponent_HistoricalPoint::titlX
3565```
3566**Description**
3567
3568Angle between the projection on the x-y plane and the z-axis of the touch event.
3569
3570**Since**
3571
357210
3573
3574
3575### titlY
3576
3577```
3578float OH_NativeXComponent_HistoricalPoint::titlY
3579```
3580**Description**
3581
3582Angle between the projection on the y-z plane and the z-axis of the current touch event.
3583
3584**Since**
3585
358610
3587
3588
3589### sourceTool
3590
3591```
3592OH_NativeXComponent_TouchEvent_SourceTool OH_NativeXComponent_HistoricalPoint::sourceTool
3593```
3594**Description**
3595
3596Source tool of the touch event.
3597
3598**Since**
3599
360010
3601