• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup OH_NativeXComponent Native XComponent
18  * @{
19  *
20  * @brief Describes the surface and touch event held by the ArkUI XComponent, which can be used for the EGL/OpenGL ES\n
21  *        and media data input and displayed on the ArkUI XComponent.
22  *
23  * @since 8
24  * @version 1.0
25  */
26 
27 /**
28  * @file native_interface_xcomponent.h
29  *
30  * @brief Declares APIs for accessing a Native XComponent.
31  *
32  * @since 8
33  * @version 1.0
34  */
35 
36 #ifndef _NATIVE_INTERFACE_XCOMPONENT_H_
37 #define _NATIVE_INTERFACE_XCOMPONENT_H_
38 
39 #include <stdbool.h>
40 #include <stdint.h>
41 
42 #include "native_type.h"
43 #include "native_xcomponent_key_event.h"
44 #include "ui_input_event.h"
45 #include "native_interface_accessibility.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #define OH_NATIVE_XCOMPONENT_OBJ ("__NATIVE_XCOMPONENT_OBJ__")
52 #define OH_NATIVE_XCOMPONENT_MAX_TOUCH_POINTS_NUMBER 10
53 
54 const uint32_t OH_XCOMPONENT_ID_LEN_MAX = 128;
55 const uint32_t OH_MAX_TOUCH_POINTS_NUMBER = 10;
56 
57 /**
58  * @brief Enumerates the API access states.
59  *
60  * @since 8
61  * @version 1.0
62  */
63 enum {
64     /** Successful. */
65     OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0,
66     /** Failed. */
67     OH_NATIVEXCOMPONENT_RESULT_FAILED = -1,
68     /** Invalid parameters. */
69     OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2,
70 };
71 
72 /**
73  * @brief Status code for AI analyzer.
74  *
75  * @since 16
76  * @version 1.0
77  */
78 typedef enum {
79     /** AI analyzer execution is finished. */
80     ARKUI_XCOMPONENT_AI_ANALYSIS_FINISHED = 0,
81     /** AI analyzer is disabled. */
82     ARKUI_XCOMPONENT_AI_ANALYSIS_DISABLED = 110000,
83     /** AI analyzer is unsupported. */
84     ARKUI_XCOMPONENT_AI_ANALYSIS_UNSUPPORTED = 110001,
85     /** AI analyzer is ongoing. */
86     ARKUI_XCOMPONENT_AI_ANALYSIS_ONGOING = 110002,
87     /** AI analyzer is stopped. */
88     ARKUI_XCOMPONENT_AI_ANALYSIS_STOPPED = 110003,
89 } ArkUI_XComponent_ImageAnalyzerState;
90 
91 typedef enum {
92     /** Trigger a touch event when a finger is pressed. */
93     OH_NATIVEXCOMPONENT_DOWN = 0,
94     /** Trigger a touch event when a finger is lifted. */
95     OH_NATIVEXCOMPONENT_UP,
96     /** Trigger a touch event when a finger moves on the screen in pressed state. */
97     OH_NATIVEXCOMPONENT_MOVE,
98     /** Trigger an event when a touch event is canceled. */
99     OH_NATIVEXCOMPONENT_CANCEL,
100     /** Invalid touch type. */
101     OH_NATIVEXCOMPONENT_UNKNOWN,
102 } OH_NativeXComponent_TouchEventType;
103 
104 /**
105  * @brief Represents the touch point tool type.
106  *
107  * @since 9
108  * @version 1.0
109  */
110 typedef enum {
111     /** Indicates invalid tool type. */
112     OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN = 0,
113     /** Indicates a finger. */
114     OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER,
115     /** Indicates a stylus. */
116     OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN,
117     /** Indicates a eraser. */
118     OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER,
119     /** Indicates a brush. */
120     OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH,
121     /** Indicates a pencil. */
122     OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL,
123     /** Indicates a brush. */
124     OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH,
125     /** Indicates a mouse. */
126     OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE,
127     /** Indicates a lens. */
128     OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS,
129 } OH_NativeXComponent_TouchPointToolType;
130 
131 /**
132  * @brief Represents the touch event source type.
133  *
134  * @since 9
135  * @version 1.0
136  */
137 typedef enum {
138     /** Indicates an unknown input source type. */
139     OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN = 0,
140     /** Indicates that the input source generates a mouse multi-touch event. */
141     OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE,
142     /** Indicates that the input source generates a touchscreen multi-touch event. */
143     OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN,
144     /** Indicates that the input source generates a touchpad multi-touch event. */
145     OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD,
146     /** Indicates that the input source generates a joystick multi-touch event. */
147     OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK,
148     /**
149      * @brief Indicates that the input source generates a keyboard event.
150      *
151      * @since 10
152      * @version 1.0
153      */
154     OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD,
155 } OH_NativeXComponent_EventSourceType;
156 
157 /**
158  * @brief Represents the mouse event action.
159  *
160  * @since 9
161  * @version 1.0
162  */
163 typedef enum {
164     OH_NATIVEXCOMPONENT_MOUSE_NONE = 0,
165     OH_NATIVEXCOMPONENT_MOUSE_PRESS,
166     OH_NATIVEXCOMPONENT_MOUSE_RELEASE,
167     OH_NATIVEXCOMPONENT_MOUSE_MOVE,
168     OH_NATIVEXCOMPONENT_MOUSE_CANCEL,
169 } OH_NativeXComponent_MouseEventAction;
170 
171 /**
172  * @brief Represents the mouse event button.
173  *
174  * @since 9
175  * @version 1.0
176  */
177 typedef enum {
178     OH_NATIVEXCOMPONENT_NONE_BUTTON = 0,
179     OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01,
180     OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02,
181     OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04,
182     OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08,
183     OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10,
184 } OH_NativeXComponent_MouseEventButton;
185 
186 /**
187  * @brief Represents the source tool type of TouchEvent
188  *
189  * @since 10
190  * @version 1.0
191  */
192 typedef enum {
193     OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN = 0,
194     OH_NATIVEXCOMPONENT_SOURCETOOL_FINGER = 1,
195     OH_NATIVEXCOMPONENT_SOURCETOOL_PEN = 2,
196     OH_NATIVEXCOMPONENT_SOURCETOOL_RUBBER = 3,
197     OH_NATIVEXCOMPONENT_SOURCETOOL_BRUSH = 4,
198     OH_NATIVEXCOMPONENT_SOURCETOOL_PENCIL = 5,
199     OH_NATIVEXCOMPONENT_SOURCETOOL_AIRBRUSH = 6,
200     OH_NATIVEXCOMPONENT_SOURCETOOL_MOUSE = 7,
201     OH_NATIVEXCOMPONENT_SOURCETOOL_LENS = 8,
202     OH_NATIVEXCOMPONENT_SOURCETOOL_TOUCHPAD = 9,
203 } OH_NativeXComponent_TouchEvent_SourceTool;
204 
205 typedef struct {
206     /** Unique identifier of a finger. */
207     int32_t id;
208     /** X coordinate of the touch point relative to the left edge of the screen. */
209     float screenX;
210     /** Y coordinate of the touch point relative to the upper edge of the screen. */
211     float screenY;
212     /** X coordinate of the touch point relative to the left edge of the element to touch. */
213     float x;
214     /** Y coordinate of the touch point relative to the upper edge of the element to touch. */
215     float y;
216     /** Touch type of the touch event. */
217     OH_NativeXComponent_TouchEventType type;
218     /** Contact area between the finger pad and the screen. */
219     double size;
220     /** Pressure of the current touch event. */
221     float force;
222     /** Timestamp of the current touch event. */
223     int64_t timeStamp;
224     /** The angle betweenprojection on plane-X-Y and axis-Z of the current touch event. */
225     float titlX;
226     /** The angle betweenprojection on plane-Y-Z and axis-Z of the current touch event. */
227     float titlY;
228     /** The sourceTool of the current touch event. */
229     OH_NativeXComponent_TouchEvent_SourceTool sourceTool;
230 } OH_NativeXComponent_HistoricalPoint;
231 
232 typedef struct {
233     /** Unique identifier of a finger. */
234     int32_t id;
235     /** X coordinate of the touch point relative to the left edge of the screen. */
236     float screenX;
237     /** Y coordinate of the touch point relative to the upper edge of the screen. */
238     float screenY;
239     /** X coordinate of the touch point relative to the left edge of the element to touch. */
240     float x;
241     /** Y coordinate of the touch point relative to the upper edge of the element to touch. */
242     float y;
243     /** Touch type of the touch event. */
244     OH_NativeXComponent_TouchEventType type;
245     /** Contact area between the finger pad and the screen. */
246     double size;
247     /** Pressure of the current touch event. */
248     float force;
249     /** Timestamp of the current touch event. */
250     int64_t timeStamp;
251     /** Whether the current point is pressed. */
252     bool isPressed;
253 } OH_NativeXComponent_TouchPoint;
254 
255 // Represents the touch point information.
256 typedef struct {
257     /** Unique identifier of a finger. */
258     int32_t id;
259     /** X coordinate of the touch point relative to the left edge of the screen. */
260     float screenX;
261     /** Y coordinate of the touch point relative to the upper edge of the screen. */
262     float screenY;
263     /** X coordinate of the touch point relative to the left edge of the element to touch. */
264     float x;
265     /** Y coordinate of the touch point relative to the upper edge of the element to touch. */
266     float y;
267     /** Touch type of the touch event. */
268     OH_NativeXComponent_TouchEventType type;
269     /** Contact area between the finger pad and the screen. */
270     double size;
271     /** Pressure of the current touch event. */
272     float force;
273     /** ID of the device where the current touch event is generated. */
274     int64_t deviceId;
275     /** Timestamp of the current touch event. */
276     int64_t timeStamp;
277     /** Array of the current touch points. */
278     OH_NativeXComponent_TouchPoint touchPoints[OH_NATIVE_XCOMPONENT_MAX_TOUCH_POINTS_NUMBER];
279     /** Number of current touch points. */
280     uint32_t numPoints;
281 } OH_NativeXComponent_TouchEvent;
282 
283 /**
284  * @brief Represents the mouse event information.
285  *
286  * @since 9
287  * @version 1.0
288  */
289 typedef struct {
290     /** X coordinate of the mouse point relative to the left edge of the element to mouse. */
291     float x;
292     /** Y coordinate of the mouse point relative to the upper edge of the element to mouse. */
293     float y;
294     /** X coordinate of the mouse point relative to the left edge of the screen. */
295     float screenX;
296     /** Y coordinate of the mouse point relative to the upper edge of the screen. */
297     float screenY;
298     /** Timestamp of the current mouse event. */
299     int64_t timestamp;
300     /** Mouse event action. */
301     OH_NativeXComponent_MouseEventAction action;
302     /** Mouse event button. */
303     OH_NativeXComponent_MouseEventButton button;
304 } OH_NativeXComponent_MouseEvent;
305 
306 /**
307  * @brief Provides an encapsulated <b>OH_NativeXComponent</b> instance.
308  *
309  * @since 8
310  * @version 1.0
311  */
312 typedef struct OH_NativeXComponent OH_NativeXComponent;
313 
314 /**
315  * @brief Registers the surface lifecycle and touch event callbacks.
316  *
317  * @since 8
318  * @version 1.0
319  */
320 typedef struct OH_NativeXComponent_Callback {
321     /** Called when the surface is created. */
322     void (*OnSurfaceCreated)(OH_NativeXComponent* component, void* window);
323     /** Called when the surface is changed. */
324     void (*OnSurfaceChanged)(OH_NativeXComponent* component, void* window);
325     /** Called when the surface is destroyed. */
326     void (*OnSurfaceDestroyed)(OH_NativeXComponent* component, void* window);
327     /** Called when a touch event is triggered. */
328     void (*DispatchTouchEvent)(OH_NativeXComponent* component, void* window);
329 } OH_NativeXComponent_Callback;
330 
331 /**
332  * @brief Registers the mouse event callbacks.
333  *
334  * @since 9
335  * @version 1.0
336  */
337 typedef struct OH_NativeXComponent_MouseEvent_Callback {
338     /** Called when a mouse event is triggered. */
339     void (*DispatchMouseEvent)(OH_NativeXComponent* component, void* window);
340     /** Called when a hover event is triggered. */
341     void (*DispatchHoverEvent)(OH_NativeXComponent* component, bool isHover);
342 } OH_NativeXComponent_MouseEvent_Callback;
343 
344 struct OH_NativeXComponent_KeyEvent;
345 /**
346  * @brief Provides an encapsulated <b>OH_NativeXComponent_KeyEvent</b> instance.
347  *
348  * @since 10
349  * @version 1.0
350  */
351 typedef struct OH_NativeXComponent_KeyEvent OH_NativeXComponent_KeyEvent;
352 
353 /**
354  * @brief Defines the expected frame rate range struct.
355  *
356  * @since 11
357  * @version 1.0
358  */
359 typedef struct {
360     /** The minimum frame rate of dynamical callback rate range. */
361     int32_t min;
362     /** The maximum frame rate of dynamical callback rate range. */
363     int32_t max;
364     /** The expected frame rate of dynamical callback rate range. */
365     int32_t expected;
366 } OH_NativeXComponent_ExpectedRateRange;
367 
368 /**
369  * @brief Obtains the ID of the ArkUI XComponent.
370  *
371  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
372  * @param id Indicates the char buffer to keep the ID of this <b>OH_NativeXComponent</b> instance.\n
373  *        Notice that a null-terminator will be appended to the char buffer, so the size of the\n
374  *        char buffer should be at least as large as the size of the real id length plus 1.\n
375  *        It is recommended that the size of the char buffer be [OH_XCOMPONENT_ID_LEN_MAX + 1].
376  * @param size Indicates the pointer to the length of <b>id</b>, which you can set and receive.
377  * @return Returns the status code of the execution.
378  * @since 8
379  * @version 1.0
380  */
381 int32_t OH_NativeXComponent_GetXComponentId(OH_NativeXComponent* component, char* id, uint64_t* size);
382 
383 /**
384  * @brief Obtains the size of the surface held by the ArkUI XComponent.
385  *
386  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
387  * @param window Indicates the native window handler.
388  * @param width Indicates the pointer to the width of the current surface.
389  * @param height Indicates the pointer to the height of the current surface.
390  * @return Returns the status code of the execution.
391  * @since 8
392  * @version 1.0
393  */
394 int32_t OH_NativeXComponent_GetXComponentSize(
395     OH_NativeXComponent* component, const void* window, uint64_t* width, uint64_t* height);
396 
397 /**
398  * @brief Obtains the offset of the surface held by the ArkUI XComponent.
399  *
400  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
401  * @param window Indicates the native window handler.
402  * @param x Indicates the pointer to the x coordinate of the current surface.
403  * @param y Indicates the pointer to the y coordinate of the current surface.
404  * @return Returns the status code of the execution.
405  * @since 8
406  * @version 1.0
407  */
408 int32_t OH_NativeXComponent_GetXComponentOffset(
409     OH_NativeXComponent* component, const void* window, double* x, double* y);
410 
411 /**
412  * @brief Obtains the touch event dispatched by the ArkUI XComponent.
413  *
414  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
415  * @param window Indicates the native window handler.
416  * @param touchEvent Indicates the pointer to the current touch event.
417  * @return Returns the status code of the execution.
418  * @since 8
419  * @version 1.0
420  */
421 int32_t OH_NativeXComponent_GetTouchEvent(
422     OH_NativeXComponent* component, const void* window, OH_NativeXComponent_TouchEvent* touchEvent);
423 
424 /**
425  * @brief Obtains the touch pointer tool type by the ArkUI XComponent.
426  *
427  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
428  * @param pointIndex Indicates the pointer index in the touchPoints.
429  * @param toolType Indicates the tool Type of the pointer.
430  * @return Returns the status code of the execution.
431  * @since 9
432  * @version 1.0
433  */
434 int32_t OH_NativeXComponent_GetTouchPointToolType(
435     OH_NativeXComponent* component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType* toolType);
436 
437 /**
438  * @brief Obtains the touch pointer tiltX by the ArkUI XComponent.
439  *
440  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
441  * @param pointIndex Indicates the pointer index in the touchPoints.
442  * @param tiltX Indicates the x tilt of the pointer.
443  * @return Returns the status code of the execution.
444  * @since 9
445  * @version 1.0
446  */
447 int32_t OH_NativeXComponent_GetTouchPointTiltX(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltX);
448 
449 /**
450  * @brief Obtains the touch pointer tiltY by the ArkUI XComponent.
451  *
452  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
453  * @param pointIndex Indicates the pointer index in the touchPoints.
454  * @param tiltY Indicates the y tilt of the pointer.
455  * @return Returns the status code of the execution.
456  * @since 9
457  * @version 1.0
458  */
459 int32_t OH_NativeXComponent_GetTouchPointTiltY(OH_NativeXComponent* component, uint32_t pointIndex, float* tiltY);
460 
461 /**
462  * @brief Obtains the x coordinate of a specific touch point relative to the upper left corner of\n
463  *        the current application window from the ArkUI XComponent.
464  *
465  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
466  * @param pointIndex Indicates the pointer index in the touchPoints.
467  * @param windowX Indicates the x coordinate relative to the upper left corner of the current\n
468           application window.
469  * @return Returns the status code of the execution.
470  *         {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get windowX success.
471  *         {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, windowX is NULL\n
472  *         or native XComponent is NULL.
473  * @since 12
474  * @version 1.0
475  */
476 int32_t OH_NativeXComponent_GetTouchPointWindowX(OH_NativeXComponent* component, uint32_t pointIndex, float* windowX);
477 
478 /**
479  * @brief Obtains the y coordinate of a specific touch point relative to the upper left corner of\n
480  *        the current application window from the ArkUI XComponent.
481  *
482  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
483  * @param pointIndex Indicates the pointer index in the touchPoints.
484  * @param windowY Indicates the y coordinate relative to the upper left corner of the current\n
485           application window.
486  * @return Returns the status code of the execution.
487  *         {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get windowY success.
488  *         {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, windowY is NULL\n
489  *         or native XComponent is NULL.
490  * @since 12
491  * @version 1.0
492  */
493 int32_t OH_NativeXComponent_GetTouchPointWindowY(OH_NativeXComponent* component, uint32_t pointIndex, float* windowY);
494 
495 /**
496  * @brief Obtains the x coordinate of a specific touch point relative to the upper left corner of\n
497  *        the current screen from the ArkUI XComponent.
498  *
499  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
500  * @param pointIndex Indicates the pointer index in the touchPoints.
501  * @param displayX Indicates the x coordinate relative to the upper left corner of the current\n
502           screen.
503  * @return Returns the status code of the execution.
504  *         {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get displayX success.
505  *         {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, displayX is NULL\n
506  *         or native XComponent is NULL.
507  * @since 12
508  * @version 1.0
509  */
510 int32_t OH_NativeXComponent_GetTouchPointDisplayX(OH_NativeXComponent* component, uint32_t pointIndex, float* displayX);
511 
512 /**
513  * @brief Obtains the y coordinate of a specific touch point relative to the upper left corner of\n
514  *        the current screen from the ArkUI XComponent.
515  *
516  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
517  * @param pointIndex Indicates the pointer index in the touchPoints.
518  * @param displayY Indicates the y coordinate relative to the upper left corner of the current\n
519           screen.
520  * @return Returns the status code of the execution.
521  *         {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get displayY success.
522  *         {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, displayY is NULL\n
523  *         or native XComponent is NULL.
524  * @since 12
525  * @version 1.0
526  */
527 int32_t OH_NativeXComponent_GetTouchPointDisplayY(OH_NativeXComponent* component, uint32_t pointIndex, float* displayY);
528 
529 /**
530  * @brief Obtains the touch event dispatched by the ArkUI XComponent.
531  *
532  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
533  * @param window Indicates the native window handler.
534  * @param historicalPoints Indicates the pointer to the current historicalPoints.
535  * @return Returns the status code of the execution.
536  * @since 10
537  * @version 1.0
538  */
539 int32_t OH_NativeXComponent_GetHistoricalPoints(OH_NativeXComponent* component, const void* window,
540     int32_t* size, OH_NativeXComponent_HistoricalPoint** historicalPoints);
541 
542 /**
543  * @brief Obtains the mouse event dispatched by the ArkUI XComponent.
544  *
545  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
546  * @param window Indicates the native window handler.
547  * @param mouseEvent Indicates the pointer to the current mouse event.
548  * @return Returns the status code of the execution.
549  * @since 9
550  * @version 1.0
551  */
552 int32_t OH_NativeXComponent_GetMouseEvent(
553     OH_NativeXComponent* component, const void* window, OH_NativeXComponent_MouseEvent* mouseEvent);
554 
555 /**
556  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
557  *
558  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
559  * @param callback Indicates the pointer to a surface lifecycle and touch event callback.
560  * @return Returns the status code of the execution.
561  * @since 8
562  * @version 1.0
563  */
564 int32_t OH_NativeXComponent_RegisterCallback(OH_NativeXComponent* component, OH_NativeXComponent_Callback* callback);
565 
566 /**
567  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
568  *
569  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
570  * @param callback Indicates the pointer to a mouse event callback.
571  * @return Returns the status code of the execution.
572  * @since 9
573  * @version 1.0
574  */
575 int32_t OH_NativeXComponent_RegisterMouseEventCallback(
576     OH_NativeXComponent* component, OH_NativeXComponent_MouseEvent_Callback* callback);
577 
578 /**
579  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
580  *
581  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
582  * @param callback Indicates the pointer to a focus event callback.
583  * @return Returns the status code of the execution.
584  * @since 10
585  * @version 1.0
586  */
587 int32_t OH_NativeXComponent_RegisterFocusEventCallback(
588     OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window));
589 
590 /**
591  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
592  *
593  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
594  * @param callback Indicates the pointer to a key event callback.
595  * @return Returns the status code of the execution.
596  * @since 10
597  * @version 1.0
598  */
599 int32_t OH_NativeXComponent_RegisterKeyEventCallback(
600     OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window));
601 
602 /**
603  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
604  *
605  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
606  * @param callback Indicates the pointer to a blur event callback.
607  * @return Returns the status code of the execution.
608  * @since 10
609  * @version 1.0
610  */
611 int32_t OH_NativeXComponent_RegisterBlurEventCallback(
612     OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window));
613 
614 /**
615  * @brief Obtains the key event dispatched by the ArkUI XComponent.
616  *
617  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
618  * @param keyEvent Indicates the pointer to pointer of <b>OH_NativeXComponent_KeyEvent</b> instance.
619  * @return Returns the status code of the execution.
620  * @since 10
621  * @version 1.0
622  */
623 int32_t OH_NativeXComponent_GetKeyEvent(OH_NativeXComponent* component, OH_NativeXComponent_KeyEvent** keyEvent);
624 
625 /**
626  * @brief Obtains the action of the key event.
627  *
628  * @param keyEvent Indicates the pointer to this <b>OH_NativeXComponent_KeyEvent</b> instance.
629  * @param action Indicates the action of the <b>OH_NativeXComponent_KeyEvent</b> instance.
630  * @return Returns the status code of the execution.
631  * @since 10
632  * @version 1.0
633  */
634 int32_t OH_NativeXComponent_GetKeyEventAction(
635     OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyAction* action);
636 
637 /**
638  * @brief Obtains the keyCode of the key event.
639  *
640  * @param keyEvent Indicates the pointer to this <b>OH_NativeXComponent_KeyEvent</b> instance.
641  * @param code Indicates the keyCode of the <b>OH_NativeXComponent_KeyEvent</b> instance.
642  * @return Returns the status code of the execution.
643  * @since 10
644  * @version 1.0
645  */
646 int32_t OH_NativeXComponent_GetKeyEventCode(OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_KeyCode* code);
647 
648 /**
649  * @brief Obtains the sourceType of the key event.
650  *
651  * @param keyEvent Indicates the pointer to this <b>OH_NativeXComponent_KeyEvent</b> instance.
652  * @param sourceType Indicates the sourceType of the <b>OH_NativeXComponent_KeyEvent</b> instance.
653  * @return Returns the status code of the execution.
654  * @since 10
655  * @version 1.0
656  */
657 int32_t OH_NativeXComponent_GetKeyEventSourceType(
658     OH_NativeXComponent_KeyEvent* keyEvent, OH_NativeXComponent_EventSourceType* sourceType);
659 
660 /**
661  * @brief Obtains the deviceId of the key event.
662  *
663  * @param keyEvent Indicates the pointer to this <b>OH_NativeXComponent_KeyEvent</b> instance.
664  * @param deviceId Indicates the deviceId of the <b>OH_NativeXComponent_KeyEvent</b> instance.
665  * @return Returns the status code of the execution.
666  * @since 10
667  * @version 1.0
668  */
669 int32_t OH_NativeXComponent_GetKeyEventDeviceId(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* deviceId);
670 
671 /**
672  * @brief Obtains the timestamp of the key event.
673  *
674  * @param keyEvent Indicates the pointer to this <b>OH_NativeXComponent_KeyEvent</b> instance.
675  * @param timestamp Indicates the timestamp of the <b>OH_NativeXComponent_KeyEvent</b> instance.
676  * @return Returns the status code of the execution.
677  * @since 10
678  * @version 1.0
679  */
680 int32_t OH_NativeXComponent_GetKeyEventTimestamp(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* timestamp);
681 
682 /**
683  * @brief Set the Expected FrameRateRange.
684  *
685  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
686  * @param callback Indicates the pointer to a expected rate range.
687  * @return Returns the status code of the execution.
688  * @since 11
689  * @version 1.0
690  */
691 int32_t OH_NativeXComponent_SetExpectedFrameRateRange(
692     OH_NativeXComponent* component, OH_NativeXComponent_ExpectedRateRange* range);
693 
694 /**
695  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
696  *
697  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
698  * @param callback Indicates the pointer to a onFrame callback.
699  * @return Returns the status code of the execution.
700  * @since 11
701  * @version 1.0
702  */
703 int32_t OH_NativeXComponent_RegisterOnFrameCallback(OH_NativeXComponent* component,
704     void (*callback)(OH_NativeXComponent* component, uint64_t timestamp, uint64_t targetTimestamp));
705 
706 /**
707  * @brief Unregister a callback for this <b>OH_NativeXComponent</b> instance.
708  *
709  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
710  * @return Returns the status code of the execution.
711  * @since 11
712  * @version 1.0
713  */
714 int32_t OH_NativeXComponent_UnregisterOnFrameCallback(OH_NativeXComponent* component);
715 
716 /**
717  * @brief Attaches the UI component created through the native API of ArkUI to this <b>OH_NativeXComponent</b> instance.
718  *
719  * @param component Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
720  * @param root Indicates the pointer to the component instance created by the native API.
721  * @return Returns 0 if success.
722  * Returns 401 if a parameter exception occurs.
723  *
724  * @since 12
725  */
726 int32_t OH_NativeXComponent_AttachNativeRootNode(OH_NativeXComponent* component, ArkUI_NodeHandle root);
727 
728 /**
729  * @brief Detaches the native component of ArkUI from this <b>OH_NativeXComponent</b> instance.
730  *
731  * @param component Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
732  * @param root Indicates the pointer to the component instance created by the native API.
733  * @return Returns 0 if success.
734  * Returns 401 if a parameter exception occurs.
735  *
736  * @since 12
737  */
738 int32_t OH_NativeXComponent_DetachNativeRootNode(OH_NativeXComponent* component, ArkUI_NodeHandle root);
739 
740 /**
741  * @brief Registers a UI input event callback for this <b>OH_NativeXComponent</b> instance and enables the callback to
742  * be invoked when a UI input event is received.
743  *
744  * @param component Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
745  * @param callback Indicates the pointer to the UI input event callback.
746  * @param type Indicates the type of the current UI input event.
747  * @return Returns 0 if success.
748  * Returns 401 if a parameter exception occurs.
749  * @since 12
750  */
751 int32_t OH_NativeXComponent_RegisterUIInputEventCallback(OH_NativeXComponent* component,
752     void (*callback)(OH_NativeXComponent* component, ArkUI_UIInputEvent* event, ArkUI_UIInputEvent_Type type),
753     ArkUI_UIInputEvent_Type type);
754 
755 /**
756  * @brief Set whether the <b>OH_NativeXComponent</b> instance needs soft keyboard.
757  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
758  * @param needSoftKeyboard Indicates whether the <b>OH_NativeXComponent</b> instance needs soft keyboard or not.
759  *                           Default value is false.
760  * @return Returns the status code of the execution.
761  * @since 12
762  * @version 1.0
763  */
764 int32_t OH_NativeXComponent_SetNeedSoftKeyboard(OH_NativeXComponent* component, bool needSoftKeyboard);
765 
766 /**
767  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
768  *
769  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
770  * @param callback Indicates the pointer to a surface show event callback.
771  * @return Returns the status code of the execution.
772  * @since 12
773  * @version 1.0
774  */
775 int32_t OH_NativeXComponent_RegisterSurfaceShowCallback(
776     OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window));
777 
778 /**
779  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
780  *
781  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
782  * @param callback Indicates the pointer to a surface hide event callback.
783  * @return Returns the status code of the execution.
784  * @since 12
785  * @version 1.0
786  */
787 int32_t OH_NativeXComponent_RegisterSurfaceHideCallback(
788     OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent* component, void* window));
789 
790 /**
791  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
792  *
793  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
794  * @param callback Indicates the pointer to a key event callback.
795  * @return Returns the status code of the execution.
796  * @since 10
797  * @version 1.0
798  */
799 int32_t OH_NativeXComponent_RegisterOnTouchInterceptCallback(
800     OH_NativeXComponent* component, HitTestMode (*callback)(OH_NativeXComponent* component, ArkUI_UIInputEvent* event));
801 
802 /**
803  * @brief Obtains the touch event's source type dispatched by the ArkUI XComponent.
804  *
805  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
806  * @param pointId Indicates the id of the touch point which triggers this touch event.
807  * @param sourceType Indicates the source type of this touch event.
808  * @return Returns OH_NATIVEXCOMPONENT_RESULT_SUCCESS if success.
809  *         Returns OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER if a parameter exception occurs.
810  *         Returns OH_NATIVEXCOMPONENT_RESULT_FAILED if other exceptions occur.
811  * @since 12
812  * @version 1.0
813  */
814 int32_t OH_NativeXComponent_GetTouchEventSourceType(
815     OH_NativeXComponent* component, int32_t pointId, OH_NativeXComponent_EventSourceType* sourceType);
816 
817 /**
818  * @brief Obtains the pointer to an <b>OH_NativeXComponent</b> instance based on the specified component
819  * instance created by the native API.
820  *
821  * @param node Indicates the pointer to the component instance created by the native API.
822  * @return Returns the pointer to the <b>OH_NativeXComponent</b> instance.
823  * @since 12
824  * @version 1.0
825  */
826 OH_NativeXComponent* OH_NativeXComponent_GetNativeXComponent(ArkUI_NodeHandle node);
827 
828 /**
829  * @brief Obtains the pointer to the <b> ArkUI_AccessibilityProvider</b>
830  * instance of this <b>OH_NativeXComponent</b> instance.
831  *
832  * @param component Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
833  * @param handle Indicates the pointer to the <b>ArkUI_AccessibilityProvider</b> instance.
834  * @return Returns <b>OH_NATIVEXCOMPONENT_RESULT_SUCCESS</b> if the operation is successful.
835  *         Returns <b>OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER</b> if a parameter error occurs.
836  * @since 13
837  */
838 int32_t OH_NativeXComponent_GetNativeAccessibilityProvider(
839     OH_NativeXComponent* component, ArkUI_AccessibilityProvider** handle);
840 
841 /**
842  * @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
843  *
844  * @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
845  * @param callback Indicates the pointer to a key event callback with result.
846  * @return Returns the status code of the execution.
847  *         {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} the callback function is successfully registered.\n
848  *         {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is nullptr or callback is nullptr.\n
849  * @since 14
850  * @version 1.0
851  */
852 int32_t OH_NativeXComponent_RegisterKeyEventCallbackWithResult(
853     OH_NativeXComponent* component, bool (*callback)(OH_NativeXComponent* component, void* window));
854 
855 /**
856  * @brief Start image analyzer for the specified XComponent
857  * instance created by the native API.
858  *
859  * @param node Indicates the pointer to the XComponent instance created by the native API.
860  * @param userData Indicates the pointer to a user defined data.
861  * @param callback Indicates the pointer to a image analyzer status callback function.
862  * @return Returns the status code of the execution.
863  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.\n
864  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} component is nullptr or callback is nullptr,
865  *         or the type of node is not XComponent.\n
866  * @since 16
867  */
868 int32_t OH_ArkUI_XComponent_StartImageAnalyzer(ArkUI_NodeHandle node, void* userData,
869     void (*callback)(ArkUI_NodeHandle node, ArkUI_XComponent_ImageAnalyzerState statusCode, void* userData));
870 
871 /**
872  * @brief Stop image analyzer for the specified XComponent
873  * instance created by the native API.
874  *
875  * @param node Indicates the pointer to the XComponent instance created by the native API.
876  * @return Returns the status code of the execution.
877  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.\n
878  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} component is nullptr or the type of node is not XComponent.\n
879  * @since 16
880  */
881 int32_t OH_ArkUI_XComponent_StopImageAnalyzer(ArkUI_NodeHandle node);
882 
883 /**
884  * @brief Provides an encapsulated <b>OH_ArkUI_SurfaceHolder</b> instance.
885  *
886  * @since 16
887  */
888 typedef struct OH_ArkUI_SurfaceHolder OH_ArkUI_SurfaceHolder;
889 
890 /**
891  * @brief Create a <b>OH_ArkUI_SurfaceHolder</b> object from an XComponent node.
892  *
893  * @param node Indicates the pointer to the XComponent node.
894  * @return Returns the created <b>OH_ArkUI_SurfaceHolder</b> object's pointer.
895  * @since 16
896  */
897 OH_ArkUI_SurfaceHolder* OH_ArkUI_SurfaceHolder_Create(ArkUI_NodeHandle node);
898 
899 /**
900  * @brief Disposes of a <b>OH_ArkUI_SurfaceHolder</b> object.
901  *
902  * @param node Indicates the pointer to <b>OH_ArkUI_SurfaceHolder</b> object needed to dispose.
903  * @since 16
904  */
905 void OH_ArkUI_SurfaceHolder_Dispose(OH_ArkUI_SurfaceHolder* surfaceHolder);
906 
907 /**
908  * @brief Saves custom data on the <b>OH_ArkUI_SurfaceHolder</b> instance.
909  *
910  * @param surfaceHolder Indicates the <b>OH_ArkUI_SurfaceHolder</b> instance
911  *        on which the custom data will be saved.
912  * @param userData Indicates the custom data to be saved.
913  * @return Returns the error code.
914  *         Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
915  *         Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
916  * @since 16
917  */
918 int32_t OH_ArkUI_SurfaceHolder_SetUserData(OH_ArkUI_SurfaceHolder* surfaceHolder, void* userData);
919 
920 /**
921  * @brief Obtains the custom data saved on the <b>OH_ArkUI_SurfaceHolder</b> instance.
922  *
923  * @param surfaceHolder Indicates the target <b>OH_ArkUI_SurfaceHolder</b> instance.
924  * @return Returns the custom data.
925  * @since 16
926  */
927 void* OH_ArkUI_SurfaceHolder_GetUserData(OH_ArkUI_SurfaceHolder* surfaceHolder);
928 
929 /**
930  * @brief Define the surface lifecycle callback.
931  *
932  * @since 16
933  */
934 typedef struct OH_ArkUI_SurfaceCallback OH_ArkUI_SurfaceCallback;
935 
936 /**
937  * @brief Create a <b>OH_ArkUI_SurfaceCallback</b> object.
938  *
939  * @return Returns the created <b>OH_ArkUI_SurfaceCallback</b> object's pointer.
940  * @since 16
941  */
942 OH_ArkUI_SurfaceCallback* OH_ArkUI_SurfaceCallback_Create(void);
943 
944 /**
945  * @brief Disposes of a <b>OH_ArkUI_SurfaceCallback</b> object.
946  *
947  * @param callback Indicates the pointer to <b>OH_ArkUI_SurfaceCallback</b> object needed to dispose.
948  * @since 16
949  */
950 void OH_ArkUI_SurfaceCallback_Dispose(OH_ArkUI_SurfaceCallback* callback);
951 
952 /**
953  * @brief Set the surface created event of the surface callback.
954  *
955  * @param callback Indicated the pointer to the surface callback.
956  * @param onSurfaceCreated Indicates the surface created callback event
957  *        which will called when the surface is created.
958  * @since 16
959  */
960 void OH_ArkUI_SurfaceCallback_SetSurfaceCreatedEvent(
961     OH_ArkUI_SurfaceCallback* callback,
962     void (*onSurfaceCreated)(OH_ArkUI_SurfaceHolder* surfaceHolder));
963 
964 /**
965  * @brief Set the surface changed event of the surface callback.
966  *
967  * @param callback Indicated the pointer to the surface callback.
968  * @param onSurfaceChanged Indicates the surface changed callback event
969  *        which will called when the surface is changed.
970  * @since 16
971  */
972 void OH_ArkUI_SurfaceCallback_SetSurfaceChangedEvent(
973     OH_ArkUI_SurfaceCallback* callback,
974     void (*onSurfaceChanged)(OH_ArkUI_SurfaceHolder* surfaceHolder, uint64_t width, uint64_t height));
975 
976 /**
977  * @brief Set the surface destroyed event of the surface callback.
978  *
979  * @param callback Indicated the pointer to the surface callback.
980  * @param onSurfaceDestroyed Indicates the surface destroyed callback event
981  *        which will called when the surface is destroyed.
982  * @since 16
983  */
984 void OH_ArkUI_SurfaceCallback_SetSurfaceDestroyedEvent(
985     OH_ArkUI_SurfaceCallback* callback,
986     void (*onSurfaceDestroyed)(OH_ArkUI_SurfaceHolder* surfaceHolder));
987 
988 /**
989  * @brief Adds a surface lifecycle callback for this <b>OH_ArkUI_SurfaceHolder</b> instance.
990  *
991  * @param surfaceHolder Indicates the pointer to this <b>OH_ArkUI_SurfaceHolder</b> instance.
992  * @param callback Indicates the pointer to this new callback.
993  * @return Returns the status code of the execution.
994  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.
995  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
996  * @since 16
997  */
998 int32_t OH_ArkUI_SurfaceHolder_AddSurfaceCallback(
999     OH_ArkUI_SurfaceHolder* surfaceHolder,
1000     OH_ArkUI_SurfaceCallback* callback);
1001 
1002 /**
1003  * @brief Removes a previously added surface lifecycle callback
1004  *        from this <b>OH_ArkUI_SurfaceHolder</b> instance.
1005  *
1006  * @param surfaceHolder Indicates the pointer to this <b>OH_ArkUI_SurfaceHolder</b> instance.
1007  * @param callback Indicates the pointer to the callback needed to remove.
1008  * @return Returns the status code of the execution.
1009  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.
1010  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
1011  * @since 16
1012  */
1013 int32_t OH_ArkUI_SurfaceHolder_RemoveSurfaceCallback(
1014     OH_ArkUI_SurfaceHolder* surfaceHolder,
1015     OH_ArkUI_SurfaceCallback* callback);
1016 
1017 /**
1018  * @brief Forward declaration of OHNativeWindow.
1019  *
1020  * @since 16
1021  */
1022 typedef struct NativeWindow OHNativeWindow;
1023 
1024 /**
1025  * @brief Obtains the nativeWindow associated with a <b>OH_ArkUI_SurfaceHolder</b> instance.
1026  *
1027  * @param surfaceHolder Indicates the pointer to this <b>OH_ArkUI_SurfaceHolder</b> instance.
1028  * @return Returns the nativeWindow associated with this <b>OH_ArkUI_SurfaceHolder</b> instance.
1029  * @since 16
1030  */
1031 OHNativeWindow* OH_ArkUI_XComponent_GetNativeWindow(OH_ArkUI_SurfaceHolder* surfaceHolder);
1032 
1033 /**
1034  * @brief Set whether the XComponent node needs to initialize automatically.
1035  *
1036  * @param node Indicates the pointer to the XComponent node.
1037  * @param autoInitialize Indicates whether the XComponent node needs to initialize automatically or not.
1038  *        If the value is true, OnSurfaceCreated will be called when the node is mounted and
1039  *        OnSurfaceDestroyed will be called when the node is unmounted.
1040  *        Default value is true.
1041  * @return Returns the status code of the execution.
1042  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.
1043  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} if the node is invalid.
1044  * @since 16
1045  */
1046 int32_t OH_ArkUI_XComponent_SetAutoInitialize(ArkUI_NodeHandle node, bool autoInitialize);
1047 
1048 /**
1049  * @brief Initialize the XComponent node.
1050  *
1051  * @param node Indicates the pointer to the XComponent node.
1052  * @return Returns the status code of the execution.
1053  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.
1054  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} if the node is invalid.
1055  *         {@link ARKUI_ERROR_CODE_XCOMPONENT_STATE_INVALID} if the node has initialized.
1056  * @since 16
1057  */
1058 int32_t OH_ArkUI_XComponent_Initialize(ArkUI_NodeHandle node);
1059 
1060 /**
1061  * @brief Finalize the XComponent node.
1062  *
1063  * @param node Indicates the pointer to the XComponent node.
1064  * @return Returns the status code of the execution.
1065  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.
1066  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} if the node is invalid.
1067  *         {@link ARKUI_ERROR_CODE_XCOMPONENT_STATE_INVALID} if the node has finalized.
1068  * @since 16
1069  */
1070 int32_t OH_ArkUI_XComponent_Finalize(ArkUI_NodeHandle node);
1071 
1072 /**
1073  * @brief Obtains whether the XComponent node has initalized or not.
1074  *
1075  * @param node Indicates the pointer to the XComponent node.
1076  * @param isInitialized Indicates whether the XComponent node has initalized.
1077  * @return Returns the status code of the execution.
1078  *         {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.
1079  *         {@link ARKUI_ERROR_CODE_PARAM_INVALID} if the node is invalid.
1080  * @since 16
1081  */
1082 int32_t OH_ArkUI_XComponent_IsInitialized(ArkUI_NodeHandle node, bool* isInitialized);
1083 
1084 #ifdef __cplusplus
1085 };
1086 #endif
1087 #endif // _NATIVE_INTERFACE_XCOMPONENT_H_
1088