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!(
    /// Represents a specific revision of an HKSource.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksourcerevision?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HKSourceRevision;
);

unsafe impl Send for HKSourceRevision {}

unsafe impl Sync for HKSourceRevision {}

extern_conformance!(
    unsafe impl NSCoding for HKSourceRevision {}
);

extern_conformance!(
    unsafe impl NSCopying for HKSourceRevision {}
);

unsafe impl CopyingHelper for HKSourceRevision {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for HKSourceRevision {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for HKSourceRevision {}
);

impl HKSourceRevision {
    extern_methods!(
        #[cfg(feature = "HKSource")]
        /// The HKSource of the receiver.
        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub unsafe fn source(&self) -> Retained<HKSource>;

        /// The version of the source property.
        ///
        /// This value is taken from the CFBundleVersion of the source. May be nil for older data.
        #[unsafe(method(version))]
        #[unsafe(method_family = none)]
        pub unsafe fn version(&self) -> Option<Retained<NSString>>;

        /// Represents the product type of the device running HealthKit when the object was created.
        ///
        /// This value may be nil for older data, which indicates an unknown product type.
        #[unsafe(method(productType))]
        #[unsafe(method_family = none)]
        pub unsafe fn productType(&self) -> Option<Retained<NSString>>;

        /// Represents the operating system version of the device running HealthKit when the object was created.
        ///
        /// iOS versions after 8.0 but prior to 8.2 are saved as 8.0, and iOS version after 8.2 but prior to 9.0
        /// are saved as 8.2.
        #[unsafe(method(operatingSystemVersion))]
        #[unsafe(method_family = none)]
        pub unsafe fn operatingSystemVersion(&self) -> NSOperatingSystemVersion;

        #[cfg(feature = "HKSource")]
        /// Initializes a new HKSourceRevision with the given source, version, product type, and operating system
        /// version.
        #[unsafe(method(initWithSource:version:productType:operatingSystemVersion:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSource_version_productType_operatingSystemVersion(
            this: Allocated<Self>,
            source: &HKSource,
            version: Option<&NSString>,
            product_type: Option<&NSString>,
            operating_system_version: NSOperatingSystemVersion,
        ) -> Retained<Self>;

        #[cfg(feature = "HKSource")]
        /// Initializes a new HKSourceRevision with the given source and version.
        #[unsafe(method(initWithSource:version:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSource_version(
            this: Allocated<Self>,
            source: &HKSource,
            version: Option<&NSString>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl HKSourceRevision {
    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/hksourcerevisionanyversion?language=objc)
    pub static HKSourceRevisionAnyVersion: &'static NSString;
}

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

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