icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::CoreLocation::*;
use crate::Foundation::*;
use crate::HealthKit::*;
use crate::UniformTypeIdentifiers::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HealthKit_HKStatisticsCollection")]
    pub struct HKStatisticsCollection;

    #[cfg(feature = "HealthKit_HKStatisticsCollection")]
    unsafe impl ClassType for HKStatisticsCollection {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "HealthKit_HKStatisticsCollection")]
unsafe impl NSObjectProtocol for HKStatisticsCollection {}

extern_methods!(
    #[cfg(feature = "HealthKit_HKStatisticsCollection")]
    unsafe impl HKStatisticsCollection {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[cfg(all(feature = "Foundation_NSDate", feature = "HealthKit_HKStatistics"))]
        #[method_id(@__retain_semantics Other statisticsForDate:)]
        pub unsafe fn statisticsForDate(&self, date: &NSDate) -> Option<Id<HKStatistics>>;

        #[cfg(all(feature = "Foundation_NSDate", feature = "HealthKit_HKStatistics"))]
        #[method(enumerateStatisticsFromDate:toDate:withBlock:)]
        pub unsafe fn enumerateStatisticsFromDate_toDate_withBlock(
            &self,
            start_date: &NSDate,
            end_date: &NSDate,
            block: &Block<(NonNull<HKStatistics>, NonNull<Bool>), ()>,
        );

        #[cfg(all(feature = "Foundation_NSArray", feature = "HealthKit_HKStatistics"))]
        #[method_id(@__retain_semantics Other statistics)]
        pub unsafe fn statistics(&self) -> Id<NSArray<HKStatistics>>;

        #[cfg(all(feature = "Foundation_NSSet", feature = "HealthKit_HKSource"))]
        #[method_id(@__retain_semantics Other sources)]
        pub unsafe fn sources(&self) -> Id<NSSet<HKSource>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "HealthKit_HKStatisticsCollection")]
    unsafe impl HKStatisticsCollection {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HealthKit_HKStatisticsCollectionQuery")]
    pub struct HKStatisticsCollectionQuery;

    #[cfg(feature = "HealthKit_HKStatisticsCollectionQuery")]
    unsafe impl ClassType for HKStatisticsCollectionQuery {
        #[inherits(NSObject)]
        type Super = HKQuery;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "HealthKit_HKStatisticsCollectionQuery")]
unsafe impl NSObjectProtocol for HKStatisticsCollectionQuery {}

extern_methods!(
    #[cfg(feature = "HealthKit_HKStatisticsCollectionQuery")]
    unsafe impl HKStatisticsCollectionQuery {
        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other anchorDate)]
        pub unsafe fn anchorDate(&self) -> Id<NSDate>;

        #[method(options)]
        pub unsafe fn options(&self) -> HKStatisticsOptions;

        #[cfg(feature = "Foundation_NSDateComponents")]
        #[method_id(@__retain_semantics Other intervalComponents)]
        pub unsafe fn intervalComponents(&self) -> Id<NSDateComponents>;

        #[cfg(all(
            feature = "Foundation_NSError",
            feature = "HealthKit_HKStatisticsCollection"
        ))]
        #[method(initialResultsHandler)]
        pub unsafe fn initialResultsHandler(
            &self,
        ) -> *mut Block<
            (
                NonNull<HKStatisticsCollectionQuery>,
                *mut HKStatisticsCollection,
                *mut NSError,
            ),
            (),
        >;

        #[cfg(all(
            feature = "Foundation_NSError",
            feature = "HealthKit_HKStatisticsCollection"
        ))]
        #[method(setInitialResultsHandler:)]
        pub unsafe fn setInitialResultsHandler(
            &self,
            initial_results_handler: Option<
                &Block<
                    (
                        NonNull<HKStatisticsCollectionQuery>,
                        *mut HKStatisticsCollection,
                        *mut NSError,
                    ),
                    (),
                >,
            >,
        );

        #[cfg(all(
            feature = "Foundation_NSError",
            feature = "HealthKit_HKStatistics",
            feature = "HealthKit_HKStatisticsCollection"
        ))]
        #[method(statisticsUpdateHandler)]
        pub unsafe fn statisticsUpdateHandler(
            &self,
        ) -> *mut Block<
            (
                NonNull<HKStatisticsCollectionQuery>,
                *mut HKStatistics,
                *mut HKStatisticsCollection,
                *mut NSError,
            ),
            (),
        >;

        #[cfg(all(
            feature = "Foundation_NSError",
            feature = "HealthKit_HKStatistics",
            feature = "HealthKit_HKStatisticsCollection"
        ))]
        #[method(setStatisticsUpdateHandler:)]
        pub unsafe fn setStatisticsUpdateHandler(
            &self,
            statistics_update_handler: Option<
                &Block<
                    (
                        NonNull<HKStatisticsCollectionQuery>,
                        *mut HKStatistics,
                        *mut HKStatisticsCollection,
                        *mut NSError,
                    ),
                    (),
                >,
            >,
        );

        #[cfg(all(
            feature = "Foundation_NSDate",
            feature = "Foundation_NSDateComponents",
            feature = "Foundation_NSPredicate",
            feature = "HealthKit_HKQuantityType"
        ))]
        #[method_id(@__retain_semantics Init initWithQuantityType:quantitySamplePredicate:options:anchorDate:intervalComponents:)]
        pub unsafe fn initWithQuantityType_quantitySamplePredicate_options_anchorDate_intervalComponents(
            this: Allocated<Self>,
            quantity_type: &HKQuantityType,
            quantity_sample_predicate: Option<&NSPredicate>,
            options: HKStatisticsOptions,
            anchor_date: &NSDate,
            interval_components: &NSDateComponents,
        ) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `HKQuery`
    #[cfg(feature = "HealthKit_HKStatisticsCollectionQuery")]
    unsafe impl HKStatisticsCollectionQuery {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "HealthKit_HKStatisticsCollectionQuery")]
    unsafe impl HKStatisticsCollectionQuery {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);