ohos_sys/
lib.rs

1//! Ohos-sys
2//!
3//! This crate provides Raw FFI bindings to the native API of OpenHarmonyOS (`target_env = "ohos"`).
4//! Each module corresponds to one OpenHarmony API feature, and is gated behind a cargo feature.
5//! If you are an application developer, you probably do not want to use this crate directly,
6//! and instead want to use a higher-level API built on top of this crate.
7//!
8//! Note: There are currently still quite a few missing bindings, which will slowly be added.
9//!
10//! ## Feature flags
11#![cfg_attr(
12    feature = "document-features",
13    cfg_attr(doc, doc = ::document_features::document_features!())
14)]
15#![cfg_attr(docsrs, feature(doc_cfg))]
16
17#[cfg(feature = "arkui")]
18#[cfg_attr(docsrs, doc(cfg(feature = "arkui")))]
19pub use arkui_sys as arkui;
20
21#[cfg(feature = "deviceinfo")]
22#[cfg_attr(docsrs, doc(cfg(feature = "deviceinfo")))]
23pub use ohos_deviceinfo_sys as deviceinfo;
24
25#[cfg(feature = "drawing")]
26#[cfg_attr(docsrs, doc(cfg(feature = "drawing")))]
27pub use ohos_drawing_sys as drawing;
28
29#[cfg(feature = "hilog")]
30#[cfg_attr(docsrs, doc(cfg(feature = "hilog")))]
31pub use hilog_sys as hilog;
32
33#[cfg(feature = "hitrace")]
34#[cfg_attr(docsrs, doc(cfg(feature = "hitrace")))]
35pub use hitrace_sys as hitrace;
36
37#[cfg(feature = "inputmethod")]
38#[cfg_attr(docsrs, doc(cfg(feature = "inputmethod")))]
39pub use ohos_ime_sys as inputmethod;
40
41#[cfg(feature = "multimodal-input")]
42#[cfg_attr(docsrs, doc(cfg(feature = "multimodal-input")))]
43pub use ohos_input_sys as multimodal_input;
44
45pub mod multimedia;
46
47#[cfg(feature = "napi")]
48#[cfg_attr(docsrs, doc(cfg(feature = "napi")))]
49pub mod napi;
50
51#[cfg(feature = "abilitykit")]
52#[cfg_attr(docsrs, doc(cfg(feature = "abilitykit")))]
53pub use ohos_abilitykit_sys as abilitykit;
54
55#[cfg(feature = "pasteboard")]
56#[cfg_attr(docsrs, doc(cfg(feature = "pasteboard")))]
57pub use ohos_pasteboard_sys as pasteboard;
58
59#[cfg(feature = "rawfile")]
60#[cfg_attr(docsrs, doc(cfg(feature = "rawfile")))]
61pub use ohos_rawfile_sys as rawfile;
62
63#[cfg(feature = "udmf")]
64#[cfg_attr(docsrs, doc(cfg(feature = "udmf")))]
65pub use udmf_sys as udmf;
66
67#[cfg(feature = "native_buffer")]
68#[cfg_attr(docsrs, doc(cfg(feature = "native_buffer")))]
69pub use ohos_window_sys::native_buffer;
70
71#[cfg(feature = "native_image")]
72#[cfg_attr(docsrs, doc(cfg(feature = "native_image")))]
73pub use ohos_window_sys::native_image;
74
75#[cfg(feature = "native_window")]
76#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))]
77pub use ohos_window_sys::native_window;
78
79// It's just one function, so we don't feature guard this.
80pub mod syscap;
81
82#[cfg(feature = "vsync")]
83#[cfg_attr(docsrs, doc(cfg(feature = "vsync")))]
84pub use ohos_vsync_sys as vsync;
85
86#[cfg(feature = "xcomponent")]
87#[cfg_attr(docsrs, doc(cfg(feature = "xcomponent")))]
88pub use xcomponent_sys as xcomponent;
89
90#[cfg(feature = "window_manager")]
91#[cfg_attr(docsrs, doc(cfg(feature = "window_manager")))]
92pub use ohos_window_manager_sys as window_manager;