ohos-basic-services-kit-sys 0.1.0

Raw bindings to the BasicServicesKit NDK of OpenHarmony
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

/// A string that identifies the common event sent after battery capacity changes.
///
/// Available since API-level: 13
///
/// Version: 1.0
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub const COMMON_EVENT_KEY_CAPACITY: &::core::ffi::CStr = c"soc";
/// A string that identifies the common event sent after charge state changes.
///
/// Available since API-level: 13
///
/// Version: 1.0
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub const COMMON_EVENT_KEY_CHARGE_STATE: &::core::ffi::CStr = c"chargeState";
/// A string that identifies the common event sent after plugged type changes.
///
/// Available since API-level: 13
///
/// Version: 1.0
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub const COMMON_EVENT_KEY_PLUGGED_TYPE: &::core::ffi::CStr = c"pluggedType";
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl BatteryInfo_BatteryPluggedType {
    /// Power source is unplugged.
    pub const PLUGGED_TYPE_NONE: BatteryInfo_BatteryPluggedType = BatteryInfo_BatteryPluggedType(0);
    /// Power source is an AC charger.
    pub const PLUGGED_TYPE_AC: BatteryInfo_BatteryPluggedType = BatteryInfo_BatteryPluggedType(1);
    /// Power source is a USB DC charger.
    pub const PLUGGED_TYPE_USB: BatteryInfo_BatteryPluggedType = BatteryInfo_BatteryPluggedType(2);
    /// Power source is wireless charger.
    pub const PLUGGED_TYPE_WIRELESS: BatteryInfo_BatteryPluggedType =
        BatteryInfo_BatteryPluggedType(3);
    /// The bottom of the enum.
    pub const PLUGGED_TYPE_BUTT: BatteryInfo_BatteryPluggedType = BatteryInfo_BatteryPluggedType(4);
}
#[repr(transparent)]
/// Defines plugged types.
///
///
/// Available since API-level: 13
///
/// Version: 1.0
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct BatteryInfo_BatteryPluggedType(pub ::core::ffi::c_uint);
extern "C" {
    /// This API returns the current battery capacity.
    ///
    ///
    /// # Returns
    ///
    /// * Returns number between 0 and 100.
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_BatteryInfo_GetCapacity() -> i32;
    /// This API returns the current plugged type.
    ///
    ///
    /// # Returns
    ///
    /// * [`BatteryInfo_BatteryPluggedType#PLUGGED_TYPE_NONE`] if the power source is unplugged.
    /// [`PLUGGED_TYPE_AC`] if the power source is an AC charger.
    /// [`PLUGGED_TYPE_USB`] if the power source is an USB DC charger.
    /// [`PLUGGED_TYPE_WIRELESS`] if the power source is wireless charger.
    /// [`PLUGGED_TYPE_BUTT`] if the type is unknown.
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_BatteryInfo_GetPluggedType() -> BatteryInfo_BatteryPluggedType;
}