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 lens specification for glasses
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkglasseslensspecification?language=objc)
    #[unsafe(super(HKLensSpecification, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HKLensSpecification")]
    pub struct HKGlassesLensSpecification;
);

#[cfg(feature = "HKLensSpecification")]
unsafe impl Send for HKGlassesLensSpecification {}

#[cfg(feature = "HKLensSpecification")]
unsafe impl Sync for HKGlassesLensSpecification {}

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

#[cfg(feature = "HKLensSpecification")]
extern_conformance!(
    unsafe impl NSCopying for HKGlassesLensSpecification {}
);

#[cfg(feature = "HKLensSpecification")]
unsafe impl CopyingHelper for HKGlassesLensSpecification {
    type Result = Self;
}

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

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

#[cfg(feature = "HKLensSpecification")]
impl HKGlassesLensSpecification {
    extern_methods!(
        #[cfg(feature = "HKQuantity")]
        /// The distance between the back of the eyeglass lens and the eye (measured in mm)
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(vertexDistance))]
        #[unsafe(method_family = none)]
        pub unsafe fn vertexDistance(&self) -> Option<Retained<HKQuantity>>;

        #[cfg(feature = "HKVisionPrism")]
        /// The object encapsulating the prism fields
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(prism))]
        #[unsafe(method_family = none)]
        pub unsafe fn prism(&self) -> Option<Retained<HKVisionPrism>>;

        #[cfg(feature = "HKQuantity")]
        /// The distance from each pupil to the center of the nose (measured in mm) when looking at a far target.
        /// Can be described as combined or individual value. For distance prescriptions, the pupillary distance will be a far value.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(farPupillaryDistance))]
        #[unsafe(method_family = none)]
        pub unsafe fn farPupillaryDistance(&self) -> Option<Retained<HKQuantity>>;

        #[cfg(feature = "HKQuantity")]
        /// The distance from each pupil to the center of the nose (measured in mm) when looking at a near target.
        /// Can be described as combined or individual value. For near prescriptions, the pupillary distance will be a near value.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(nearPupillaryDistance))]
        #[unsafe(method_family = none)]
        pub unsafe fn nearPupillaryDistance(&self) -> Option<Retained<HKQuantity>>;

        #[cfg(all(feature = "HKQuantity", feature = "HKVisionPrism"))]
        /// Parameter `sphere`: The lens power to correct nearsightedness or farsightedness
        ///
        /// Parameter `cylinder`: The lens power required to correct astigmatism
        ///
        /// Parameter `axis`: The angle along which cylindrical power should be positioned to correct astigmatism
        ///
        /// Parameter `addPower`: The power adjustment applied to a multifocal lens to correct presbyopia
        ///
        /// Parameter `vertexDistance`: The distance between the back of the eyeglass lens and the eye
        ///
        /// Parameter `prism`: The object encapsulating the prism fields
        ///
        /// Parameter `farPupillaryDistance`: The distance from each pupil to the center of the nose (measured in mm) when looking at a far target.
        /// Can be described as combined or individual value. For distance prescriptions, the pupillary distance will be a far value.
        ///
        /// Parameter `nearPupillaryDistance`: The distance from each pupil to the center of the nose (measured in mm) when looking at a near target.
        /// Can be described as combined or individual value. For near prescriptions, the pupillary distance will be a near value.
        #[unsafe(method(initWithSphere:cylinder:axis:addPower:vertexDistance:prism:farPupillaryDistance:nearPupillaryDistance:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSphere_cylinder_axis_addPower_vertexDistance_prism_farPupillaryDistance_nearPupillaryDistance(
            this: Allocated<Self>,
            sphere: &HKQuantity,
            cylinder: Option<&HKQuantity>,
            axis: Option<&HKQuantity>,
            add_power: Option<&HKQuantity>,
            vertex_distance: Option<&HKQuantity>,
            prism: Option<&HKVisionPrism>,
            far_pupillary_distance: Option<&HKQuantity>,
            near_pupillary_distance: Option<&HKQuantity>,
        ) -> 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>;
    );
}