objc2-health-kit 0.3.2

Bindings to the HealthKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkworkoutroutequery?language=objc)
    #[unsafe(super(HKQuery, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HKQuery")]
    pub struct HKWorkoutRouteQuery;
);

#[cfg(feature = "HKQuery")]
unsafe impl Send for HKWorkoutRouteQuery {}

#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKWorkoutRouteQuery {}

#[cfg(feature = "HKQuery")]
extern_conformance!(
    unsafe impl NSObjectProtocol for HKWorkoutRouteQuery {}
);

#[cfg(feature = "HKQuery")]
impl HKWorkoutRouteQuery {
    extern_methods!(
        #[cfg(all(
            feature = "HKObject",
            feature = "HKSample",
            feature = "HKSeriesSample",
            feature = "HKWorkoutRoute",
            feature = "block2",
            feature = "objc2-core-location"
        ))]
        /// Returns a query that will retrieve CLLocation objects for the specified workoutRoute.
        ///
        ///
        /// Parameter `workoutRoute`: The HKWorkoutRoute for which the location data will be returned.
        ///
        /// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly with an array of
        /// CLLocation objects until all data is returned and the done parameter is YES or if HKHealthStore
        /// stopQuery: is called. The stopQuery call can be made within the dataHandler block. The number of
        /// objects returned in routeData per dataHandler call is unspecified. Once done is YES, or
        /// stopQuery called, the query is complete and no more calls to the handler will be made.
        ///
        /// # Safety
        ///
        /// `data_handler` block must be sendable.
        #[unsafe(method(initWithRoute:dataHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRoute_dataHandler(
            this: Allocated<Self>,
            workout_route: &HKWorkoutRoute,
            data_handler: &block2::DynBlock<
                dyn Fn(NonNull<HKWorkoutRouteQuery>, *mut NSArray<CLLocation>, Bool, *mut NSError),
            >,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "HKObject",
            feature = "HKSample",
            feature = "HKSeriesSample",
            feature = "HKWorkoutRoute",
            feature = "block2",
            feature = "objc2-core-location"
        ))]
        /// Returns a query that will retrieve CLLocation objects for the specified workoutRoute and dateInterval.
        ///
        ///
        /// Parameter `workoutRoute`: The HKWorkoutRoute for which the location data will be returned.
        ///
        /// Parameter `dateInterval`: The date interval for which the location data will be returned. If the requested interval does
        /// not overlap with the specified workout route sample, an empty array of results is returned. If
        /// the requested interval partially overlaps with the specified workout route sample, only location
        /// data from within that overlapping time period is returned.
        ///
        /// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly with an array of
        /// CLLocation objects until all data is returned and the done parameter is YES or if HKHealthStore
        /// stopQuery: is called. The stopQuery call can be made within the dataHandler block. The number of
        /// objects returned in routeData per dataHandler call is unspecified. Once done is YES, or
        /// stopQuery called, the query is complete and no more calls to the handler will be made.
        ///
        /// # Safety
        ///
        /// `data_handler` block must be sendable.
        #[unsafe(method(initWithRoute:dateInterval:dataHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRoute_dateInterval_dataHandler(
            this: Allocated<Self>,
            workout_route: &HKWorkoutRoute,
            date_interval: &NSDateInterval,
            data_handler: &block2::DynBlock<
                dyn Fn(NonNull<HKWorkoutRouteQuery>, *mut NSArray<CLLocation>, Bool, *mut NSError),
            >,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKWorkoutRouteQuery {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "HKQuery")]
impl HKWorkoutRouteQuery {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}