Skip to main content

arkui_sys/native_interface/
native_interface_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::native_type::*;
7
8#[cfg(feature = "api-12")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
10impl ArkUI_NativeAPIVariantKind {
11    /// API related to UI components. For details, see the struct definition in <arkui/native_node.h>.
12    pub const ARKUI_NATIVE_NODE: ArkUI_NativeAPIVariantKind = ArkUI_NativeAPIVariantKind(0);
13    /// API related to dialog boxes. For details, see the struct definition in <arkui/native_dialog.h>.
14    pub const ARKUI_NATIVE_DIALOG: ArkUI_NativeAPIVariantKind = ArkUI_NativeAPIVariantKind(1);
15    /// API related to gestures. For details, see the struct definition in <arkui/native_gesture.h>.
16    pub const ARKUI_NATIVE_GESTURE: ArkUI_NativeAPIVariantKind = ArkUI_NativeAPIVariantKind(2);
17    /// API related to animations. For details, see the struct definition in <arkui/native_animate.h>.
18    pub const ARKUI_NATIVE_ANIMATE: ArkUI_NativeAPIVariantKind = ArkUI_NativeAPIVariantKind(3);
19    /// API related to supported multi thread UI components.
20    /// For details, see the struct definition in <arkui/native_node.h>.
21    ///
22    /// Available since API-level: 22
23    #[cfg(feature = "api-22")]
24    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
25    pub const ARKUI_MULTI_THREAD_NATIVE_NODE: ArkUI_NativeAPIVariantKind =
26        ArkUI_NativeAPIVariantKind(4);
27}
28#[repr(transparent)]
29/// Defines the native API types.
30///
31///
32/// Available since API-level: 12
33#[cfg(feature = "api-12")]
34#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
35#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
36pub struct ArkUI_NativeAPIVariantKind(pub ::core::ffi::c_uint);
37extern "C" {
38    /// Obtains the native API set of a specified type.
39    ///
40    /// # Arguments
41    ///
42    /// * `type` - Indicates the type of the native API set provided by ArkUI, for example, <b>ARKUI_NATIVE_NODE</b>
43    /// and <b>ARKUI_NATIVE_GESTURE</b>.
44    ///
45    /// * `structName` - Indicates the name of a native struct defined in the corresponding header file, for example,
46    /// <b>ArkUI_NativeNodeAPI_1</b> in <arkui/native_node.h>.
47    ///
48    /// # Returns
49    ///
50    /// * Returns the pointer to the abstract native API, which can be used after being converted into a specific type.
51    /// ```cpp
52    /// #include<arkui/native_interface.h>
53    /// #include<arkui/native_node.h>
54    /// #include<arkui/native_gesture.h>
55    ///
56    /// auto* anyNativeAPI = OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1");
57    /// if (anyNativeAPI) {
58    /// auto nativeNodeApi = reinterpret_cast<ArkUI_NativeNodeAPI_1*>(anyNativeAPI);
59    /// }
60    /// auto anyGestureAPI = OH_ArkUI_QueryModuleInterface(ARKUI_NATIVE_GESTURE, "ArkUI_NativeGestureAPI_1");
61    /// if (anyNativeAPI) {
62    /// auto basicGestureApi = reinterpret_cast<ArkUI_NativeGestureAPI_1*>(anyGestureAPI);
63    /// }
64    /// ```
65    ///
66    ///
67    /// Available since API-level: 12
68    #[cfg(feature = "api-12")]
69    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
70    pub fn OH_ArkUI_QueryModuleInterfaceByName(
71        type_: ArkUI_NativeAPIVariantKind,
72        structName: *const ::core::ffi::c_char,
73    ) -> *mut ::core::ffi::c_void;
74}