// automatically generated by rust-bindgen 0.71.1

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

pub type Location_ResultCode = Result<(), Location_ResultCodeError>;
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl Location_ResultCodeError {
    /// Permission verification failed. The application does not have the
    /// permission required to call the API.
    pub const PERMISSION_DENIED: Location_ResultCodeError =
        Location_ResultCodeError(const { core::num::NonZero::new(201).unwrap() });
    /// Parameter error. Possible reasons: 1. The input parameter is a null pointer;
    ///
    /// 2. Parameter values exceed the defined range.
    pub const INVALID_PARAM: Location_ResultCodeError =
        Location_ResultCodeError(const { core::num::NonZero::new(401).unwrap() });
    /// Capability not supported. Failed to call function due to limited device capabilities.
    pub const NOT_SUPPORTED: Location_ResultCodeError =
        Location_ResultCodeError(const { core::num::NonZero::new(801).unwrap() });
    /// The location service is unavailable.
    /// Possible reasons: Abnormal startup of location services.
    pub const SERVICE_UNAVAILABLE: Location_ResultCodeError =
        Location_ResultCodeError(const { core::num::NonZero::new(3301000).unwrap() });
    /// The location switch is off.
    pub const SWITCH_OFF: Location_ResultCodeError =
        Location_ResultCodeError(const { core::num::NonZero::new(3301100).unwrap() });
}
#[repr(transparent)]
/// Enumerates the location result codes.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Location_ResultCodeError(pub core::num::NonZero<::core::ffi::c_uint>);
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl Location_UseScene {
    /// Indicates the navigation scenario.
    /// This feature applies to outdoor scenarios where real-time device locations need
    /// to be obtained, such as vehicle-mounted and pedestrian navigation.
    /// The GNSS positioning technology is used to provide positioning services, and the
    /// power consumption is high.
    pub const LOCATION_USE_SCENE_NAVIGATION: Location_UseScene = Location_UseScene(1025);
    /// Indicates the sport scenario.
    /// This feature applies to scenarios where user location tracks are recorded,
    /// for example, sports apps. The GNSS positioning technology is used to provide
    /// positioning services, and the power consumption is high.
    pub const LOCATION_USE_SCENE_SPORT: Location_UseScene = Location_UseScene(1026);
    /// Indicates a travel scenario.
    /// This mode applies to travel scenarios, such as taxi and public transportation.
    /// The GNSS positioning technology is used to provide positioning services, and
    /// the power consumption is high.
    pub const LOCATION_USE_SCENE_TRANSPORT: Location_UseScene = Location_UseScene(1027);
    /// Indicates the daily service usage scenario.
    /// This mode applies to scenarios where precise user location is not required,
    /// such as news, online shopping, and ordering applications.
    /// In this scenario, only a network positioning technology is used to provide a
    /// positioning service, and power consumption is relatively low.
    pub const LOCATION_USE_SCENE_DAILY_LIFE_SERVICE: Location_UseScene = Location_UseScene(1028);
}
#[repr(transparent)]
/// Enumeration values of use scenarios.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Location_UseScene(pub ::core::ffi::c_uint);
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl Location_PowerConsumptionScene {
    /// High power consumption.
    /// GNSS positioning technology is mainly used. We will use network positioning
    /// technology to provide services before GNSS provides stable location results;
    /// During continuous positioning, if the GNSS positioning result cannot be obtained
    /// for more than 30 seconds, the network positioning technology is used to obtain
    /// the location. Consumes a large number of hardware resources and power.
    pub const LOCATION_HIGH_POWER_CONSUMPTION: Location_PowerConsumptionScene =
        Location_PowerConsumptionScene(1537);
    /// Low power consumption.
    /// This mode applies to scenarios that do not require high user location precision,
    /// such as news, online shopping, and meal ordering.
    /// In this scenario, only a network positioning technology is used to provide a
    /// positioning service, and power consumption is relatively low.
    pub const LOCATION_LOW_POWER_CONSUMPTION: Location_PowerConsumptionScene =
        Location_PowerConsumptionScene(1538);
    /// No power consumption.
    /// In this scenario, the location is not proactively triggered. The location is
    /// returned to the current app only when other apps are located.
    pub const LOCATION_NO_POWER_CONSUMPTION: Location_PowerConsumptionScene =
        Location_PowerConsumptionScene(1539);
}
#[repr(transparent)]
/// Enumerates the power consumption scenario.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Location_PowerConsumptionScene(pub ::core::ffi::c_uint);
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl Location_SourceType {
    /// The positioning result is based on the GNSS positioning technology.
    pub const LOCATION_SOURCE_TYPE_GNSS: Location_SourceType = Location_SourceType(1);
    /// The positioning result comes from the network positioning technology.
    pub const LOCATION_SOURCE_TYPE_NETWORK: Location_SourceType = Location_SourceType(2);
    /// The positioning result comes from the high-precision indoor positioning technology.
    pub const LOCATION_SOURCE_TYPE_INDOOR: Location_SourceType = Location_SourceType(3);
    /// The positioning result comes from the high-precision positioning technology.
    pub const LOCATION_SOURCE_TYPE_RTK: Location_SourceType = Location_SourceType(4);
}
#[repr(transparent)]
/// Enumerates the source type of location.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Location_SourceType(pub ::core::ffi::c_uint);
/// Defines the location information.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Location_BasicInfo {
    /// Indicates latitude information, with positive values indicating north latitude
    ///
    /// and negative values indicating south latitude. The value range is -90 to 90.
    ///
    /// Only supports WGS84 coordinate system.
    pub latitude: f64,
    /// Indicates longitude information, positive values indicate east longitude,
    ///
    /// and negative values indicate west longitude. The value range is -180 to 180.
    ///
    /// Only supports WGS84 coordinate system.
    pub longitude: f64,
    /// Altitude in meters.
    pub altitude: f64,
    /// Horizontal location accuracy in meters.
    pub accuracy: f64,
    /// Speed in meters per second.
    pub speed: f64,
    /// Heading in degrees. The value range is 0 to 360.
    pub direction: f64,
    /// Timestamp for the location fix. Number of milliseconds since January 1, 1970.
    pub timeForFix: i64,
    /// Time since the system was booted, and include deep sleep. The unit is nanosecond.
    pub timeSinceBoot: i64,
    /// Vertical position accuracy in meters.
    pub altitudeAccuracy: f64,
    /// Speed accuracy in meter per seconds.
    pub speedAccuracy: f64,
    /// Direction accuracy in degrees. The value range is 0 to 360.
    pub directionAccuracy: f64,
    /// Time uncertainty in nanosecond.
    pub uncertaintyOfTimeSinceBoot: i64,
    /// Indicates the source of the location result.
    pub locationSourceType: Location_SourceType,
}
/// Define the structure of location information.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
pub struct Location_Info {
    _unused: [u8; 0],
}
/// Defines the callback function used to report location data.
///
/// # Arguments
///
/// * `location` - - Pointer to the [`Location_Info`] instance. Carry the latest location information.
///
/// The memory of the location instance is recycled at the end of [`Location_InfoCallback`].
///
/// Before that, call [`OH_LocationInfo_GetBasicInfo`] and other interfaces to obtain location information.
///
///
/// * `userData` - - Pointer to an application data structure, this parameter is passed in
///
/// through [`OH_LocationRequestConfig_SetCallback`].
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub type Location_InfoCallback = ::core::option::Option<
    unsafe extern "C" fn(location: *mut Location_Info, userData: *mut ::core::ffi::c_void),
