objc2_health_kit/generated/
HKAudiogramSample.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    /// A sample object representing the results of a standard hearing test.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkaudiogramsample?language=objc)
13    #[unsafe(super(HKSample, HKObject, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(all(feature = "HKObject", feature = "HKSample"))]
16    pub struct HKAudiogramSample;
17);
18
19#[cfg(all(feature = "HKObject", feature = "HKSample"))]
20unsafe impl Send for HKAudiogramSample {}
21
22#[cfg(all(feature = "HKObject", feature = "HKSample"))]
23unsafe impl Sync for HKAudiogramSample {}
24
25#[cfg(all(feature = "HKObject", feature = "HKSample"))]
26extern_conformance!(
27    unsafe impl NSCoding for HKAudiogramSample {}
28);
29
30#[cfg(all(feature = "HKObject", feature = "HKSample"))]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for HKAudiogramSample {}
33);
34
35#[cfg(all(feature = "HKObject", feature = "HKSample"))]
36extern_conformance!(
37    unsafe impl NSSecureCoding for HKAudiogramSample {}
38);
39
40#[cfg(all(feature = "HKObject", feature = "HKSample"))]
41impl HKAudiogramSample {
42    extern_methods!(
43        #[cfg(feature = "HKAudiogramSensitivityPoint")]
44        /// The hearing sensitivity readings associated with a hearing test.
45        #[unsafe(method(sensitivityPoints))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn sensitivityPoints(&self) -> Retained<NSArray<HKAudiogramSensitivityPoint>>;
48
49        #[cfg(feature = "HKAudiogramSensitivityPoint")]
50        /// Creates a new audiogram sample with the specified attributes.
51        ///
52        /// Parameter `sensitivityPoints`: Sensitivity data associated with the sample, with a maximum limit of 30 points. Frequencies must be unique, and ordered ascending.
53        ///
54        /// Parameter `startDate`: The start date for the hearing test.
55        ///
56        /// Parameter `endDate`: The end date for the hearing test.
57        ///
58        /// Parameter `metadata`: Optional meta data associated with the sample.
59        ///
60        /// Returns: A new instance of an audiogram sample.
61        ///
62        /// # Safety
63        ///
64        /// `metadata` generic should be of the correct type.
65        #[deprecated]
66        #[unsafe(method(audiogramSampleWithSensitivityPoints:startDate:endDate:metadata:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn audiogramSampleWithSensitivityPoints_startDate_endDate_metadata(
69            sensitivity_points: &NSArray<HKAudiogramSensitivityPoint>,
70            start_date: &NSDate,
71            end_date: &NSDate,
72            metadata: Option<&NSDictionary<NSString, AnyObject>>,
73        ) -> Retained<Self>;
74
75        #[cfg(all(feature = "HKAudiogramSensitivityPoint", feature = "HKDevice"))]
76        /// Creates a new audiogram sample with the specified attributes.
77        ///
78        /// Parameter `sensitivityPoints`: Sensitivity data associated with the sample, with a maximum limit of 30 points. Frequencies must be unique, and ordered ascending.
79        ///
80        /// Parameter `startDate`: The start date of the hearing test.
81        ///
82        /// Parameter `endDate`: The end date of the hearing test.
83        ///
84        /// Parameter `device`: The device that generated the sample data.
85        ///
86        /// Parameter `metadata`: Optional metadata associated with the sample.
87        ///
88        /// Returns: A new instance of an audiogram sample.
89        ///
90        /// # Safety
91        ///
92        /// `metadata` generic should be of the correct type.
93        #[unsafe(method(audiogramSampleWithSensitivityPoints:startDate:endDate:device:metadata:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn audiogramSampleWithSensitivityPoints_startDate_endDate_device_metadata(
96            sensitivity_points: &NSArray<HKAudiogramSensitivityPoint>,
97            start_date: &NSDate,
98            end_date: &NSDate,
99            device: Option<&HKDevice>,
100            metadata: Option<&NSDictionary<NSString, AnyObject>>,
101        ) -> Retained<Self>;
102    );
103}
104
105/// Methods declared on superclass `HKObject`.
106#[cfg(all(feature = "HKObject", feature = "HKSample"))]
107impl HKAudiogramSample {
108    extern_methods!(
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116#[cfg(all(feature = "HKObject", feature = "HKSample"))]
117impl HKAudiogramSample {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}