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

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

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

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

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

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

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

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

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

        #[cfg(feature = "HKQuantity")]
        /// The width of the lens from edge to edge (measured in mm)
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(diameter))]
        #[unsafe(method_family = none)]
        pub unsafe fn diameter(&self) -> Option<Retained<HKQuantity>>;

        #[cfg(feature = "HKQuantity")]
        /// 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 `baseCurve`: The curvature of the back surface of the lens
        ///
        /// Parameter `diameter`: The width of the lens from edge to edge
        #[unsafe(method(initWithSphere:cylinder:axis:addPower:baseCurve:diameter:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSphere_cylinder_axis_addPower_baseCurve_diameter(
            this: Allocated<Self>,
            sphere: &HKQuantity,
            cylinder: Option<&HKQuantity>,
            axis: Option<&HKQuantity>,
            add_power: Option<&HKQuantity>,
            base_curve: Option<&HKQuantity>,
            diameter: 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>;
    );
}