>;
/// Define the structure of location request parameters.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
pub struct Location_RequestConfig {
    _unused: [u8; 0],
}
extern "C" {
    /// Obtain basic location information.
    ///
    /// # Arguments
    ///
    /// * `location` - - Pointer to the location information structure.
    ///
    /// A non-null pointer is required. The pointer can be obtained from [`Location_InfoCallback`].
    ///
    ///
    /// # Returns
    ///
    /// * Return the basic information structure of the location.
    ///
    /// For a detailed definition, please refer to [`Location_BasicInfo`].
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_LocationInfo_GetBasicInfo(location: *mut Location_Info) -> Location_BasicInfo;
    /// Obtain additional information from the location information.
    ///
    /// # Arguments
    ///
    /// * `location` - - Pointer to the location information structure.
    ///
    /// A non-null pointer is required. The pointer can be obtained from [`Location_InfoCallback`].
    ///
    ///
    /// * `additionalInfo` - - Non null pointers of char type; This variable is used to store additional
    ///
    /// information strings. The string is in JSON format.
    ///
    /// The pointer and the corresponding memory are created by the caller.
    ///
    /// You are advised to apply for a memory of 256 bytes or more.
    ///
    /// If a null pointer is passed, an error code is returned.
    ///
    ///
    /// * `length` - - Memory size of additionalInfo.
    ///
    /// # Returns
    ///
    /// * Location functions result code.
    ///
    /// For a detailed definition, please refer to [`Location_ResultCode`].
    ///
    /// [`LOCAION_SUCCESS`] Successfully obtained additional information.
    ///
    /// [`LOCATION_INVALID_PARAM`] 1.The input parameter location or additionalInfo is a null pointer.
    ///
    /// 2.The input parameter length is too small to store additional information.
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_LocationInfo_GetAdditionalInfo(
        location: *mut Location_Info,
        additionalInfo: *mut ::core::ffi::c_char,
        length: u32,
    ) -> Location_ResultCode;
    /// Create a location request parameter structure instance.
    ///
    ///
    /// # Returns
    ///
    /// * Return a pointer to the [`Location_RequestConfig`] instance.
    ///
    /// If NULL is returned, it indicates that the creation failed.
    ///
    /// The possible reason is that the application address space is full,
    ///
    /// resulting in the inability to allocate space.
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_Location_CreateRequestConfig() -> *mut Location_RequestConfig;
    /// Destroy the location request parameter instance and reclaim memory.
    ///
    /// # Arguments
    ///
    /// * `requestConfig` - - Pointer to [`Location_RequestConfig`] instance.
    ///
    /// The instance was created by [`OH_Location_CreateRequestConfig`].
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_Location_DestroyRequestConfig(requestConfig: *mut Location_RequestConfig);
    /// Set the use scenario in the location request parameter.
    ///
    /// Prioritize useScene in the location request parameter [`Location_RequestConfig`].
    ///
    /// If useScene is set, powerConsumptionScene becomes invalid.
    ///
    /// If useScene is not set and powerConsumptionScene is set, this parameter takes effect.
    ///
    /// If both parameters are not set, the default useScene is
    ///
    /// [`LOCATION_USE_SCENE_DAILY_LIFE_SERVICE`],
    ///
    /// and the powerConsumptionCenario parameter is invalid.
    ///
    ///
    /// # Arguments
    ///
    /// * `requestConfig` - - Pointer to the [`Location_RequestConfig`] instance.
    ///
    /// The instance was created by [`OH_Location_CreateRequestConfig`].
    ///
    ///
    /// * `useScene` - - Representing the use scenario during location requests.
    ///
    /// The default value is [`LOCATION_USE_SCENE_DAILY_LIFE_SERVICE`]
    /// .
    /// For a detailed definition, please refer to [`Location_UseScene`].
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_LocationRequestConfig_SetUseScene(
        requestConfig: *mut Location_RequestConfig,
        useScene: Location_UseScene,
    );
    /// Set the power consumption scenario in the location request parameters.
    ///
    /// # Arguments
    ///
    /// * `requestConfig` - - Pointer to the [`Location_RequestConfig`] instance.
    ///
    /// The instance was created by [`OH_Location_CreateRequestConfig`].
    ///
    ///
    /// * `powerConsumptionScene` - - Represents the power consumption scenario for location requests.
    ///
    /// The recognition value is [`LOCATION_LOW_POWER_CONSUMPTION`].
    ///
    /// For a detailed definition, please refer to [`Location_PowerConsumptionScene`].
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_LocationRequestConfig_SetPowerConsumptionScene(
        requestConfig: *mut Location_RequestConfig,
        powerConsumptionScene: Location_PowerConsumptionScene,
    );
    /// Set the location reporting interval in the location request parameter.
    ///
    /// # Arguments
    ///
    /// * `requestConfig` - - Pointer to the [`Location_RequestConfig`] instance.
    ///
    /// The instance was created by [`OH_Location_CreateRequestConfig`].
    ///
    ///
    /// * `interval` - - Indicates the time interval for location reporting, in seconds.
    ///
    /// The value is greater than or equal to 1. The default value is 1.
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_LocationRequestConfig_SetInterval(
        requestConfig: *mut Location_RequestConfig,
        interval: ::core::ffi::c_int,
    );
    /// Set up a callback function for receiving location information.
    ///
    /// # Arguments
    ///
    /// * `requestConfig` - - Pointer to the [`Location_RequestConfig`] instance.
    ///
    /// The instance was created by [`OH_Location_CreateRequestConfig`].
    ///
    ///
    /// * `callback` - - Pointer to the callback function for receiving the location.
    ///
    /// For details, see [`Location_InfoCallback`].
    ///
    ///
    /// * `userData` - - Pointer to the application data structure, which will be
    ///
    /// carried in the callback function.
    ///
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_LocationRequestConfig_SetCallback(
        requestConfig: *mut Location_RequestConfig,
        callback: Location_InfoCallback,
        userData: *mut ::core::ffi::c_void,
    );
}
