ohos-abilitykit-sys 0.1.5

Bindings to the Abilitykit 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)]
use crate::base::common::AbilityBaseResult;

/// Indicates information of element.
///
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct AbilityBase_Element {
    /// Indicates the name of application.
    pub bundleName: *mut ::core::ffi::c_char,
    /// Indicates the name of module.
    pub moduleName: *mut ::core::ffi::c_char,
    /// Indicates the name of ability.
    pub abilityName: *mut ::core::ffi::c_char,
}
#[repr(C)]
pub struct AbilityBase_Want {
    _unused: [u8; 0],
}
extern "C" {
    /// Create want.
    ///
    /// # Arguments
    ///
    /// * `element` - Information of element.
    ///
    /// # Returns
    ///
    /// * Returns the newly created AbilityBase_Want object.
    ///
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_CreateWant(element: AbilityBase_Element) -> *mut AbilityBase_Want;
    /// Destroy input want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want to be deleted.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the want is invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_DestroyWant(want: *mut AbilityBase_Want) -> AbilityBaseResult;
    /// Set want element.
    ///
    /// # Arguments
    ///
    /// * `want` - The want that needs to be set element.
    ///
    /// * `element` - Information of element.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the want is invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_SetWantElement(
        want: *mut AbilityBase_Want,
        element: AbilityBase_Element,
    ) -> AbilityBaseResult;
    /// Get want element.
    ///
    /// # Arguments
    ///
    /// * `want` - The want for the element that has been obtained.
    ///
    /// * `element` - The element obtained from want.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the want or element is invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_GetWantElement(
        want: *mut AbilityBase_Want,
        element: *mut AbilityBase_Element,
    ) -> AbilityBaseResult;
    /// Set want char param.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to be set char param.
    ///
    /// * `key` - The key of char param.
    ///
    /// * `value` - The value of char param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_SetWantCharParam(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: *const ::core::ffi::c_char,
    ) -> AbilityBaseResult;
    /// Get want char param.
    ///
    /// # Arguments
    ///
    /// * `want` - The want for the char param that has been obtained.
    ///
    /// * `key` - The key of char param.
    ///
    /// * `value` - The value of char param.
    ///
    /// * `valueSize` - Size of the value.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_GetWantCharParam(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: *mut ::core::ffi::c_char,
        valueSize: usize,
    ) -> AbilityBaseResult;
    /// Add fd to want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to be add fd.
    ///
    /// * `key` - The key of the fd.
    ///
    /// * `fd` - File Descriptor.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_AddWantFd(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        fd: i32,
    ) -> AbilityBaseResult;
    /// Get fd from want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want that includes fd.
    ///
    /// * `key` - The key of the fd.
    ///
    /// * `fd` - File Descriptor.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_AbilityBase_GetWantFd(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        fd: *mut i32,
    ) -> AbilityBaseResult;
    /// Set uri to want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to set uri.
    ///
    /// * `uri` - The uri of the want.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_SetWantUri(
        want: *mut AbilityBase_Want,
        uri: *const ::core::ffi::c_char,
    ) -> AbilityBaseResult;
    /// Get uri from want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want that includes uri.
    ///
    /// * `uri` - The uri of the want.
    ///
    /// * `uriSize` - Size of the uri.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_GetWantUri(
        want: *mut AbilityBase_Want,
        uri: *mut ::core::ffi::c_char,
        uriSize: usize,
    ) -> AbilityBaseResult;
    /// Set int32_t to want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to set int32_t value.
    ///
    /// * `key` - The key of int32_t param.
    ///
    /// * `value` - The value of int32_t param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_SetWantInt32Param(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: i32,
    ) -> AbilityBaseResult;
    /// Get int32_t from want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want includes int32_t value.
    ///
    /// * `key` - The key of int32_t param.
    ///
    /// * `value` - The value of int32_t param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_GetWantInt32Param(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: *mut i32,
    ) -> AbilityBaseResult;
    /// Set bool to want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to set bool value.
    ///
    /// * `key` - The key of bool param.
    ///
    /// * `value` - The value of bool param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_SetWantBoolParam(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: bool,
    ) -> AbilityBaseResult;
    /// Get bool from want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to set bool value.
    ///
    /// * `key` - The key of bool param.
    ///
    /// * `value` - The value of bool param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_GetWantBoolParam(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: *mut bool,
    ) -> AbilityBaseResult;
    /// Set double to want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to set double value.
    ///
    /// * `key` - The key of double param.
    ///
    /// * `value` - The value of double param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_SetWantDoubleParam(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: f64,
    ) -> AbilityBaseResult;
    /// Get double from want.
    ///
    /// # Arguments
    ///
    /// * `want` - The want needs to set double value.
    ///
    /// * `key` - The key of double param.
    ///
    /// * `value` - The value of double param.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
    ///
    /// Available since API-level: 17
    #[cfg(feature = "api-17")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
    pub fn OH_AbilityBase_GetWantDoubleParam(
        want: *mut AbilityBase_Want,
        key: *const ::core::ffi::c_char,
        value: *mut f64,
    ) -> AbilityBaseResult;
}