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

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

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

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

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

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

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

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

#[cfg(all(
    feature = "HKObject",
    feature = "HKSample",
    feature = "HKVisionPrescription"
))]
impl HKGlassesPrescription {
    extern_methods!(
        #[cfg(all(
            feature = "HKGlassesLensSpecification",
            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<HKGlassesLensSpecification>>;

        #[cfg(all(
            feature = "HKGlassesLensSpecification",
            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<HKGlassesLensSpecification>>;

        #[cfg(all(
            feature = "HKDevice",
            feature = "HKGlassesLensSpecification",
            feature = "HKLensSpecification"
        ))]
        /// Parameter `rightEyeSpecification`: The right eye specification
        ///
        /// Parameter `leftEyeSpecification`: The left eye specification
        ///
        /// 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:dateIssued:expirationDate:device:metadata:))]
        #[unsafe(method_family = none)]
        pub unsafe fn prescriptionWithRightEyeSpecification_leftEyeSpecification_dateIssued_expirationDate_device_metadata(
            right_eye_specification: Option<&HKGlassesLensSpecification>,
            left_eye_specification: Option<&HKGlassesLensSpecification>,
            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>;
    );
}