arkui_sys/native_node_napi/native_node_napi_ffi.rs
1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use crate::drawable_descriptor::ArkUI_DrawableDescriptor;
7use crate::native_type::*;
8#[cfg(feature = "api-12")]
9use ohos_sys_opaque_types::ArkUI_ContextHandle;
10use ohos_sys_opaque_types::{napi_env, napi_value};
11
12extern "C" {
13 /// Obtains a <b>FrameNode</b> object on the ArkTS side and maps it to an <b>ArkUI_NodeHandle</b> object on the
14 /// native side.
15 ///
16 /// # Arguments
17 ///
18 /// * `env` - Indicates the NAPI environment pointer.
19 ///
20 /// * `frameNode` - Indicates the <b>FrameNode</b> object created on the ArkTS side.
21 ///
22 /// * `handle` - Indicates the pointer to the <b>ArkUI_NodeHandle</b> object.
23 ///
24 /// # Returns
25 ///
26 /// * Returns the error code.
27 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
28 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
29 ///
30 /// Available since API-level: 12
31 #[cfg(feature = "api-12")]
32 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
33 pub fn OH_ArkUI_GetNodeHandleFromNapiValue(
34 env: napi_env,
35 frameNode: napi_value,
36 handle: *mut ArkUI_NodeHandle,
37 ) -> i32;
38 /// Obtains a <b>UIContext</b> object on the ArkTS side and maps it to an <b>ArkUI_ContextHandle</b> object on the
39 /// native side.
40 ///
41 /// # Arguments
42 ///
43 /// * `env` - ndicates the NAPI environment pointer.
44 ///
45 /// * `value` - Indicates the <b>UIContext</b> object created on the ArkTS side.
46 ///
47 /// * `context` - Indicates the pointer to the <b>ArkUI_ContextHandle</b> object.
48 ///
49 /// # Returns
50 ///
51 /// * Returns the error code.
52 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
53 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
54 ///
55 /// Available since API-level: 12
56 #[cfg(feature = "api-12")]
57 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
58 pub fn OH_ArkUI_GetContextFromNapiValue(
59 env: napi_env,
60 value: napi_value,
61 context: *mut ArkUI_ContextHandle,
62 ) -> i32;
63 /// Obtains a <b>NodeContent</b> object on the ArkTS side and maps it to an <b>ArkUI_NodeContentHandle</b>
64 /// object on the native side.
65 ///
66 /// # Arguments
67 ///
68 /// * `env` - ndicates the NAPI environment pointer.
69 ///
70 /// * `value` - Indicates the <b>NodeContent</b> object created on the ArkTS side.
71 ///
72 /// * `content` - Indicates the pointer to the <b>ArkUI_NodeContentHandle</b> object.
73 ///
74 /// # Returns
75 ///
76 /// * Returns the error code.
77 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
78 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
79 ///
80 /// Available since API-level: 12
81 #[cfg(feature = "api-12")]
82 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
83 pub fn OH_ArkUI_GetNodeContentFromNapiValue(
84 env: napi_env,
85 value: napi_value,
86 content: *mut ArkUI_NodeContentHandle,
87 ) -> i32;
88 /// Obtains a <b>DrawableDescriptor</b> object on the ArkTS side and maps it to an
89 /// <b>ArkUI_DrawableDescriptro</b> object on the native side.
90 ///
91 /// # Arguments
92 ///
93 /// * `env` - Indicates the NAPI environment pointer.
94 ///
95 /// * `value` - Indicates the <b>DrawableDescriptor</b> object created on the ArkTS side.
96 ///
97 /// * `drawableDescriptor` - Indicates the pointer to the <b>ArkUI_DrawableDescriptro</b> object.
98 ///
99 /// # Returns
100 ///
101 /// * Returns the error code.
102 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
103 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
104 ///
105 /// Available since API-level: 12
106 #[cfg(feature = "api-12")]
107 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
108 pub fn OH_ArkUI_GetDrawableDescriptorFromNapiValue(
109 env: napi_env,
110 value: napi_value,
111 drawableDescriptor: *mut *mut ArkUI_DrawableDescriptor,
112 ) -> i32;
113 /// Obtains a <b>Resource</b> object on the ArkTS side and maps it to an
114 /// <b>ArkUI_DrawableDescriptro</b> object on the native side.
115 ///
116 /// # Arguments
117 ///
118 /// * `env` - Indicates the NAPI environment pointer.
119 ///
120 /// * `value` - Indicates the <b>Resource</b> object created on the ArkTS side.
121 ///
122 /// * `drawableDescriptor` - Indicates the pointer to the <b>ArkUI_DrawableDescriptro</b> object.
123 ///
124 /// # Returns
125 ///
126 /// * Returns the error code.
127 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
128 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
129 ///
130 /// Available since API-level: 12
131 #[cfg(feature = "api-12")]
132 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
133 pub fn OH_ArkUI_GetDrawableDescriptorFromResourceNapiValue(
134 env: napi_env,
135 value: napi_value,
136 drawableDescriptor: *mut *mut ArkUI_DrawableDescriptor,
137 ) -> i32;
138 /// Obtain the ID of the Navigation component where the node is located.
139 ///
140 /// # Arguments
141 ///
142 /// * `node` - The node.
143 ///
144 /// * `buffer` - The buffer to which NavigationID writes to the memory,
145 /// memory space needs to be allocated by the developer.
146 ///
147 /// * `bufferSize` - The buffer size
148 ///
149 /// * `writeLength` - Indicates the string length actually written to the buffer
150 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
151 /// Indicates the minimum buffer size that can accommodate the target
152 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
153 ///
154 /// # Returns
155 ///
156 /// * The error code.
157 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
158 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
159 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
160 /// this may be because the node is not in Navigation.
161 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
162 ///
163 /// Available since API-level: 12
164 #[cfg(feature = "api-12")]
165 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
166 pub fn OH_ArkUI_GetNavigationId(
167 node: ArkUI_NodeHandle,
168 buffer: *mut ::core::ffi::c_char,
169 bufferSize: i32,
170 writeLength: *mut i32,
171 ) -> ArkUiResult;
172 /// Obtain the name of the NavDestination component where the node is located.
173 ///
174 /// # Arguments
175 ///
176 /// * `node` - The node.
177 ///
178 /// * `buffer` - The buffer to which NavDestination name writes to the memory,
179 /// memory space needs to be allocated by the developer.
180 ///
181 /// * `bufferSize` - The buffer size
182 ///
183 /// * `writeLength` - Indicates the string length actually written to the buffer
184 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
185 /// Indicates the minimum buffer size that can accommodate the target
186 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
187 ///
188 /// # Returns
189 ///
190 /// * The error code.
191 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
192 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
193 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
194 /// this may be because the node is not in Navigation.
195 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
196 ///
197 /// Available since API-level: 12
198 #[cfg(feature = "api-12")]
199 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
200 pub fn OH_ArkUI_GetNavDestinationName(
201 node: ArkUI_NodeHandle,
202 buffer: *mut ::core::ffi::c_char,
203 bufferSize: i32,
204 writeLength: *mut i32,
205 ) -> ArkUiResult;
206 /// Based on the given index value, obtain the length of the Navigation stack where the node is located.
207 ///
208 /// # Arguments
209 ///
210 /// * `node` - The node.
211 ///
212 /// * `length` - The length of the stack. After the operation succeeds, the result is written back to this parameter.
213 ///
214 /// # Returns
215 ///
216 /// * The error code.
217 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
218 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or length is null.
219 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
220 /// this may be because the node is not in Navigation.
221 ///
222 /// Available since API-level: 12
223 #[cfg(feature = "api-12")]
224 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
225 pub fn OH_ArkUI_GetNavStackLength(node: ArkUI_NodeHandle, length: *mut i32) -> ArkUiResult;
226 /// Based on the given index value, obtain the page name of the corresponding position
227 /// in the navigation stack where the node is located.
228 /// Index values are counted from 0, with 0 being the bottom of the stack.
229 ///
230 /// # Arguments
231 ///
232 /// * `node` - The node.
233 ///
234 /// * `index` - The index of the NavDestination in the stack is queried.
235 ///
236 /// * `buffer` - The buffer to which NavDestination index writes to the memory,
237 /// memory space needs to be allocated by the developer.
238 ///
239 /// * `bufferSize` - The buffer size
240 ///
241 /// * `writeLength` - Indicates the string length actually written to the buffer
242 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
243 /// Indicates the minimum buffer size that can accommodate the target
244 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
245 ///
246 /// # Returns
247 ///
248 /// * The error code.
249 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
250 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
251 /// [`ARKUI_ERROR_CODE_NODE_INDEX_INVALID`] if index is an invalid value.
252 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
253 /// this may be because the node is not in Navigation.
254 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
255 ///
256 /// Available since API-level: 12
257 #[cfg(feature = "api-12")]
258 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
259 pub fn OH_ArkUI_GetNavDestinationNameByIndex(
260 node: ArkUI_NodeHandle,
261 index: i32,
262 buffer: *mut ::core::ffi::c_char,
263 bufferSize: i32,
264 writeLength: *mut i32,
265 ) -> ArkUiResult;
266 /// Obtain the ID of the NavDestination component where the node is located.
267 ///
268 /// # Arguments
269 ///
270 /// * `node` - The node.
271 ///
272 /// * `buffer` - The buffer to which NavDestination ID writes to the memory,
273 /// memory space needs to be allocated by the developer.
274 ///
275 /// * `bufferSize` - The buffer size
276 ///
277 /// * `writeLength` - Indicates the string length actually written to the buffer
278 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
279 /// Indicates the minimum buffer size that can accommodate the target
280 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
281 ///
282 /// # Returns
283 ///
284 /// * The error code.
285 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
286 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
287 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
288 /// this may be because the node is not in Navigation.
289 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
290 ///
291 /// Available since API-level: 12
292 #[cfg(feature = "api-12")]
293 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
294 pub fn OH_ArkUI_GetNavDestinationId(
295 node: ArkUI_NodeHandle,
296 buffer: *mut ::core::ffi::c_char,
297 bufferSize: i32,
298 writeLength: *mut i32,
299 ) -> ArkUiResult;
300 /// Obtain the state of the NavDestination component where the node is located.
301 ///
302 /// # Arguments
303 ///
304 /// * `node` - The node.
305 ///
306 /// * `state` - The state value of NavDestination is written back into this parameter.
307 ///
308 /// # Returns
309 ///
310 /// * The error code.
311 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
312 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or state is null.
313 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
314 /// this may be because the node is not in Navigation.
315 ///
316 /// Available since API-level: 12
317 #[cfg(feature = "api-12")]
318 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
319 pub fn OH_ArkUI_GetNavDestinationState(
320 node: ArkUI_NodeHandle,
321 state: *mut ArkUI_NavDestinationState,
322 ) -> ArkUiResult;
323 /// Obtain the index of the NavDestination component on the Navigation stack where the node is located.
324 ///
325 /// # Arguments
326 ///
327 /// * `node` - The node.
328 ///
329 /// * `index` - Index value, counted from 0.
330 ///
331 /// # Returns
332 ///
333 /// * The error code.
334 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
335 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or index is null.
336 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
337 /// this may be because the node is not in Navigation.
338 ///
339 /// Available since API-level: 12
340 #[cfg(feature = "api-12")]
341 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
342 pub fn OH_ArkUI_GetNavDestinationIndex(node: ArkUI_NodeHandle, index: *mut i32) -> ArkUiResult;
343 /// Obtain the parameters of the NavDestination component where the node is located.
344 ///
345 /// # Arguments
346 ///
347 /// * `node` - The node.
348 ///
349 /// # Returns
350 ///
351 /// * The parameters.
352 /// If a null pointer is returned, it may be because the node is empty or the parameters does not exist.
353 ///
354 /// Available since API-level: 12
355 #[cfg(feature = "api-12")]
356 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
357 pub fn OH_ArkUI_GetNavDestinationParam(node: ArkUI_NodeHandle) -> napi_value;
358 /// Obtain the index of the page where the node resides in the Router page stack.
359 ///
360 /// # Arguments
361 ///
362 /// * `node` - The node.
363 ///
364 /// * `index` - Index value, counted from 1.
365 ///
366 /// # Returns
367 ///
368 /// * The error code.
369 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
370 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or index is null.
371 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
372 /// this may be because the node is not in RouterPage.
373 ///
374 /// Available since API-level: 12
375 #[cfg(feature = "api-12")]
376 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
377 pub fn OH_ArkUI_GetRouterPageIndex(node: ArkUI_NodeHandle, index: *mut i32) -> ArkUiResult;
378 /// Obtain the name of the page where the node is located.
379 ///
380 /// # Arguments
381 ///
382 /// * `node` - The node.
383 ///
384 /// * `buffer` - The buffer to which page name writes to the memory,
385 /// memory space needs to be allocated by the developer.
386 ///
387 /// * `bufferSize` - The buffer size
388 ///
389 /// * `writeLength` - Indicates the string length actually written to the buffer
390 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
391 /// Indicates the minimum buffer size that can accommodate the target
392 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
393 ///
394 /// # Returns
395 ///
396 /// * The error code.
397 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
398 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
399 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
400 /// this may be because the node is not in RouterPage.
401 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
402 ///
403 /// Available since API-level: 12
404 #[cfg(feature = "api-12")]
405 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
406 pub fn OH_ArkUI_GetRouterPageName(
407 node: ArkUI_NodeHandle,
408 buffer: *mut ::core::ffi::c_char,
409 bufferSize: i32,
410 writeLength: *mut i32,
411 ) -> ArkUiResult;
412 /// Obtain the path of the page where the node is located.
413 ///
414 /// # Arguments
415 ///
416 /// * `node` - The node.
417 ///
418 /// * `buffer` - The buffer to which page path writes to the memory,
419 /// memory space needs to be allocated by the developer.
420 ///
421 /// * `bufferSize` - The buffer size
422 ///
423 /// * `writeLength` - Indicates the string length actually written to the buffer
424 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
425 /// Indicates the minimum buffer size that can accommodate the target
426 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
427 ///
428 /// # Returns
429 ///
430 /// * The error code.
431 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
432 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
433 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
434 /// this may be because the node is not in RouterPage.
435 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
436 ///
437 /// Available since API-level: 12
438 #[cfg(feature = "api-12")]
439 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
440 pub fn OH_ArkUI_GetRouterPagePath(
441 node: ArkUI_NodeHandle,
442 buffer: *mut ::core::ffi::c_char,
443 bufferSize: i32,
444 writeLength: *mut i32,
445 ) -> ArkUiResult;
446 /// Obtain the state of the page where the node is located.
447 ///
448 /// # Arguments
449 ///
450 /// * `node` - The node.
451 ///
452 /// * `state` - The state value of the page is written back to this parameter.
453 ///
454 /// # Returns
455 ///
456 /// * The error code.
457 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
458 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node or state is null.
459 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
460 /// this may be because the node is not in RouterPage.
461 ///
462 /// Available since API-level: 12
463 #[cfg(feature = "api-12")]
464 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
465 pub fn OH_ArkUI_GetRouterPageState(
466 node: ArkUI_NodeHandle,
467 state: *mut ArkUI_RouterPageState,
468 ) -> ArkUiResult;
469 /// Obtain the ID of the page where the node is located.
470 ///
471 /// # Arguments
472 ///
473 /// * `node` - The node.
474 ///
475 /// * `buffer` - The buffer to which page ID writes to the memory,
476 /// memory space needs to be allocated by the developer.
477 ///
478 /// * `bufferSize` - The buffer size
479 ///
480 /// * `writeLength` - Indicates the string length actually written to the buffer
481 /// when returning [`ARKUI_ERROR_CODE_NO_ERROR`].
482 /// Indicates the minimum buffer size that can accommodate the target
483 /// when [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] is returned.
484 ///
485 /// # Returns
486 ///
487 /// * The error code.
488 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
489 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if the node, buffer or writeLength is null.
490 /// [`ARKUI_ERROR_CODE_GET_INFO_FAILED`] if query information failed,
491 /// this may be because the node is not in RouterPage.
492 /// [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] If the buffer size is less than the minimum buffer size.
493 ///
494 /// Available since API-level: 12
495 #[cfg(feature = "api-12")]
496 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
497 pub fn OH_ArkUI_GetRouterPageId(
498 node: ArkUI_NodeHandle,
499 buffer: *mut ::core::ffi::c_char,
500 bufferSize: i32,
501 writeLength: *mut i32,
502 ) -> ArkUiResult;
503 /// Register a callback to be executed when rendering in the next frame. Cannot be called on
504 /// the non-UI thread. Checking for non-UI thread calls will abort.
505 ///
506 /// # Arguments
507 ///
508 /// * `uiContext` - ArkUI_ContextHandle.
509 ///
510 /// * `userData` - Indicates the custom data to be saved.
511 ///
512 /// * `callback` - Custom callback function.
513 ///
514 /// * `nanoTimestamp` - Timestamp of frame signal.
515 ///
516 /// * `frameCount` - Frame count.
517 ///
518 /// # Returns
519 ///
520 /// * Returns the result code.
521 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
522 /// Returns [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
523 /// Returns [`ARKUI_ERROR_CODE_UI_CONTEXT_INVALID`] if the uiContext is invalid.
524 /// Returns [`ARKUI_ERROR_CODE_CALLBACK_INVALID`] if the callback function is invalid.
525 ///
526 /// Available since API-level: 18
527 #[cfg(feature = "api-18")]
528 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
529 pub fn OH_ArkUI_PostFrameCallback(
530 uiContext: ArkUI_ContextHandle,
531 userData: *mut ::core::ffi::c_void,
532 callback: ::core::option::Option<
533 unsafe extern "C" fn(
534 nanoTimestamp: u64,
535 frameCount: u32,
536 userData: *mut ::core::ffi::c_void,
537 ),
538 >,
539 ) -> i32;
540 /// Initialize the ArkTS method for the specified env environment. Cannot be called on
541 /// the non-UI thread. Checking for non-UI thread calls will abort.
542 ///
543 /// # Arguments
544 ///
545 /// * `env` - napi environment pointer.
546 ///
547 /// # Returns
548 ///
549 /// * The error code.
550 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
551 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if env is null or failed to set the whitelist.
552 /// [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
553 ///
554 /// Available since API-level: 20
555 #[cfg(feature = "api-20")]
556 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
557 pub fn OH_ArkUI_InitModuleForArkTSEnv(env: napi_env) -> ArkUiResult;
558 /// Notify the specified env environment is invalid. Cannot be called on
559 /// the non-UI thread. Checking for non-UI thread calls will abort.
560 ///
561 /// # Arguments
562 ///
563 /// * `env` - napi environment pointer.
564 ///
565 /// Available since API-level: 20
566 #[cfg(feature = "api-20")]
567 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
568 pub fn OH_ArkUI_NotifyArkTSEnvDestroy(env: napi_env);
569 /// Register a callback to be executed at the end of the next idle frame.
570 /// If there is no next frame, will request one automatically.
571 ///
572 /// # Arguments
573 ///
574 /// * `uiContext` - ArkUI_ContextHandle.
575 ///
576 /// * `userData` - Indicates the custom data to be saved.
577 ///
578 /// * `callback` - Custom callback function.
579 ///
580 /// * `nanoTimeLeft` - Time remaining until the end of the current frame.
581 ///
582 /// * `frameCount` - Frame count.
583 ///
584 /// # Returns
585 ///
586 /// * Returns the result code.
587 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
588 /// Returns [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
589 /// Returns [`ARKUI_ERROR_CODE_UI_CONTEXT_INVALID`] if the uiContext is invalid.
590 /// Returns [`ARKUI_ERROR_CODE_CALLBACK_INVALID`] if the callback function is invalid.
591 ///
592 /// Available since API-level: 20
593 #[cfg(feature = "api-20")]
594 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
595 pub fn OH_ArkUI_PostIdleCallback(
596 uiContext: ArkUI_ContextHandle,
597 userData: *mut ::core::ffi::c_void,
598 callback: ::core::option::Option<
599 unsafe extern "C" fn(
600 nanoTimeLeft: u64,
601 frameCount: u32,
602 userData: *mut ::core::ffi::c_void,
603 ),
604 >,
605 ) -> i32;
606}