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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// An abstract class representing measurements taken over a period of time.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksample?language=objc)
    #[unsafe(super(HKObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HKObject")]
    pub struct HKSample;
);

#[cfg(feature = "HKObject")]
unsafe impl Send for HKSample {}

#[cfg(feature = "HKObject")]
unsafe impl Sync for HKSample {}

#[cfg(feature = "HKObject")]
extern_conformance!(
    unsafe impl NSCoding for HKSample {}
);

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

#[cfg(feature = "HKObject")]
extern_conformance!(
    unsafe impl NSSecureCoding for HKSample {}
);

#[cfg(feature = "HKObject")]
impl HKSample {
    extern_methods!(
        #[cfg(feature = "HKObjectType")]
        #[unsafe(method(sampleType))]
        #[unsafe(method_family = none)]
        pub unsafe fn sampleType(&self) -> Retained<HKSampleType>;

        #[unsafe(method(startDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn startDate(&self) -> Retained<NSDate>;

        #[unsafe(method(endDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn endDate(&self) -> Retained<NSDate>;

        /// Indicates whether a sample has an undetermined duration.
        ///
        /// Computed based on the endDate of a sample.
        #[unsafe(method(hasUndeterminedDuration))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasUndeterminedDuration(&self) -> bool;
    );
}

/// Methods declared on superclass `HKObject`.
#[cfg(feature = "HKObject")]
impl HKSample {
    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 = "HKObject")]
impl HKSample {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksamplesortidentifierstartdate?language=objc)
    pub static HKSampleSortIdentifierStartDate: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksamplesortidentifierenddate?language=objc)
    pub static HKSampleSortIdentifierEndDate: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkpredicatekeypathstartdate?language=objc)
    pub static HKPredicateKeyPathStartDate: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkpredicatekeypathenddate?language=objc)
    pub static HKPredicateKeyPathEndDate: &'static NSString;
}