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 object representing a contacts prescription
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkcontactsprescription?language=objc)
    #[unsafe(super(HKVisionPrescription, HKSample, HKObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "HKObject",
        feature = "HKSample",
        feature = "HKVisionPrescription"
    ))]
    pub struct HKContactsPrescription;
);

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

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

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

#[cfg(all(
    feature = "HKObject",
    feature = "HKSample",
    feature = "HKVisionPrescription"
))]
extern_conformance!(
    unsafe impl NSCopying for HKContactsPrescription {}
);

#[cfg(all(
    feature = "HKObject",
    feature = "HKSample",
    feature = "HKVisionPrescription"
))]
unsafe impl CopyingHelper for HKContactsPrescription {
    type Result = Self;
}

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

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

#[cfg(all(
    feature = "HKObject",
    feature = "HKSample",
    feature = "HKVisionPrescription"
))]
impl HKContactsPrescription {
    extern_methods!(
        #[cfg(all(
            feature = "HKContactsLensSpecification",
            feature = "HKLensSpecification"
        ))]
        /// The right eye lens specification
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(rightEye))]
        #[unsafe(method_family = none)]
        pub unsafe fn rightEye(&self) -> Option<Retained<HKContactsLensSpecification>>;

        #[cfg(all(
            feature = "HKContactsLensSpecification",
            feature = "HKLensSpecification"
        ))]
        /// The left eye lens specification
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(leftEye))]
        #[unsafe(method_family = none)]
        pub unsafe fn leftEye(&self) -> Option<Retained<HKContactsLensSpecification>>;

        /// The prescribed brand after contact lens fitting
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(brand))]
        #[unsafe(method_family = none)]
        pub unsafe fn brand(&self) -> Retained<NSString>;

        #[cfg(all(
            feature = "HKContactsLensSpecification",
            feature = "HKDevice",
            feature = "HKLensSpecification"
        ))]
        /// Parameter `rightEyeSpecification`: The right eye specification
        ///
        /// Parameter `leftEyeSpecification`: The left eye specification
        ///
        /// Parameter `brand`: The prescribed brand after contact lens fitting
        ///
        /// Parameter `dateIssued`: The date the prescription was issued
        ///
        /// Parameter `expirationDate`: The date the prescription expires
        ///
        /// Parameter `device`: The device that generated the sample
        ///
        /// Parameter `metadata`: The metadata for the sample
        ///
        /// # Safety
        ///
        /// `metadata` generic should be of the correct type.
        #[unsafe(method(prescriptionWithRightEyeSpecification:leftEyeSpecification:brand:dateIssued:expirationDate:device:metadata:))]
        #[unsafe(method_family = none)]
        pub unsafe fn prescriptionWithRightEyeSpecification_leftEyeSpecification_brand_dateIssued_expirationDate_device_metadata(
            right_eye_specification: Option<&HKContactsLensSpecification>,
            left_eye_specification: Option<&HKContactsLensSpecification>,
            brand: &NSString,
            date_issued: &NSDate,
            expiration_date: Option<&NSDate>,
            device: Option<&HKDevice>,
            metadata: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> Retained<Self>;

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

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(feature = "HKDevice")]
        /// # Safety
        ///
        /// `metadata` generic should be of the correct type.
        #[unsafe(method(prescriptionWithType:dateIssued:expirationDate:device:metadata:))]
        #[unsafe(method_family = none)]
        pub unsafe fn prescriptionWithType_dateIssued_expirationDate_device_metadata(
            r#type: HKVisionPrescriptionType,
            date_issued: &NSDate,
            expiration_date: Option<&NSDate>,
            device: Option<&HKDevice>,
            metadata: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> Retained<Self>;
    );
}