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