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}
20#[repr(transparent)]
21/// Defines the native API types.
22///
23///
24/// Available since API-level: 12
25#[cfg(feature = "api-12")]
26#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
27#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
28pub struct ArkUI_NativeAPIVariantKind(pub ::core::ffi::c_uint);
29extern "C" {
30    /// Obtains the native API set of a specified type.
31    ///
32    /// # Arguments
33    ///
34    /// * `type` - Indicates the type of the native API set provided by ArkUI, for example, <b>ARKUI_NATIVE_NODE</b>
35    /// and <b>ARKUI_NATIVE_GESTURE</b>.
36    ///
37    /// * `structName` - Indicates the name of a native struct defined in the corresponding header file, for example,
38    /// <b>ArkUI_NativeNodeAPI_1</b> in <arkui/native_node.h>.
39    ///
40    /// # Returns
41    ///
42    /// * Returns the pointer to the abstract native API, which can be used after being converted into a specific type.
43    /// ```cpp
44    /// #include<arkui/native_interface.h>
45    /// #include<arkui/native_node.h>
46    /// #include<arkui/native_gesture.h>
47    ///
48    /// auto* anyNativeAPI = OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1");
49    /// if (anyNativeAPI) {
50    /// auto nativeNodeApi = reinterpret_cast<ArkUI_NativeNodeAPI_1*>(anyNativeAPI);
51    /// }
52    /// auto anyGestureAPI = OH_ArkUI_QueryModuleInterface(ARKUI_NATIVE_GESTURE, "ArkUI_NativeGestureAPI_1");
53    /// if (anyNativeAPI) {
54    /// auto basicGestureApi = reinterpret_cast<ArkUI_NativeGestureAPI_1*>(anyGestureAPI);
55    /// }
56    /// ```
57    ///
58    ///
59    /// Available since API-level: 12
60    #[cfg(feature = "api-12")]
61    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
62    pub fn OH_ArkUI_QueryModuleInterfaceByName(
63        type_: ArkUI_NativeAPIVariantKind,
64        structName: *const ::core::ffi::c_char,
65    ) -> *mut ::core::ffi::c_void;
66}