objc2_health_kit/generated/
HKContactsPrescription.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// An object representing a contacts prescription
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkcontactsprescription?language=objc)
13    #[unsafe(super(HKVisionPrescription, HKSample, HKObject, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(all(
16        feature = "HKObject",
17        feature = "HKSample",
18        feature = "HKVisionPrescription"
19    ))]
20    pub struct HKContactsPrescription;
21);
22
23#[cfg(all(
24    feature = "HKObject",
25    feature = "HKSample",
26    feature = "HKVisionPrescription"
27))]
28unsafe impl Send for HKContactsPrescription {}
29
30#[cfg(all(
31    feature = "HKObject",
32    feature = "HKSample",
33    feature = "HKVisionPrescription"
34))]
35unsafe impl Sync for HKContactsPrescription {}
36
37#[cfg(all(
38    feature = "HKObject",
39    feature = "HKSample",
40    feature = "HKVisionPrescription"
41))]
42extern_conformance!(
43    unsafe impl NSCoding for HKContactsPrescription {}
44);
45
46#[cfg(all(
47    feature = "HKObject",
48    feature = "HKSample",
49    feature = "HKVisionPrescription"
50))]
51extern_conformance!(
52    unsafe impl NSCopying for HKContactsPrescription {}
53);
54
55#[cfg(all(
56    feature = "HKObject",
57    feature = "HKSample",
58    feature = "HKVisionPrescription"
59))]
60unsafe impl CopyingHelper for HKContactsPrescription {
61    type Result = Self;
62}
63
64#[cfg(all(
65    feature = "HKObject",
66    feature = "HKSample",
67    feature = "HKVisionPrescription"
68))]
69extern_conformance!(
70    unsafe impl NSObjectProtocol for HKContactsPrescription {}
71);
72
73#[cfg(all(
74    feature = "HKObject",
75    feature = "HKSample",
76    feature = "HKVisionPrescription"
77))]
78extern_conformance!(
79    unsafe impl NSSecureCoding for HKContactsPrescription {}
80);
81
82#[cfg(all(
83    feature = "HKObject",
84    feature = "HKSample",
85    feature = "HKVisionPrescription"
86))]
87impl HKContactsPrescription {
88    extern_methods!(
89        #[cfg(all(
90            feature = "HKContactsLensSpecification",
91            feature = "HKLensSpecification"
92        ))]
93        /// The right eye lens specification
94        ///
95        /// This property is not atomic.
96        ///
97        /// # Safety
98        ///
99        /// This might not be thread-safe.
100        #[unsafe(method(rightEye))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn rightEye(&self) -> Option<Retained<HKContactsLensSpecification>>;
103
104        #[cfg(all(
105            feature = "HKContactsLensSpecification",
106            feature = "HKLensSpecification"
107        ))]
108        /// The left eye lens specification
109        ///
110        /// This property is not atomic.
111        ///
112        /// # Safety
113        ///
114        /// This might not be thread-safe.
115        #[unsafe(method(leftEye))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn leftEye(&self) -> Option<Retained<HKContactsLensSpecification>>;
118
119        /// The prescribed brand after contact lens fitting
120        ///
121        /// This property is not atomic.
122        ///
123        /// # Safety
124        ///
125        /// This might not be thread-safe.
126        #[unsafe(method(brand))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn brand(&self) -> Retained<NSString>;
129
130        #[cfg(all(
131            feature = "HKContactsLensSpecification",
132            feature = "HKDevice",
133            feature = "HKLensSpecification"
134        ))]
135        /// Parameter `rightEyeSpecification`: The right eye specification
136        ///
137        /// Parameter `leftEyeSpecification`: The left eye specification
138        ///
139        /// Parameter `brand`: The prescribed brand after contact lens fitting
140        ///
141        /// Parameter `dateIssued`: The date the prescription was issued
142        ///
143        /// Parameter `expirationDate`: The date the prescription expires
144        ///
145        /// Parameter `device`: The device that generated the sample
146        ///
147        /// Parameter `metadata`: The metadata for the sample
148        ///
149        /// # Safety
150        ///
151        /// `metadata` generic should be of the correct type.
152        #[unsafe(method(prescriptionWithRightEyeSpecification:leftEyeSpecification:brand:dateIssued:expirationDate:device:metadata:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn prescriptionWithRightEyeSpecification_leftEyeSpecification_brand_dateIssued_expirationDate_device_metadata(
155            right_eye_specification: Option<&HKContactsLensSpecification>,
156            left_eye_specification: Option<&HKContactsLensSpecification>,
157            brand: &NSString,
158            date_issued: &NSDate,
159            expiration_date: Option<&NSDate>,
160            device: Option<&HKDevice>,
161            metadata: Option<&NSDictionary<NSString, AnyObject>>,
162        ) -> Retained<Self>;
163
164        #[unsafe(method(init))]
165        #[unsafe(method_family = init)]
166        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
167
168        #[unsafe(method(new))]
169        #[unsafe(method_family = new)]
170        pub unsafe fn new() -> Retained<Self>;
171
172        #[cfg(feature = "HKDevice")]
173        /// # Safety
174        ///
175        /// `metadata` generic should be of the correct type.
176        #[unsafe(method(prescriptionWithType:dateIssued:expirationDate:device:metadata:))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn prescriptionWithType_dateIssued_expirationDate_device_metadata(
179            r#type: HKVisionPrescriptionType,
180            date_issued: &NSDate,
181            expiration_date: Option<&NSDate>,
182            device: Option<&HKDevice>,
183            metadata: Option<&NSDictionary<NSString, AnyObject>>,
184        ) -> Retained<Self>;
185    );
186}