objc2_sensor_kit/generated/
mod.rs

1// This file has been automatically generated by `objc2`'s `header-translator`.
2// DO NOT EDIT
3
4#![allow(unused_imports)]
5#![allow(deprecated)]
6#![allow(non_snake_case)]
7#![allow(non_camel_case_types)]
8#![allow(non_upper_case_globals)]
9#![allow(missing_docs)]
10#![allow(clippy::too_many_arguments)]
11#![allow(clippy::type_complexity)]
12#![allow(clippy::upper_case_acronyms)]
13#![allow(clippy::identity_op)]
14#![allow(clippy::missing_safety_doc)]
15#![allow(clippy::doc_lazy_continuation)]
16#![allow(rustdoc::broken_intra_doc_links)]
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::invalid_html_tags)]
19
20#[link(name = "SensorKit", kind = "framework")]
21extern "C" {}
22
23use core::ffi::*;
24use core::ptr::NonNull;
25use objc2::__framework_prelude::*;
26#[cfg(feature = "objc2-ar-kit")]
27use objc2_ar_kit::*;
28#[cfg(feature = "objc2-core-foundation")]
29use objc2_core_foundation::*;
30#[cfg(feature = "objc2-core-location")]
31use objc2_core_location::*;
32#[cfg(feature = "objc2-core-media")]
33use objc2_core_media::*;
34use objc2_foundation::*;
35#[cfg(feature = "objc2-sound-analysis")]
36use objc2_sound_analysis::*;
37#[cfg(feature = "objc2-speech")]
38use objc2_speech::*;
39
40use crate::*;
41
42/// A type of data stream stored in the SensorKit data store.
43///
44/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensor?language=objc)
45// NS_TYPED_ENUM
46pub type SRSensor = NSString;
47
48extern "C" {
49    /// Sensor stream for Environmental Brightness and Color.
50    ///
51    ///
52    /// This data stream stores ambient light sensor data from devices when the screen is on.
53    /// Fetches from this stream return objects of type SRAmbientLightSample.
54    ///
55    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorambientlightsensor?language=objc)
56    pub static SRSensorAmbientLightSensor: &'static SRSensor;
57}
58
59extern "C" {
60    /// Accelerometer sensor stream for Motion.
61    ///
62    ///
63    /// This data stream stores acceleration measured by the device's accelerometer.
64    /// Fetches from this stream return objects of type NSArray
65    /// <CMRecordedAccelerometerData
66    /// *> * as defined in the CoreMotion framework.
67    ///
68    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensoraccelerometer?language=objc)
69    pub static SRSensorAccelerometer: &'static SRSensor;
70}
71
72extern "C" {
73    /// Rotation rate sensor stream for Motion.
74    ///
75    ///
76    /// This data stream stores rotation rate measured by the device's gyroscope.
77    /// Fetches from this stream return objects of type NSArray
78    /// <CMRecordedRotationRateData
79    /// *> * as defined in the CoreMotion framework.
80    ///
81    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorrotationrate?language=objc)
82    pub static SRSensorRotationRate: &'static SRSensor;
83}
84
85extern "C" {
86    /// Sensor stream for Frequently Visited Locations.
87    ///
88    ///
89    /// This data stream stores visit information from frequently visited locations including:
90    ///
91    /// ```text
92    ///    - arrival and departure times
93    ///    - distance from your home
94    ///    - an anonymous location identifier but no specific location information
95    /// ```
96    ///
97    /// Fetches from this stream return objects of type SRVisit.
98    ///
99    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorvisits?language=objc)
100    pub static SRSensorVisits: &'static SRSensor;
101}
102
103extern "C" {
104    /// Sensor stream for Pedometer.
105    ///
106    ///
107    /// This stream stores information about your step count.
108    /// Fetches from this stream return objects of type CMPedometerData as defined in the CoreMotion framework.
109    ///
110    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorpedometerdata?language=objc)
111    pub static SRSensorPedometerData: &'static SRSensor;
112}
113
114extern "C" {
115    /// Sensor stream for Device Usage.
116    ///
117    ///
118    /// This stream stores information about device usage including:
119    ///
120    /// ```text
121    ///    - Types of apps used
122    ///    - Types of notifications received
123    ///    - Types of websites visited
124    ///    - Number of device unlocks and unlock duration
125    ///    - Number of times the screen is on and the duration
126    /// ```
127    ///
128    /// Fetches from this stream return objects of type SRDeviceUsageReport.
129    ///
130    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensordeviceusagereport?language=objc)
131    pub static SRSensorDeviceUsageReport: &'static SRSensor;
132}
133
134extern "C" {
135    /// Sensor stream for Messages Usage.
136    ///
137    ///
138    /// This streams stores information about messages usage including:
139    ///
140    /// ```text
141    ///    - The number of incoming and outgoing messages
142    ///    - The number of individuals contacted but none of their personal information
143    /// ```
144    ///
145    /// Fetches from this stream return objects of type SRMessagesUsageReport.
146    ///
147    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensormessagesusagereport?language=objc)
148    pub static SRSensorMessagesUsageReport: &'static SRSensor;
149}
150
151extern "C" {
152    /// Sensor stream for Phone Usage
153    ///
154    ///
155    /// This streams stores information about phone usage including:
156    ///
157    /// ```text
158    ///    - The number of incoming and outgoing calls
159    ///    - The number of individuals contacted but none of their personal information
160    /// ```
161    ///
162    /// Fetches from this stream return objects of type SRPhoneUsageReport.
163    ///
164    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorphoneusagereport?language=objc)
165    pub static SRSensorPhoneUsageReport: &'static SRSensor;
166}
167
168extern "C" {
169    /// Sensor stream for Watch on Wrist
170    ///
171    ///
172    /// This streams stores information about Apple Watch wear including:
173    ///
174    /// ```text
175    ///    - When the watch is worn
176    ///    - Digital crown and orientation settings
177    /// ```
178    ///
179    /// Fetches from this stream return objects of type SRWristDetection.
180    ///
181    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensoronwriststate?language=objc)
182    pub static SRSensorOnWristState: &'static SRSensor;
183}
184
185extern "C" {
186    /// Sensor stream for Keyboard Usage
187    ///
188    ///
189    /// This stream stores information about keyboard usage from all apps where a keyboard is used including:
190    ///
191    /// ```text
192    ///    - Metrics about typing speed and accuracy
193    ///    - Metrics about the length of typed or swiped words
194    ///    - Metrics about the typing errors made
195    ///    - The number of words and emojis that convey emotion
196    /// ```
197    ///
198    /// Fetches from this stream return objects of type SRKeyboardMetrics.
199    ///
200    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorkeyboardmetrics?language=objc)
201    pub static SRSensorKeyboardMetrics: &'static SRSensor;
202}
203
204extern "C" {
205    /// Siri sensor stream for Speech Metrics
206    ///
207    ///
208    /// This stream stores information data about your voice during Siri sessions including:
209    ///
210    /// ```text
211    ///    - Tenor, pitch, and cadence
212    ///    - Metrics such as average words per minute and average pause length
213    /// ```
214    ///
215    /// This steam does not store any raw audio nor any audio or data from other parties.
216    ///
217    /// Fetches from this stream return objects of type
218    /// `SRSpeechMetrics`
219    ///
220    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorsirispeechmetrics?language=objc)
221    pub static SRSensorSiriSpeechMetrics: &'static SRSensor;
222}
223
224extern "C" {
225    /// Telephony sensor stream for Speech Metrics
226    ///
227    ///
228    /// This stream stores information data about your voice during phone calls including:
229    ///
230    /// ```text
231    ///    - Tenor, pitch, and cadence
232    ///    - Metrics such as average words per minute and average pause length
233    /// ```
234    ///
235    /// This steam does not store any raw audio nor any audio or data from other parties.
236    ///
237    /// Fetches from this stream return objects of type
238    /// `SRSpeechMetrics`
239    ///
240    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensortelephonyspeechmetrics?language=objc)
241    pub static SRSensorTelephonySpeechMetrics: &'static SRSensor;
242}
243
244extern "C" {
245    /// Ambient pressure sensor stream
246    ///
247    ///
248    /// This stream stores simple pressure and temperature measurements including:
249    ///
250    /// ```text
251    ///    - Pressure and temperature
252    ///    - Date when metric was collected
253    /// ```
254    ///
255    /// Fetches from this stream return objects of type NSArray
256    /// <CMRecordedPressureData
257    /// *> * as defined in the CoreMotion framework.
258    ///
259    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorambientpressure?language=objc)
260    pub static SRSensorAmbientPressure: &'static SRSensor;
261}
262
263extern "C" {
264    /// Media events sensor stream
265    ///
266    ///
267    /// This stream stores data about user interaction with photo and video content in messaging apps including:
268    ///
269    /// ```text
270    ///    - Event type
271    ///    - Media identifier
272    /// ```
273    ///
274    /// Fetches from this stream return objects of type SRMediaEvent.
275    ///
276    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensormediaevents?language=objc)
277    pub static SRSensorMediaEvents: &'static SRSensor;
278}
279
280extern "C" {
281    /// Sensor stream for Apple Watch temperatures on wrist while sleeping
282    ///
283    ///
284    /// This stream stores Apple Watch on wrist temperature measurements including:
285    ///
286    /// ```text
287    ///    - StartTime
288    ///    - Duration of collected temperature measurements
289    ///    - version of algorithm
290    ///    - Temperature samples
291    /// ```
292    ///
293    /// Fetches from this stream return objects of type SRWristTemperatureSession.
294    ///
295    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorwristtemperature?language=objc)
296    pub static SRSensorWristTemperature: &'static SRSensor;
297}
298
299extern "C" {
300    /// Estimated heart rate
301    ///
302    ///
303    /// Fetches from this stream return objects of type
304    /// `CMHighFrequencyHeartRateData`
305    ///
306    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorheartrate?language=objc)
307    pub static SRSensorHeartRate: &'static SRSensor;
308}
309
310extern "C" {
311    /// Sensor stream for face metrics collection
312    ///
313    ///
314    /// This stream stores face metrics including:
315    ///
316    /// ```text
317    ///    - algorithm version
318    ///    - face description and face expressions
319    ///    - data collection session identifier
320    /// ```
321    ///
322    /// Fetches from this stream return objects of type SRFaceMetrics.
323    ///
324    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorfacemetrics?language=objc)
325    pub static SRSensorFaceMetrics: &'static SRSensor;
326}
327
328extern "C" {
329    /// Odometer sensor stream
330    ///
331    ///
332    /// This stream stores measurements of your distance and speed
333    /// Fetches from this stream return objects of type
334    /// `CMOdometerData`as defined in the CoreMotion framework.
335    ///
336    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorodometer?language=objc)
337    pub static SRSensorOdometer: &'static SRSensor;
338}
339
340extern "C" {
341    /// ECG sensor stream
342    ///
343    ///
344    /// This stream stores samples of the ECG sensor
345    /// Fetches from this stream return objects of type
346    /// `NSArray<SRElectrocardiogramSample`*> *
347    ///
348    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorelectrocardiogram?language=objc)
349    pub static SRSensorElectrocardiogram: &'static SRSensor;
350}
351
352extern "C" {
353    /// PPG sensor stream
354    ///
355    ///
356    /// This stream stores samples of the PPG sensor
357    /// Fetches from this stream return objects of type
358    /// `NSArray<SRPhotoplethysmogramSample`*> *
359    ///
360    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorphotoplethysmogram?language=objc)
361    pub static SRSensorPhotoplethysmogram: &'static SRSensor;
362}
363
364extern "C" {
365    /// Sensor stream for Acoustic Settings
366    ///
367    ///
368    /// This stream stores samples of the Acoustic Settings sensor
369    /// Fetches from this stream return objects of type
370    /// `SRAcousticSettings`
371    ///
372    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensoracousticsettings?language=objc)
373    pub static SRSensorAcousticSettings: &'static SRSensor;
374}
375
376extern "C" {
377    /// Sesnor stream for sleep sessions collection
378    ///
379    ///
380    /// This stream stores samples of the Sleep Sessions sensor
381    /// Fetches from this stream return objects of type
382    /// `SRSleepSession`
383    ///
384    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorsleepsessions?language=objc)
385    pub static SRSensorSleepSessions: &'static SRSensor;
386}
387
388/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srabsolutetime?language=objc)
389#[cfg(feature = "objc2-core-foundation")]
390pub type SRAbsoluteTime = CFTimeInterval;
391
392extern "C-unwind" {
393    /// Get the current SRAbsoluteTime for this device.
394    ///
395    /// This timestamp ticks across sleeps and reboots.
396    #[cfg(feature = "objc2-core-foundation")]
397    pub fn SRAbsoluteTimeGetCurrent() -> SRAbsoluteTime;
398}
399
400extern "C-unwind" {
401    /// Convert a mach_continuous_time to an SRAbsoluteTime.
402    ///
403    /// Because mach_continuous_time is volatile and hardware specific, the
404    /// mach_continuous_time must originate from the same device and boot session
405    /// that SRAbsoluteTimeFromContinuousTime() is called from.
406    /// The return value for mach_continuous_times spanning boot sessions or devices
407    /// is undefined.
408    #[cfg(feature = "objc2-core-foundation")]
409    pub fn SRAbsoluteTimeFromContinuousTime(cont: u64) -> SRAbsoluteTime;
410}
411
412extern "C-unwind" {
413    /// Convert a SRAbsoluteTime to a CFAbsoluteTime.
414    ///
415    /// The CFAbsoluteTime returned is based on calculations relative to the current
416    /// wall clock. This means that if the system time is 5 seconds fast against UTC,
417    /// the result will be 5 seconds fast to when the event happened relative to UTC.
418    #[cfg(feature = "objc2-core-foundation")]
419    pub fn SRAbsoluteTimeToCFAbsoluteTime(sr: SRAbsoluteTime) -> CFAbsoluteTime;
420}
421
422extern "C-unwind" {
423    /// Convert a CFAbsoluteTime to an SRAbsoluteTime.
424    ///
425    /// The SRAbsoluteTime returned is based on calculations relative to the current
426    /// wall clock. This means that if the system time is 5 seconds fast against UTC,
427    /// the result will be 5 seconds fast to when the event happened relative to UTC.
428    #[cfg(feature = "objc2-core-foundation")]
429    pub fn SRAbsoluteTimeFromCFAbsoluteTime(cf: CFAbsoluteTime) -> SRAbsoluteTime;
430}
431
432mod private_NSDateSensorKit {
433    pub trait Sealed {}
434}
435
436/// Category "SensorKit" on [`NSDate`].
437#[doc(alias = "SensorKit")]
438pub unsafe trait NSDateSensorKit:
439    ClassType + Sized + private_NSDateSensorKit::Sealed
440{
441    extern_methods!(
442        #[cfg(feature = "objc2-core-foundation")]
443        #[unsafe(method(dateWithSRAbsoluteTime:))]
444        #[unsafe(method_family = none)]
445        unsafe fn dateWithSRAbsoluteTime(time: SRAbsoluteTime) -> Retained<Self>;
446
447        #[cfg(feature = "objc2-core-foundation")]
448        #[unsafe(method(initWithSRAbsoluteTime:))]
449        #[unsafe(method_family = init)]
450        unsafe fn initWithSRAbsoluteTime(
451            this: Allocated<Self>,
452            time: SRAbsoluteTime,
453        ) -> Retained<Self>;
454
455        #[cfg(feature = "objc2-core-foundation")]
456        #[unsafe(method(srAbsoluteTime))]
457        #[unsafe(method_family = none)]
458        unsafe fn srAbsoluteTime(&self) -> SRAbsoluteTime;
459    );
460}
461
462impl private_NSDateSensorKit::Sealed for NSDate {}
463unsafe impl NSDateSensorKit for NSDate {}
464
465extern_class!(
466    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srfetchresult?language=objc)
467    #[unsafe(super(NSObject))]
468    #[derive(Debug, PartialEq, Eq, Hash)]
469    pub struct SRFetchResult<SampleType: ?Sized = AnyObject>;
470);
471
472impl<SampleType: ?Sized + Message> SRFetchResult<SampleType> {
473    /// Unchecked conversion of the generic parameter.
474    ///
475    /// # Safety
476    ///
477    /// The generic must be valid to reinterpret as the given type.
478    #[inline]
479    pub unsafe fn cast_unchecked<NewSampleType: ?Sized + Message>(
480        &self,
481    ) -> &SRFetchResult<NewSampleType> {
482        unsafe { &*((self as *const Self).cast()) }
483    }
484}
485
486extern_conformance!(
487    unsafe impl<SampleType: ?Sized> NSCopying for SRFetchResult<SampleType> {}
488);
489
490unsafe impl<SampleType: ?Sized + Message> CopyingHelper for SRFetchResult<SampleType> {
491    type Result = Self;
492}
493
494extern_conformance!(
495    unsafe impl<SampleType: ?Sized> NSObjectProtocol for SRFetchResult<SampleType> {}
496);
497
498impl<SampleType: Message> SRFetchResult<SampleType> {
499    extern_methods!(
500        /// Retrieves the resultant sample
501        ///
502        /// The caller is expected to know what the result type should be
503        ///
504        /// Note: This may thrown an exception if the sample could not be constructed from
505        /// the data in the datastore
506        #[unsafe(method(sample))]
507        #[unsafe(method_family = none)]
508        pub unsafe fn sample(&self) -> Retained<SampleType>;
509
510        #[cfg(feature = "objc2-core-foundation")]
511        /// the timestamp the sample was written to the data store
512        #[unsafe(method(timestamp))]
513        #[unsafe(method_family = none)]
514        pub unsafe fn timestamp(&self) -> SRAbsoluteTime;
515
516        #[unsafe(method(init))]
517        #[unsafe(method_family = init)]
518        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
519
520        #[unsafe(method(new))]
521        #[unsafe(method_family = new)]
522        pub unsafe fn new() -> Retained<Self>;
523    );
524}
525
526extern_class!(
527    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdevice?language=objc)
528    #[unsafe(super(NSObject))]
529    #[derive(Debug, PartialEq, Eq, Hash)]
530    pub struct SRDevice;
531);
532
533extern_conformance!(
534    unsafe impl NSCoding for SRDevice {}
535);
536
537extern_conformance!(
538    unsafe impl NSCopying for SRDevice {}
539);
540
541unsafe impl CopyingHelper for SRDevice {
542    type Result = Self;
543}
544
545extern_conformance!(
546    unsafe impl NSObjectProtocol for SRDevice {}
547);
548
549extern_conformance!(
550    unsafe impl NSSecureCoding for SRDevice {}
551);
552
553impl SRDevice {
554    extern_methods!(
555        #[unsafe(method(currentDevice))]
556        #[unsafe(method_family = none)]
557        pub unsafe fn currentDevice() -> Retained<SRDevice>;
558
559        #[unsafe(method(name))]
560        #[unsafe(method_family = none)]
561        pub unsafe fn name(&self) -> Retained<NSString>;
562
563        #[unsafe(method(model))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn model(&self) -> Retained<NSString>;
566
567        #[unsafe(method(systemName))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn systemName(&self) -> Retained<NSString>;
570
571        #[unsafe(method(systemVersion))]
572        #[unsafe(method_family = none)]
573        pub unsafe fn systemVersion(&self) -> Retained<NSString>;
574
575        #[unsafe(method(productType))]
576        #[unsafe(method_family = none)]
577        pub unsafe fn productType(&self) -> Retained<NSString>;
578    );
579}
580
581/// Methods declared on superclass `NSObject`.
582impl SRDevice {
583    extern_methods!(
584        #[unsafe(method(init))]
585        #[unsafe(method_family = init)]
586        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
587
588        #[unsafe(method(new))]
589        #[unsafe(method_family = new)]
590        pub unsafe fn new() -> Retained<Self>;
591    );
592}
593
594extern_class!(
595    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srfetchrequest?language=objc)
596    #[unsafe(super(NSObject))]
597    #[derive(Debug, PartialEq, Eq, Hash)]
598    pub struct SRFetchRequest;
599);
600
601extern_conformance!(
602    unsafe impl NSObjectProtocol for SRFetchRequest {}
603);
604
605impl SRFetchRequest {
606    extern_methods!(
607        #[cfg(feature = "objc2-core-foundation")]
608        /// Fetch data starting after this time.
609        ///
610        /// This value must be specified for a valid request to be performed.
611        /// If it is not specified, this will result in a SRErrorInvalidRequest error in the
612        /// -sensorReader:fetchingRequest:failedWithError: SRSensorReaderDelegate callback.
613        ///
614        /// The time range for fetching will be exclusive of start time and inclusive of end time:
615        /// (start, end] . An SRSensorReader can use this to continue fetching a stream of
616        /// data based on the last sample timestamp they have read.
617        #[unsafe(method(from))]
618        #[unsafe(method_family = none)]
619        pub unsafe fn from(&self) -> SRAbsoluteTime;
620
621        #[cfg(feature = "objc2-core-foundation")]
622        /// Setter for [`from`][Self::from].
623        #[unsafe(method(setFrom:))]
624        #[unsafe(method_family = none)]
625        pub unsafe fn setFrom(&self, from: SRAbsoluteTime);
626
627        #[cfg(feature = "objc2-core-foundation")]
628        /// Fetch data ending at this time.
629        ///
630        /// This value must be specified for a valid request to be performed.
631        /// If it is not specified, this will result in a SRErrorInvalidRequest error in the
632        /// -sensorReader:fetchingRequest:failedWithError: SRSensorReaderDelegate callback.
633        #[unsafe(method(to))]
634        #[unsafe(method_family = none)]
635        pub unsafe fn to(&self) -> SRAbsoluteTime;
636
637        #[cfg(feature = "objc2-core-foundation")]
638        /// Setter for [`to`][Self::to].
639        #[unsafe(method(setTo:))]
640        #[unsafe(method_family = none)]
641        pub unsafe fn setTo(&self, to: SRAbsoluteTime);
642
643        /// Fetch data generated on this device
644        ///
645        /// If this is not specified, the current device will be used.
646        #[unsafe(method(device))]
647        #[unsafe(method_family = none)]
648        pub unsafe fn device(&self) -> Retained<SRDevice>;
649
650        /// Setter for [`device`][Self::device].
651        #[unsafe(method(setDevice:))]
652        #[unsafe(method_family = none)]
653        pub unsafe fn setDevice(&self, device: &SRDevice);
654    );
655}
656
657/// Methods declared on superclass `NSObject`.
658impl SRFetchRequest {
659    extern_methods!(
660        #[unsafe(method(init))]
661        #[unsafe(method_family = init)]
662        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
663
664        #[unsafe(method(new))]
665        #[unsafe(method_family = new)]
666        pub unsafe fn new() -> Retained<Self>;
667    );
668}
669
670/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srauthorizationstatus?language=objc)
671// NS_ENUM
672#[repr(transparent)]
673#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
674pub struct SRAuthorizationStatus(pub NSInteger);
675impl SRAuthorizationStatus {
676    /// User has not yet made a choice regarding this application
677    #[doc(alias = "SRAuthorizationStatusNotDetermined")]
678    pub const NotDetermined: Self = Self(0);
679    /// User has granted authorization to this application
680    #[doc(alias = "SRAuthorizationStatusAuthorized")]
681    pub const Authorized: Self = Self(1);
682    /// User has denied authorization to this application or
683    /// data collection is disabled in Settings.
684    #[doc(alias = "SRAuthorizationStatusDenied")]
685    pub const Denied: Self = Self(2);
686}
687
688unsafe impl Encode for SRAuthorizationStatus {
689    const ENCODING: Encoding = NSInteger::ENCODING;
690}
691
692unsafe impl RefEncode for SRAuthorizationStatus {
693    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
694}
695
696extern_protocol!(
697    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorreaderdelegate?language=objc)
698    pub unsafe trait SRSensorReaderDelegate: NSObjectProtocol {
699        /// Invoked when a sample has been fetched
700        ///
701        /// This callback can be called multiple times
702        /// when there are multiple results.
703        ///
704        ///
705        /// Parameter `fetchRequest`: The request corresponding to the this result
706        ///
707        /// Parameter `result`: One result of the fetch. The caller is expected to
708        /// know what type of sample is returned.
709        ///
710        ///
711        /// Note: The fetchResult is not valid after the callback is complete. If the caller needs
712        /// to access the result at a later time, it must be copied not merely retained
713        ///
714        ///
715        /// Returns: The delegate should return YES if the fetch should continue, NO if the fetch should stop
716        ///
717        /// # Safety
718        ///
719        /// `result` generic should be of the correct type.
720        #[optional]
721        #[unsafe(method(sensorReader:fetchingRequest:didFetchResult:))]
722        #[unsafe(method_family = none)]
723        unsafe fn sensorReader_fetchingRequest_didFetchResult(
724            &self,
725            reader: &SRSensorReader,
726            fetch_request: &SRFetchRequest,
727            result: &SRFetchResult,
728        ) -> bool;
729
730        /// Invoked when a fetch has been completed successfully
731        #[optional]
732        #[unsafe(method(sensorReader:didCompleteFetch:))]
733        #[unsafe(method_family = none)]
734        unsafe fn sensorReader_didCompleteFetch(
735            &self,
736            reader: &SRSensorReader,
737            fetch_request: &SRFetchRequest,
738        );
739
740        /// Invoked when a fetch has completed with an error
741        #[optional]
742        #[unsafe(method(sensorReader:fetchingRequest:failedWithError:))]
743        #[unsafe(method_family = none)]
744        unsafe fn sensorReader_fetchingRequest_failedWithError(
745            &self,
746            reader: &SRSensorReader,
747            fetch_request: &SRFetchRequest,
748            error: &NSError,
749        );
750
751        /// Invoked when authorization status has changed
752        #[optional]
753        #[unsafe(method(sensorReader:didChangeAuthorizationStatus:))]
754        #[unsafe(method_family = none)]
755        unsafe fn sensorReader_didChangeAuthorizationStatus(
756            &self,
757            reader: &SRSensorReader,
758            authorization_status: SRAuthorizationStatus,
759        );
760
761        /// Invoked after a SRSensorReader has request that recording be
762        /// started for a sensor
763        #[optional]
764        #[unsafe(method(sensorReaderWillStartRecording:))]
765        #[unsafe(method_family = none)]
766        unsafe fn sensorReaderWillStartRecording(&self, reader: &SRSensorReader);
767
768        /// Invoked if there was an error starting recording for a given sensor
769        #[optional]
770        #[unsafe(method(sensorReader:startRecordingFailedWithError:))]
771        #[unsafe(method_family = none)]
772        unsafe fn sensorReader_startRecordingFailedWithError(
773            &self,
774            reader: &SRSensorReader,
775            error: &NSError,
776        );
777
778        /// Invoked after a SRSensorReader has request that recording be
779        /// stopped for a sensor
780        #[optional]
781        #[unsafe(method(sensorReaderDidStopRecording:))]
782        #[unsafe(method_family = none)]
783        unsafe fn sensorReaderDidStopRecording(&self, reader: &SRSensorReader);
784
785        /// Invoked if there was an error starting recording for a given sensor
786        #[optional]
787        #[unsafe(method(sensorReader:stopRecordingFailedWithError:))]
788        #[unsafe(method_family = none)]
789        unsafe fn sensorReader_stopRecordingFailedWithError(
790            &self,
791            reader: &SRSensorReader,
792            error: &NSError,
793        );
794
795        #[optional]
796        #[unsafe(method(sensorReader:didFetchDevices:))]
797        #[unsafe(method_family = none)]
798        unsafe fn sensorReader_didFetchDevices(
799            &self,
800            reader: &SRSensorReader,
801            devices: &NSArray<SRDevice>,
802        );
803
804        #[optional]
805        #[unsafe(method(sensorReader:fetchDevicesDidFailWithError:))]
806        #[unsafe(method_family = none)]
807        unsafe fn sensorReader_fetchDevicesDidFailWithError(
808            &self,
809            reader: &SRSensorReader,
810            error: &NSError,
811        );
812    }
813);
814
815extern_class!(
816    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsensorreader?language=objc)
817    #[unsafe(super(NSObject))]
818    #[derive(Debug, PartialEq, Eq, Hash)]
819    pub struct SRSensorReader;
820);
821
822extern_conformance!(
823    unsafe impl NSObjectProtocol for SRSensorReader {}
824);
825
826impl SRSensorReader {
827    extern_methods!(
828        /// Initializes an SRSensorReader that will fetch data for the current device
829        /// and any companion
830        #[unsafe(method(initWithSensor:))]
831        #[unsafe(method_family = init)]
832        pub unsafe fn initWithSensor(this: Allocated<Self>, sensor: &SRSensor) -> Retained<Self>;
833
834        #[unsafe(method(init))]
835        #[unsafe(method_family = init)]
836        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
837
838        #[unsafe(method(new))]
839        #[unsafe(method_family = new)]
840        pub unsafe fn new() -> Retained<Self>;
841
842        /// Starts recording for the reader's sensor
843        ///
844        ///
845        /// The reader must be authorized for the sensor for this to succeed.
846        /// This starts recording on this device and any paired devices.
847        /// If other readers have already started the sensor recording this
848        /// reader's interest in recording will be maintained. Other readers in
849        /// other apps for the same sensor will not affect the recording status
850        /// of this reader.
851        ///
852        /// In the case of success, completion notification will be delivered
853        /// to the delegate in the sensorReaderWillStartRecording:
854        /// delegate method.
855        ///
856        /// In the case of failure, error notification will be delivered
857        /// to the delegate in the sensorReader:startRecordingFailedWithError:
858        /// delegate method.
859        #[unsafe(method(startRecording))]
860        #[unsafe(method_family = none)]
861        pub unsafe fn startRecording(&self);
862
863        /// Stops recording for the reader's sensor
864        ///
865        ///
866        /// The reader must be authorized for the sensor for this to succeed.
867        /// This stops recording on this device and any paired devices.
868        /// Sensor recording will continue until the last interested reader has
869        /// stopped recording.
870        ///
871        /// In the case of success, completion notification will be delivered
872        /// to the delegate in the sensorReaderDidStopRecording:
873        /// delegate method.
874        ///
875        /// In the case of failure, error notification will be delivered
876        /// to the delegate in the sensorReader:stopRecordingFailedWithError:
877        /// delegate method.
878        #[unsafe(method(stopRecording))]
879        #[unsafe(method_family = none)]
880        pub unsafe fn stopRecording(&self);
881
882        /// Fetches device information for all devices that have stored data for
883        /// the given sensor in SensorKit
884        ///
885        /// If the request completes successfully, devices will be returned to the
886        /// delegate in the sensorReader:fetchedDevices: callback. If the request
887        /// failed, an error will be returned to the delegate in the
888        /// sensorReader:fetchDevicesFailedWithError:
889        /// method
890        #[unsafe(method(fetchDevices))]
891        #[unsafe(method_family = none)]
892        pub unsafe fn fetchDevices(&self);
893
894        /// Fetches samples for the reader's sensor for given request parameters
895        ///
896        ///
897        /// The reader must be authorized for the sensor for this to succeed.
898        ///
899        /// Samples will be delivered to the delegate through multiple calls
900        /// to the sensorReader:fetchingRequest:didFetchResult: delegate method
901        ///
902        /// In the case of a failure, any error will be delivered to the delegate in the
903        /// sensorReader:fetchingRequest:failedWithError: method.
904        ///
905        /// In the case of success, completion notification will be delivered
906        /// to the delegate in the sensorReader:didCompleteFetch: method.
907        ///
908        ///
909        /// Parameter `request`: The query parameters for this fetch
910        #[unsafe(method(fetch:))]
911        #[unsafe(method_family = none)]
912        pub unsafe fn fetch(&self, request: &SRFetchRequest);
913
914        /// The current authorization status of the calling application.
915        #[unsafe(method(authorizationStatus))]
916        #[unsafe(method_family = none)]
917        pub unsafe fn authorizationStatus(&self) -> SRAuthorizationStatus;
918
919        /// the sensor this reader was initialized with
920        #[unsafe(method(sensor))]
921        #[unsafe(method_family = none)]
922        pub unsafe fn sensor(&self) -> Retained<SRSensor>;
923
924        #[unsafe(method(delegate))]
925        #[unsafe(method_family = none)]
926        pub unsafe fn delegate(
927            &self,
928        ) -> Option<Retained<ProtocolObject<dyn SRSensorReaderDelegate>>>;
929
930        /// Setter for [`delegate`][Self::delegate].
931        ///
932        /// This is a [weak property][objc2::topics::weak_property].
933        #[unsafe(method(setDelegate:))]
934        #[unsafe(method_family = none)]
935        pub unsafe fn setDelegate(
936            &self,
937            delegate: Option<&ProtocolObject<dyn SRSensorReaderDelegate>>,
938        );
939
940        #[cfg(feature = "block2")]
941        /// Request authorization to a given set of sensors
942        ///
943        ///
944        /// If the SRSensorReader instance is not authorized, this
945        /// method must be called before any other methods. Failure to request
946        /// authorization will cause errors to be returned from the other methods.
947        ///
948        /// When SensorKit prepares the prompt for display, it will look at the
949        /// NSSensorKitUsageDetail key in your Info.plist.  The value should be
950        /// a dictionary containing usage descriptions for all of the sensors being
951        /// requested.  The description key you provide to this method must
952        /// correspond to an entry in that dictionary.  To retrieve a localized
953        /// string, SensorKit will load your InfoPlist.strings file and try to look
954        /// up a string using the description key you provided.  If that fails,
955        /// SensorKit will use the content provided in your Info.plist.
956        ///
957        /// SensorKit may decide against showing the user a prompt.  For example,
958        /// if the user has already chosen whether to grant the application access
959        /// to all of the types provided.  When that happens, your completion block
960        /// will be called with an appropriate  NSError.  If the user responded to
961        /// the prompt, your completion block will be called with a nil error.
962        /// Changes in authorization status will delivered to the delegate in the
963        /// sensorReader:didChangeAuthorizationStatus: method.
964        #[unsafe(method(requestAuthorizationForSensors:completion:))]
965        #[unsafe(method_family = none)]
966        pub unsafe fn requestAuthorizationForSensors_completion(
967            sensors: &NSSet<SRSensor>,
968            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
969        );
970    );
971}
972
973extern "C" {
974    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srerrordomain?language=objc)
975    pub static SRErrorDomain: &'static NSErrorDomain;
976}
977
978/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srerrorcode?language=objc)
979// NS_ERROR_ENUM
980#[repr(transparent)]
981#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
982pub struct SRErrorCode(pub NSInteger);
983impl SRErrorCode {
984    /// No valid entitlement found
985    #[doc(alias = "SRErrorInvalidEntitlement")]
986    pub const InvalidEntitlement: Self = Self(0);
987    /// Insufficient authorization to perform the action.
988    #[doc(alias = "SRErrorNoAuthorization")]
989    pub const NoAuthorization: Self = Self(1);
990    /// Data is not accessible at this time
991    #[doc(alias = "SRErrorDataInaccessible")]
992    pub const DataInaccessible: Self = Self(2);
993    /// Fetch request contained invalid values
994    #[doc(alias = "SRErrorFetchRequestInvalid")]
995    pub const FetchRequestInvalid: Self = Self(3);
996    /// Authorization request not completed
997    #[doc(alias = "SRErrorPromptDeclined")]
998    pub const PromptDeclined: Self = Self(4);
999}
1000
1001unsafe impl Encode for SRErrorCode {
1002    const ENCODING: Encoding = NSInteger::ENCODING;
1003}
1004
1005unsafe impl RefEncode for SRErrorCode {
1006    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1007}
1008
1009/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srambientlightsensorplacement?language=objc)
1010// NS_ENUM
1011#[repr(transparent)]
1012#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1013pub struct SRAmbientLightSensorPlacement(pub NSInteger);
1014impl SRAmbientLightSensorPlacement {
1015    #[doc(alias = "SRAmbientLightSensorPlacementUnknown")]
1016    pub const Unknown: Self = Self(0);
1017    #[doc(alias = "SRAmbientLightSensorPlacementFrontTop")]
1018    pub const FrontTop: Self = Self(1);
1019    #[doc(alias = "SRAmbientLightSensorPlacementFrontBottom")]
1020    pub const FrontBottom: Self = Self(2);
1021    #[doc(alias = "SRAmbientLightSensorPlacementFrontRight")]
1022    pub const FrontRight: Self = Self(3);
1023    #[doc(alias = "SRAmbientLightSensorPlacementFrontLeft")]
1024    pub const FrontLeft: Self = Self(4);
1025    #[doc(alias = "SRAmbientLightSensorPlacementFrontTopRight")]
1026    pub const FrontTopRight: Self = Self(5);
1027    #[doc(alias = "SRAmbientLightSensorPlacementFrontTopLeft")]
1028    pub const FrontTopLeft: Self = Self(6);
1029    #[doc(alias = "SRAmbientLightSensorPlacementFrontBottomRight")]
1030    pub const FrontBottomRight: Self = Self(7);
1031    #[doc(alias = "SRAmbientLightSensorPlacementFrontBottomLeft")]
1032    pub const FrontBottomLeft: Self = Self(8);
1033}
1034
1035unsafe impl Encode for SRAmbientLightSensorPlacement {
1036    const ENCODING: Encoding = NSInteger::ENCODING;
1037}
1038
1039unsafe impl RefEncode for SRAmbientLightSensorPlacement {
1040    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1041}
1042
1043/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srambientlightchromaticity?language=objc)
1044#[repr(C)]
1045#[derive(Clone, Copy, Debug, PartialEq)]
1046pub struct SRAmbientLightChromaticity {
1047    pub x: f32,
1048    pub y: f32,
1049}
1050
1051unsafe impl Encode for SRAmbientLightChromaticity {
1052    const ENCODING: Encoding = Encoding::Struct("?", &[<f32>::ENCODING, <f32>::ENCODING]);
1053}
1054
1055unsafe impl RefEncode for SRAmbientLightChromaticity {
1056    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1057}
1058
1059extern_class!(
1060    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srambientlightsample?language=objc)
1061    #[unsafe(super(NSObject))]
1062    #[derive(Debug, PartialEq, Eq, Hash)]
1063    pub struct SRAmbientLightSample;
1064);
1065
1066extern_conformance!(
1067    unsafe impl NSObjectProtocol for SRAmbientLightSample {}
1068);
1069
1070impl SRAmbientLightSample {
1071    extern_methods!(
1072        #[unsafe(method(placement))]
1073        #[unsafe(method_family = none)]
1074        pub unsafe fn placement(&self) -> SRAmbientLightSensorPlacement;
1075
1076        /// Chromaticity is only valid on supporting devices. If not supported,
1077        /// the values will be zero.
1078        #[unsafe(method(chromaticity))]
1079        #[unsafe(method_family = none)]
1080        pub unsafe fn chromaticity(&self) -> SRAmbientLightChromaticity;
1081
1082        #[unsafe(method(lux))]
1083        #[unsafe(method_family = none)]
1084        pub unsafe fn lux(&self) -> Retained<NSMeasurement<NSUnitIlluminance>>;
1085    );
1086}
1087
1088/// Methods declared on superclass `NSObject`.
1089impl SRAmbientLightSample {
1090    extern_methods!(
1091        #[unsafe(method(init))]
1092        #[unsafe(method_family = init)]
1093        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1094
1095        #[unsafe(method(new))]
1096        #[unsafe(method_family = new)]
1097        pub unsafe fn new() -> Retained<Self>;
1098    );
1099}
1100
1101/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srlocationcategory?language=objc)
1102// NS_ENUM
1103#[repr(transparent)]
1104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1105pub struct SRLocationCategory(pub NSInteger);
1106impl SRLocationCategory {
1107    #[doc(alias = "SRLocationCategoryUnknown")]
1108    pub const Unknown: Self = Self(0);
1109    #[doc(alias = "SRLocationCategoryHome")]
1110    pub const Home: Self = Self(1);
1111    #[doc(alias = "SRLocationCategoryWork")]
1112    pub const Work: Self = Self(2);
1113    #[doc(alias = "SRLocationCategorySchool")]
1114    pub const School: Self = Self(3);
1115    #[doc(alias = "SRLocationCategoryGym")]
1116    pub const Gym: Self = Self(4);
1117}
1118
1119unsafe impl Encode for SRLocationCategory {
1120    const ENCODING: Encoding = NSInteger::ENCODING;
1121}
1122
1123unsafe impl RefEncode for SRLocationCategory {
1124    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1125}
1126
1127extern_class!(
1128    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srvisit?language=objc)
1129    #[unsafe(super(NSObject))]
1130    #[derive(Debug, PartialEq, Eq, Hash)]
1131    pub struct SRVisit;
1132);
1133
1134extern_conformance!(
1135    unsafe impl NSObjectProtocol for SRVisit {}
1136);
1137
1138impl SRVisit {
1139    extern_methods!(
1140        #[cfg(feature = "objc2-core-location")]
1141        /// The distance between the location of interest to home
1142        #[unsafe(method(distanceFromHome))]
1143        #[unsafe(method_family = none)]
1144        pub unsafe fn distanceFromHome(&self) -> CLLocationDistance;
1145
1146        /// The range of time the arrival to a location of interest occurred
1147        #[unsafe(method(arrivalDateInterval))]
1148        #[unsafe(method_family = none)]
1149        pub unsafe fn arrivalDateInterval(&self) -> Retained<NSDateInterval>;
1150
1151        /// The range of time the departure from a location of interest occurred
1152        #[unsafe(method(departureDateInterval))]
1153        #[unsafe(method_family = none)]
1154        pub unsafe fn departureDateInterval(&self) -> Retained<NSDateInterval>;
1155
1156        #[unsafe(method(locationCategory))]
1157        #[unsafe(method_family = none)]
1158        pub unsafe fn locationCategory(&self) -> SRLocationCategory;
1159
1160        /// An identifier for the location of interest.
1161        /// This can be used to identify the same location regardless of type
1162        #[unsafe(method(identifier))]
1163        #[unsafe(method_family = none)]
1164        pub unsafe fn identifier(&self) -> Retained<NSUUID>;
1165    );
1166}
1167
1168/// Methods declared on superclass `NSObject`.
1169impl SRVisit {
1170    extern_methods!(
1171        #[unsafe(method(init))]
1172        #[unsafe(method_family = init)]
1173        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1174
1175        #[unsafe(method(new))]
1176        #[unsafe(method_family = new)]
1177        pub unsafe fn new() -> Retained<Self>;
1178    );
1179}
1180
1181/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorykey?language=objc)
1182// NS_TYPED_ENUM
1183pub type SRDeviceUsageCategoryKey = NSString;
1184
1185extern "C" {
1186    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorygames?language=objc)
1187    pub static SRDeviceUsageCategoryGames: &'static SRDeviceUsageCategoryKey;
1188}
1189
1190extern "C" {
1191    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorybusiness?language=objc)
1192    pub static SRDeviceUsageCategoryBusiness: &'static SRDeviceUsageCategoryKey;
1193}
1194
1195extern "C" {
1196    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryweather?language=objc)
1197    pub static SRDeviceUsageCategoryWeather: &'static SRDeviceUsageCategoryKey;
1198}
1199
1200extern "C" {
1201    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryutilities?language=objc)
1202    pub static SRDeviceUsageCategoryUtilities: &'static SRDeviceUsageCategoryKey;
1203}
1204
1205extern "C" {
1206    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorytravel?language=objc)
1207    pub static SRDeviceUsageCategoryTravel: &'static SRDeviceUsageCategoryKey;
1208}
1209
1210extern "C" {
1211    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorysports?language=objc)
1212    pub static SRDeviceUsageCategorySports: &'static SRDeviceUsageCategoryKey;
1213}
1214
1215extern "C" {
1216    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorysocialnetworking?language=objc)
1217    pub static SRDeviceUsageCategorySocialNetworking: &'static SRDeviceUsageCategoryKey;
1218}
1219
1220extern "C" {
1221    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryreference?language=objc)
1222    pub static SRDeviceUsageCategoryReference: &'static SRDeviceUsageCategoryKey;
1223}
1224
1225extern "C" {
1226    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryproductivity?language=objc)
1227    pub static SRDeviceUsageCategoryProductivity: &'static SRDeviceUsageCategoryKey;
1228}
1229
1230extern "C" {
1231    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryphotoandvideo?language=objc)
1232    pub static SRDeviceUsageCategoryPhotoAndVideo: &'static SRDeviceUsageCategoryKey;
1233}
1234
1235extern "C" {
1236    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorynews?language=objc)
1237    pub static SRDeviceUsageCategoryNews: &'static SRDeviceUsageCategoryKey;
1238}
1239
1240extern "C" {
1241    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorynavigation?language=objc)
1242    pub static SRDeviceUsageCategoryNavigation: &'static SRDeviceUsageCategoryKey;
1243}
1244
1245extern "C" {
1246    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorymusic?language=objc)
1247    pub static SRDeviceUsageCategoryMusic: &'static SRDeviceUsageCategoryKey;
1248}
1249
1250extern "C" {
1251    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorylifestyle?language=objc)
1252    pub static SRDeviceUsageCategoryLifestyle: &'static SRDeviceUsageCategoryKey;
1253}
1254
1255extern "C" {
1256    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryhealthandfitness?language=objc)
1257    pub static SRDeviceUsageCategoryHealthAndFitness: &'static SRDeviceUsageCategoryKey;
1258}
1259
1260extern "C" {
1261    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryfinance?language=objc)
1262    pub static SRDeviceUsageCategoryFinance: &'static SRDeviceUsageCategoryKey;
1263}
1264
1265extern "C" {
1266    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryentertainment?language=objc)
1267    pub static SRDeviceUsageCategoryEntertainment: &'static SRDeviceUsageCategoryKey;
1268}
1269
1270extern "C" {
1271    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryeducation?language=objc)
1272    pub static SRDeviceUsageCategoryEducation: &'static SRDeviceUsageCategoryKey;
1273}
1274
1275extern "C" {
1276    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorybooks?language=objc)
1277    pub static SRDeviceUsageCategoryBooks: &'static SRDeviceUsageCategoryKey;
1278}
1279
1280extern "C" {
1281    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorymedical?language=objc)
1282    pub static SRDeviceUsageCategoryMedical: &'static SRDeviceUsageCategoryKey;
1283}
1284
1285extern "C" {
1286    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorynewsstand?language=objc)
1287    pub static SRDeviceUsageCategoryNewsstand: &'static SRDeviceUsageCategoryKey;
1288}
1289
1290extern "C" {
1291    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorycatalogs?language=objc)
1292    pub static SRDeviceUsageCategoryCatalogs: &'static SRDeviceUsageCategoryKey;
1293}
1294
1295extern "C" {
1296    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorykids?language=objc)
1297    pub static SRDeviceUsageCategoryKids: &'static SRDeviceUsageCategoryKey;
1298}
1299
1300extern "C" {
1301    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorymiscellaneous?language=objc)
1302    pub static SRDeviceUsageCategoryMiscellaneous: &'static SRDeviceUsageCategoryKey;
1303}
1304
1305extern "C" {
1306    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryfoodanddrink?language=objc)
1307    pub static SRDeviceUsageCategoryFoodAndDrink: &'static SRDeviceUsageCategoryKey;
1308}
1309
1310extern "C" {
1311    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorydevelopertools?language=objc)
1312    pub static SRDeviceUsageCategoryDeveloperTools: &'static SRDeviceUsageCategoryKey;
1313}
1314
1315extern "C" {
1316    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorygraphicsanddesign?language=objc)
1317    pub static SRDeviceUsageCategoryGraphicsAndDesign: &'static SRDeviceUsageCategoryKey;
1318}
1319
1320extern "C" {
1321    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategoryshopping?language=objc)
1322    pub static SRDeviceUsageCategoryShopping: &'static SRDeviceUsageCategoryKey;
1323}
1324
1325extern "C" {
1326    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagecategorystickers?language=objc)
1327    pub static SRDeviceUsageCategoryStickers: &'static SRDeviceUsageCategoryKey;
1328}
1329
1330extern_class!(
1331    /// A supplemental category to provide more context than just the app category
1332    ///
1333    ///
1334    /// The app categories from
1335    /// `SRDeviceUsageCategoryKey`are very general.
1336    /// Providing a supplemental category allows more context about the specific app while
1337    /// not revealing the exact app identity.
1338    ///
1339    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsupplementalcategory?language=objc)
1340    #[unsafe(super(NSObject))]
1341    #[derive(Debug, PartialEq, Eq, Hash)]
1342    pub struct SRSupplementalCategory;
1343);
1344
1345unsafe impl Send for SRSupplementalCategory {}
1346
1347unsafe impl Sync for SRSupplementalCategory {}
1348
1349extern_conformance!(
1350    unsafe impl NSCoding for SRSupplementalCategory {}
1351);
1352
1353extern_conformance!(
1354    unsafe impl NSCopying for SRSupplementalCategory {}
1355);
1356
1357unsafe impl CopyingHelper for SRSupplementalCategory {
1358    type Result = Self;
1359}
1360
1361extern_conformance!(
1362    unsafe impl NSObjectProtocol for SRSupplementalCategory {}
1363);
1364
1365extern_conformance!(
1366    unsafe impl NSSecureCoding for SRSupplementalCategory {}
1367);
1368
1369impl SRSupplementalCategory {
1370    extern_methods!(
1371        /// An opaque identifier for the supplemental category
1372        ///
1373        /// More information about what this category represents can be found in Apple's developer documentation
1374        ///
1375        /// This property is not atomic.
1376        ///
1377        /// # Safety
1378        ///
1379        /// This might not be thread-safe.
1380        #[unsafe(method(identifier))]
1381        #[unsafe(method_family = none)]
1382        pub unsafe fn identifier(&self) -> Retained<NSString>;
1383
1384        #[unsafe(method(init))]
1385        #[unsafe(method_family = init)]
1386        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1387
1388        #[unsafe(method(new))]
1389        #[unsafe(method_family = new)]
1390        pub unsafe fn new() -> Retained<Self>;
1391    );
1392}
1393
1394extern_class!(
1395    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeviceusagereport?language=objc)
1396    #[unsafe(super(NSObject))]
1397    #[derive(Debug, PartialEq, Eq, Hash)]
1398    pub struct SRDeviceUsageReport;
1399);
1400
1401extern_conformance!(
1402    unsafe impl NSObjectProtocol for SRDeviceUsageReport {}
1403);
1404
1405impl SRDeviceUsageReport {
1406    extern_methods!(
1407        /// The duration of this report
1408        #[unsafe(method(duration))]
1409        #[unsafe(method_family = none)]
1410        pub unsafe fn duration(&self) -> NSTimeInterval;
1411
1412        /// Usage time of applications per category
1413        ///
1414        ///
1415        /// category is the primary genre from the app's iTunesMetadata.plist.
1416        #[unsafe(method(applicationUsageByCategory))]
1417        #[unsafe(method_family = none)]
1418        pub unsafe fn applicationUsageByCategory(
1419            &self,
1420        ) -> Retained<NSDictionary<SRDeviceUsageCategoryKey, NSArray<SRApplicationUsage>>>;
1421
1422        /// Usage time of notifications per category
1423        ///
1424        ///
1425        /// category is the primary genre from the notifying app's iTunesMetadata.plist.
1426        #[unsafe(method(notificationUsageByCategory))]
1427        #[unsafe(method_family = none)]
1428        pub unsafe fn notificationUsageByCategory(
1429            &self,
1430        ) -> Retained<NSDictionary<SRDeviceUsageCategoryKey, NSArray<SRNotificationUsage>>>;
1431
1432        /// Usage time of web domains per category
1433        ///
1434        ///
1435        /// category based on the primary Screen Time category of the web domain
1436        #[unsafe(method(webUsageByCategory))]
1437        #[unsafe(method_family = none)]
1438        pub unsafe fn webUsageByCategory(
1439            &self,
1440        ) -> Retained<NSDictionary<SRDeviceUsageCategoryKey, NSArray<SRWebUsage>>>;
1441
1442        /// Total number of screen wakes over this duration
1443        #[unsafe(method(totalScreenWakes))]
1444        #[unsafe(method_family = none)]
1445        pub unsafe fn totalScreenWakes(&self) -> NSInteger;
1446
1447        /// Total number of unlocks over this duration
1448        #[unsafe(method(totalUnlocks))]
1449        #[unsafe(method_family = none)]
1450        pub unsafe fn totalUnlocks(&self) -> NSInteger;
1451
1452        /// Total amount of time the device was unlocked over this duration
1453        #[unsafe(method(totalUnlockDuration))]
1454        #[unsafe(method_family = none)]
1455        pub unsafe fn totalUnlockDuration(&self) -> NSTimeInterval;
1456
1457        /// Version of the algorithm used to produce the report
1458        #[unsafe(method(version))]
1459        #[unsafe(method_family = none)]
1460        pub unsafe fn version(&self) -> Retained<NSString>;
1461    );
1462}
1463
1464/// Methods declared on superclass `NSObject`.
1465impl SRDeviceUsageReport {
1466    extern_methods!(
1467        #[unsafe(method(init))]
1468        #[unsafe(method_family = init)]
1469        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1470
1471        #[unsafe(method(new))]
1472        #[unsafe(method_family = new)]
1473        pub unsafe fn new() -> Retained<Self>;
1474    );
1475}
1476
1477/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srtextinputsessiontype?language=objc)
1478// NS_ENUM
1479#[repr(transparent)]
1480#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1481pub struct SRTextInputSessionType(pub NSInteger);
1482impl SRTextInputSessionType {
1483    #[doc(alias = "SRTextInputSessionTypeKeyboard")]
1484    pub const Keyboard: Self = Self(1);
1485    #[doc(alias = "SRTextInputSessionTypeThirdPartyKeyboard")]
1486    pub const ThirdPartyKeyboard: Self = Self(2);
1487    #[doc(alias = "SRTextInputSessionTypePencil")]
1488    pub const Pencil: Self = Self(3);
1489    #[doc(alias = "SRTextInputSessionTypeDictation")]
1490    pub const Dictation: Self = Self(4);
1491}
1492
1493unsafe impl Encode for SRTextInputSessionType {
1494    const ENCODING: Encoding = NSInteger::ENCODING;
1495}
1496
1497unsafe impl RefEncode for SRTextInputSessionType {
1498    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1499}
1500
1501extern_class!(
1502    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srtextinputsession?language=objc)
1503    #[unsafe(super(NSObject))]
1504    #[derive(Debug, PartialEq, Eq, Hash)]
1505    pub struct SRTextInputSession;
1506);
1507
1508extern_conformance!(
1509    unsafe impl NSObjectProtocol for SRTextInputSession {}
1510);
1511
1512impl SRTextInputSession {
1513    extern_methods!(
1514        #[unsafe(method(duration))]
1515        #[unsafe(method_family = none)]
1516        pub unsafe fn duration(&self) -> NSTimeInterval;
1517
1518        #[unsafe(method(sessionType))]
1519        #[unsafe(method_family = none)]
1520        pub unsafe fn sessionType(&self) -> SRTextInputSessionType;
1521
1522        /// Unique identifier of keyboard session
1523        #[unsafe(method(sessionIdentifier))]
1524        #[unsafe(method_family = none)]
1525        pub unsafe fn sessionIdentifier(&self) -> Retained<NSString>;
1526    );
1527}
1528
1529/// Methods declared on superclass `NSObject`.
1530impl SRTextInputSession {
1531    extern_methods!(
1532        #[unsafe(method(init))]
1533        #[unsafe(method_family = init)]
1534        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1535
1536        #[unsafe(method(new))]
1537        #[unsafe(method_family = new)]
1538        pub unsafe fn new() -> Retained<Self>;
1539    );
1540}
1541
1542extern_class!(
1543    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srapplicationusage?language=objc)
1544    #[unsafe(super(NSObject))]
1545    #[derive(Debug, PartialEq, Eq, Hash)]
1546    pub struct SRApplicationUsage;
1547);
1548
1549extern_conformance!(
1550    unsafe impl NSObjectProtocol for SRApplicationUsage {}
1551);
1552
1553impl SRApplicationUsage {
1554    extern_methods!(
1555        /// The bundle identifier of the app in use. Only populated for Apple apps.
1556        #[unsafe(method(bundleIdentifier))]
1557        #[unsafe(method_family = none)]
1558        pub unsafe fn bundleIdentifier(&self) -> Option<Retained<NSString>>;
1559
1560        /// The amount of time the app is used
1561        #[unsafe(method(usageTime))]
1562        #[unsafe(method_family = none)]
1563        pub unsafe fn usageTime(&self) -> NSTimeInterval;
1564
1565        /// An application identifier that is valid for the duration of the report.
1566        ///
1567        ///
1568        /// This is useful for identifying distinct application uses within the same
1569        /// report duration without revealing the actual application identifier.
1570        #[unsafe(method(reportApplicationIdentifier))]
1571        #[unsafe(method_family = none)]
1572        pub unsafe fn reportApplicationIdentifier(&self) -> Retained<NSString>;
1573
1574        /// The text input session types that occurred during this application usage
1575        ///
1576        ///
1577        /// The list of text input sessions describes the order and type of text input that may
1578        /// have occured during an application usage. Multiple sessions of the same text input
1579        /// type will appear as separate array entries. If no text input occurred, this array
1580        /// will be empty.
1581        #[unsafe(method(textInputSessions))]
1582        #[unsafe(method_family = none)]
1583        pub unsafe fn textInputSessions(&self) -> Retained<NSArray<SRTextInputSession>>;
1584
1585        /// Additional categories that describe this app
1586        #[unsafe(method(supplementalCategories))]
1587        #[unsafe(method_family = none)]
1588        pub unsafe fn supplementalCategories(&self) -> Retained<NSArray<SRSupplementalCategory>>;
1589
1590        /// App start time relative to the first app start time in the report interval
1591        ///
1592        ///
1593        /// relativeStartTime value for the very first app in the report interval is equal to 0, N seconds for the seccond app and so on.
1594        /// This will allow to order app uses and determine the time between app uses.
1595        #[unsafe(method(relativeStartTime))]
1596        #[unsafe(method_family = none)]
1597        pub unsafe fn relativeStartTime(&self) -> NSTimeInterval;
1598    );
1599}
1600
1601/// Methods declared on superclass `NSObject`.
1602impl SRApplicationUsage {
1603    extern_methods!(
1604        #[unsafe(method(init))]
1605        #[unsafe(method_family = init)]
1606        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1607
1608        #[unsafe(method(new))]
1609        #[unsafe(method_family = new)]
1610        pub unsafe fn new() -> Retained<Self>;
1611    );
1612}
1613
1614/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srnotificationevent?language=objc)
1615// NS_ENUM
1616#[repr(transparent)]
1617#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1618pub struct SRNotificationEvent(pub NSInteger);
1619impl SRNotificationEvent {
1620    #[doc(alias = "SRNotificationEventUnknown")]
1621    pub const Unknown: Self = Self(0);
1622    #[doc(alias = "SRNotificationEventReceived")]
1623    pub const Received: Self = Self(1);
1624    #[doc(alias = "SRNotificationEventDefaultAction")]
1625    pub const DefaultAction: Self = Self(2);
1626    #[doc(alias = "SRNotificationEventSupplementaryAction")]
1627    pub const SupplementaryAction: Self = Self(3);
1628    #[doc(alias = "SRNotificationEventClear")]
1629    pub const Clear: Self = Self(4);
1630    #[doc(alias = "SRNotificationEventNotificationCenterClearAll")]
1631    pub const NotificationCenterClearAll: Self = Self(5);
1632    #[doc(alias = "SRNotificationEventRemoved")]
1633    pub const Removed: Self = Self(6);
1634    #[doc(alias = "SRNotificationEventHide")]
1635    pub const Hide: Self = Self(7);
1636    #[doc(alias = "SRNotificationEventLongLook")]
1637    pub const LongLook: Self = Self(8);
1638    #[doc(alias = "SRNotificationEventSilence")]
1639    pub const Silence: Self = Self(9);
1640    #[doc(alias = "SRNotificationEventAppLaunch")]
1641    pub const AppLaunch: Self = Self(10);
1642    #[doc(alias = "SRNotificationEventExpired")]
1643    pub const Expired: Self = Self(11);
1644    #[doc(alias = "SRNotificationEventBannerPulldown")]
1645    pub const BannerPulldown: Self = Self(12);
1646    #[doc(alias = "SRNotificationEventTapCoalesce")]
1647    pub const TapCoalesce: Self = Self(13);
1648    #[doc(alias = "SRNotificationEventDeduped")]
1649    pub const Deduped: Self = Self(14);
1650    #[doc(alias = "SRNotificationEventDeviceActivated")]
1651    pub const DeviceActivated: Self = Self(15);
1652    #[doc(alias = "SRNotificationEventDeviceUnlocked")]
1653    pub const DeviceUnlocked: Self = Self(16);
1654}
1655
1656unsafe impl Encode for SRNotificationEvent {
1657    const ENCODING: Encoding = NSInteger::ENCODING;
1658}
1659
1660unsafe impl RefEncode for SRNotificationEvent {
1661    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1662}
1663
1664extern_class!(
1665    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srnotificationusage?language=objc)
1666    #[unsafe(super(NSObject))]
1667    #[derive(Debug, PartialEq, Eq, Hash)]
1668    pub struct SRNotificationUsage;
1669);
1670
1671extern_conformance!(
1672    unsafe impl NSObjectProtocol for SRNotificationUsage {}
1673);
1674
1675impl SRNotificationUsage {
1676    extern_methods!(
1677        /// The bundle identifier of the application that corresponds to the notification. Only populated for Apple apps.
1678        #[unsafe(method(bundleIdentifier))]
1679        #[unsafe(method_family = none)]
1680        pub unsafe fn bundleIdentifier(&self) -> Option<Retained<NSString>>;
1681
1682        #[unsafe(method(event))]
1683        #[unsafe(method_family = none)]
1684        pub unsafe fn event(&self) -> SRNotificationEvent;
1685    );
1686}
1687
1688/// Methods declared on superclass `NSObject`.
1689impl SRNotificationUsage {
1690    extern_methods!(
1691        #[unsafe(method(init))]
1692        #[unsafe(method_family = init)]
1693        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1694
1695        #[unsafe(method(new))]
1696        #[unsafe(method_family = new)]
1697        pub unsafe fn new() -> Retained<Self>;
1698    );
1699}
1700
1701extern_class!(
1702    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srwebusage?language=objc)
1703    #[unsafe(super(NSObject))]
1704    #[derive(Debug, PartialEq, Eq, Hash)]
1705    pub struct SRWebUsage;
1706);
1707
1708extern_conformance!(
1709    unsafe impl NSObjectProtocol for SRWebUsage {}
1710);
1711
1712impl SRWebUsage {
1713    extern_methods!(
1714        #[unsafe(method(totalUsageTime))]
1715        #[unsafe(method_family = none)]
1716        pub unsafe fn totalUsageTime(&self) -> NSTimeInterval;
1717    );
1718}
1719
1720/// Methods declared on superclass `NSObject`.
1721impl SRWebUsage {
1722    extern_methods!(
1723        #[unsafe(method(init))]
1724        #[unsafe(method_family = init)]
1725        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1726
1727        #[unsafe(method(new))]
1728        #[unsafe(method_family = new)]
1729        pub unsafe fn new() -> Retained<Self>;
1730    );
1731}
1732
1733extern_class!(
1734    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srmessagesusagereport?language=objc)
1735    #[unsafe(super(NSObject))]
1736    #[derive(Debug, PartialEq, Eq, Hash)]
1737    pub struct SRMessagesUsageReport;
1738);
1739
1740extern_conformance!(
1741    unsafe impl NSObjectProtocol for SRMessagesUsageReport {}
1742);
1743
1744impl SRMessagesUsageReport {
1745    extern_methods!(
1746        #[unsafe(method(duration))]
1747        #[unsafe(method_family = none)]
1748        pub unsafe fn duration(&self) -> NSTimeInterval;
1749
1750        #[unsafe(method(totalOutgoingMessages))]
1751        #[unsafe(method_family = none)]
1752        pub unsafe fn totalOutgoingMessages(&self) -> NSInteger;
1753
1754        #[unsafe(method(totalIncomingMessages))]
1755        #[unsafe(method_family = none)]
1756        pub unsafe fn totalIncomingMessages(&self) -> NSInteger;
1757
1758        #[unsafe(method(totalUniqueContacts))]
1759        #[unsafe(method_family = none)]
1760        pub unsafe fn totalUniqueContacts(&self) -> NSInteger;
1761    );
1762}
1763
1764/// Methods declared on superclass `NSObject`.
1765impl SRMessagesUsageReport {
1766    extern_methods!(
1767        #[unsafe(method(init))]
1768        #[unsafe(method_family = init)]
1769        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1770
1771        #[unsafe(method(new))]
1772        #[unsafe(method_family = new)]
1773        pub unsafe fn new() -> Retained<Self>;
1774    );
1775}
1776
1777extern_class!(
1778    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphoneusagereport?language=objc)
1779    #[unsafe(super(NSObject))]
1780    #[derive(Debug, PartialEq, Eq, Hash)]
1781    pub struct SRPhoneUsageReport;
1782);
1783
1784extern_conformance!(
1785    unsafe impl NSObjectProtocol for SRPhoneUsageReport {}
1786);
1787
1788impl SRPhoneUsageReport {
1789    extern_methods!(
1790        #[unsafe(method(duration))]
1791        #[unsafe(method_family = none)]
1792        pub unsafe fn duration(&self) -> NSTimeInterval;
1793
1794        #[unsafe(method(totalOutgoingCalls))]
1795        #[unsafe(method_family = none)]
1796        pub unsafe fn totalOutgoingCalls(&self) -> NSInteger;
1797
1798        #[unsafe(method(totalIncomingCalls))]
1799        #[unsafe(method_family = none)]
1800        pub unsafe fn totalIncomingCalls(&self) -> NSInteger;
1801
1802        #[unsafe(method(totalUniqueContacts))]
1803        #[unsafe(method_family = none)]
1804        pub unsafe fn totalUniqueContacts(&self) -> NSInteger;
1805
1806        #[unsafe(method(totalPhoneCallDuration))]
1807        #[unsafe(method_family = none)]
1808        pub unsafe fn totalPhoneCallDuration(&self) -> NSTimeInterval;
1809    );
1810}
1811
1812/// Methods declared on superclass `NSObject`.
1813impl SRPhoneUsageReport {
1814    extern_methods!(
1815        #[unsafe(method(init))]
1816        #[unsafe(method_family = init)]
1817        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1818
1819        #[unsafe(method(new))]
1820        #[unsafe(method_family = new)]
1821        pub unsafe fn new() -> Retained<Self>;
1822    );
1823}
1824
1825extern_class!(
1826    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srkeyboardmetrics?language=objc)
1827    #[unsafe(super(NSObject))]
1828    #[derive(Debug, PartialEq, Eq, Hash)]
1829    pub struct SRKeyboardMetrics;
1830);
1831
1832extern_conformance!(
1833    unsafe impl NSObjectProtocol for SRKeyboardMetrics {}
1834);
1835
1836impl SRKeyboardMetrics {
1837    extern_methods!(
1838        /// The duration over which these metrics were calculated
1839        #[unsafe(method(duration))]
1840        #[unsafe(method_family = none)]
1841        pub unsafe fn duration(&self) -> NSTimeInterval;
1842
1843        /// The identifier of the keyboard in the keyboard list
1844        #[unsafe(method(keyboardIdentifier))]
1845        #[unsafe(method_family = none)]
1846        pub unsafe fn keyboardIdentifier(&self) -> Retained<NSString>;
1847
1848        /// The version of keyboard metrics
1849        #[unsafe(method(version))]
1850        #[unsafe(method_family = none)]
1851        pub unsafe fn version(&self) -> Retained<NSString>;
1852
1853        /// The width of the keyboard in mm in the session
1854        #[unsafe(method(width))]
1855        #[unsafe(method_family = none)]
1856        pub unsafe fn width(&self) -> Retained<NSMeasurement<NSUnitLength>>;
1857
1858        /// The height of the keyboard in mm in the session
1859        #[unsafe(method(height))]
1860        #[unsafe(method_family = none)]
1861        pub unsafe fn height(&self) -> Retained<NSMeasurement<NSUnitLength>>;
1862
1863        /// The input modes used during a keyboard session
1864        #[unsafe(method(inputModes))]
1865        #[unsafe(method_family = none)]
1866        pub unsafe fn inputModes(&self) -> Retained<NSArray<NSString>>;
1867
1868        /// The keyboard session identifiers. These are the identifiers of the keyboard sessions that contributed to keyboard metrics sample to correlate current stream with another stream using the same keyboard session indentifiers
1869        #[unsafe(method(sessionIdentifiers))]
1870        #[unsafe(method_family = none)]
1871        pub unsafe fn sessionIdentifiers(&self) -> Retained<NSArray<NSString>>;
1872    );
1873}
1874
1875/// Methods declared on superclass `NSObject`.
1876impl SRKeyboardMetrics {
1877    extern_methods!(
1878        #[unsafe(method(init))]
1879        #[unsafe(method_family = init)]
1880        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1881
1882        #[unsafe(method(new))]
1883        #[unsafe(method_family = new)]
1884        pub unsafe fn new() -> Retained<Self>;
1885    );
1886}
1887
1888/// ScalarMetrics.
1889impl SRKeyboardMetrics {
1890    extern_methods!(
1891        /// The total number of words typed during the session
1892        #[unsafe(method(totalWords))]
1893        #[unsafe(method_family = none)]
1894        pub unsafe fn totalWords(&self) -> NSInteger;
1895
1896        /// The total number of altered words during the session
1897        #[unsafe(method(totalAlteredWords))]
1898        #[unsafe(method_family = none)]
1899        pub unsafe fn totalAlteredWords(&self) -> NSInteger;
1900
1901        /// The total number of taps during the session
1902        #[unsafe(method(totalTaps))]
1903        #[unsafe(method_family = none)]
1904        pub unsafe fn totalTaps(&self) -> NSInteger;
1905
1906        /// The total number of drags during the session
1907        #[unsafe(method(totalDrags))]
1908        #[unsafe(method_family = none)]
1909        pub unsafe fn totalDrags(&self) -> NSInteger;
1910
1911        /// The total number of deletes during the session
1912        #[unsafe(method(totalDeletes))]
1913        #[unsafe(method_family = none)]
1914        pub unsafe fn totalDeletes(&self) -> NSInteger;
1915
1916        /// The total number of emojis used during the session
1917        #[unsafe(method(totalEmojis))]
1918        #[unsafe(method_family = none)]
1919        pub unsafe fn totalEmojis(&self) -> NSInteger;
1920
1921        /// The total number of paths used during the sesion
1922        #[unsafe(method(totalPaths))]
1923        #[unsafe(method_family = none)]
1924        pub unsafe fn totalPaths(&self) -> NSInteger;
1925
1926        /// The total time taken to complete paths in the session
1927        #[unsafe(method(totalPathTime))]
1928        #[unsafe(method_family = none)]
1929        pub unsafe fn totalPathTime(&self) -> NSTimeInterval;
1930
1931        /// The total length of paths completed in the session
1932        #[unsafe(method(totalPathLength))]
1933        #[unsafe(method_family = none)]
1934        pub unsafe fn totalPathLength(&self) -> Retained<NSMeasurement<NSUnitLength>>;
1935
1936        /// The total number of autocorrections in the session
1937        #[unsafe(method(totalAutoCorrections))]
1938        #[unsafe(method_family = none)]
1939        pub unsafe fn totalAutoCorrections(&self) -> NSInteger;
1940
1941        /// The total number of space corrections in the session
1942        #[unsafe(method(totalSpaceCorrections))]
1943        #[unsafe(method_family = none)]
1944        pub unsafe fn totalSpaceCorrections(&self) -> NSInteger;
1945
1946        /// The total number of retro corrections in the session
1947        #[unsafe(method(totalRetroCorrections))]
1948        #[unsafe(method_family = none)]
1949        pub unsafe fn totalRetroCorrections(&self) -> NSInteger;
1950
1951        /// The total number of transposition corrections in the session
1952        #[unsafe(method(totalTranspositionCorrections))]
1953        #[unsafe(method_family = none)]
1954        pub unsafe fn totalTranspositionCorrections(&self) -> NSInteger;
1955
1956        /// The total number of insert key corrections in the session
1957        #[unsafe(method(totalInsertKeyCorrections))]
1958        #[unsafe(method_family = none)]
1959        pub unsafe fn totalInsertKeyCorrections(&self) -> NSInteger;
1960
1961        /// The total number of skip touch corrections in the session
1962        #[unsafe(method(totalSkipTouchCorrections))]
1963        #[unsafe(method_family = none)]
1964        pub unsafe fn totalSkipTouchCorrections(&self) -> NSInteger;
1965
1966        /// The total number of near key corrections in the session
1967        #[unsafe(method(totalNearKeyCorrections))]
1968        #[unsafe(method_family = none)]
1969        pub unsafe fn totalNearKeyCorrections(&self) -> NSInteger;
1970
1971        /// The total number of substitution corrections in the session
1972        #[unsafe(method(totalSubstitutionCorrections))]
1973        #[unsafe(method_family = none)]
1974        pub unsafe fn totalSubstitutionCorrections(&self) -> NSInteger;
1975
1976        /// The total number of hit test corrections in the session
1977        #[unsafe(method(totalHitTestCorrections))]
1978        #[unsafe(method_family = none)]
1979        pub unsafe fn totalHitTestCorrections(&self) -> NSInteger;
1980
1981        /// The total amount of time typing during the session
1982        #[unsafe(method(totalTypingDuration))]
1983        #[unsafe(method_family = none)]
1984        pub unsafe fn totalTypingDuration(&self) -> NSTimeInterval;
1985    );
1986}
1987
1988extern_class!(
1989    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srkeyboardprobabilitymetric?language=objc)
1990    #[unsafe(super(NSObject))]
1991    #[derive(Debug, PartialEq, Eq, Hash)]
1992    pub struct SRKeyboardProbabilityMetric<UnitType: ?Sized = AnyObject>;
1993);
1994
1995impl<UnitType: ?Sized + Message + AsRef<NSUnit>> SRKeyboardProbabilityMetric<UnitType> {
1996    /// Unchecked conversion of the generic parameter.
1997    ///
1998    /// # Safety
1999    ///
2000    /// The generic must be valid to reinterpret as the given type.
2001    #[inline]
2002    pub unsafe fn cast_unchecked<NewUnitType: ?Sized + Message + AsRef<NSUnit>>(
2003        &self,
2004    ) -> &SRKeyboardProbabilityMetric<NewUnitType> {
2005        unsafe { &*((self as *const Self).cast()) }
2006    }
2007}
2008
2009extern_conformance!(
2010    unsafe impl<UnitType: ?Sized + AsRef<NSUnit>> NSObjectProtocol
2011        for SRKeyboardProbabilityMetric<UnitType>
2012    {
2013    }
2014);
2015
2016impl<UnitType: Message + AsRef<NSUnit>> SRKeyboardProbabilityMetric<UnitType> {
2017    extern_methods!(
2018        /// Sample values from probability distribution
2019        #[unsafe(method(distributionSampleValues))]
2020        #[unsafe(method_family = none)]
2021        pub unsafe fn distributionSampleValues(&self)
2022            -> Retained<NSArray<NSMeasurement<UnitType>>>;
2023    );
2024}
2025
2026/// Methods declared on superclass `NSObject`.
2027impl<UnitType: Message + AsRef<NSUnit>> SRKeyboardProbabilityMetric<UnitType> {
2028    extern_methods!(
2029        #[unsafe(method(init))]
2030        #[unsafe(method_family = init)]
2031        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2032
2033        #[unsafe(method(new))]
2034        #[unsafe(method_family = new)]
2035        pub unsafe fn new() -> Retained<Self>;
2036    );
2037}
2038
2039/// ProbabilityMetrics.
2040impl SRKeyboardMetrics {
2041    extern_methods!(
2042        /// The distance from the touch up to the center of any key
2043        #[unsafe(method(upErrorDistance))]
2044        #[unsafe(method_family = none)]
2045        pub unsafe fn upErrorDistance(&self)
2046            -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2047
2048        /// The distance from the touch down to the center of any key
2049        #[unsafe(method(downErrorDistance))]
2050        #[unsafe(method_family = none)]
2051        pub unsafe fn downErrorDistance(
2052            &self,
2053        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2054
2055        /// The distance from the touch up to the right centroid of the space key
2056        #[unsafe(method(spaceUpErrorDistance))]
2057        #[unsafe(method_family = none)]
2058        pub unsafe fn spaceUpErrorDistance(
2059            &self,
2060        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2061
2062        /// The distance from the touch down to the right centroid of the space key
2063        #[unsafe(method(spaceDownErrorDistance))]
2064        #[unsafe(method_family = none)]
2065        pub unsafe fn spaceDownErrorDistance(
2066            &self,
2067        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2068
2069        /// The distance from the touch up to the center of the delete key
2070        #[unsafe(method(deleteUpErrorDistance))]
2071        #[unsafe(method_family = none)]
2072        pub unsafe fn deleteUpErrorDistance(
2073            &self,
2074        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2075
2076        /// The distance from the touch down to the center of the delete key
2077        #[unsafe(method(deleteDownErrorDistance))]
2078        #[unsafe(method_family = none)]
2079        pub unsafe fn deleteDownErrorDistance(
2080            &self,
2081        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2082
2083        /// The distance from the touch up to the center of the intended key of a character in a short word
2084        #[unsafe(method(shortWordCharKeyUpErrorDistance))]
2085        #[unsafe(method_family = none)]
2086        pub unsafe fn shortWordCharKeyUpErrorDistance(
2087            &self,
2088        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2089
2090        /// The distance from the touch down to the center of the intended key of a character in a short word
2091        #[unsafe(method(shortWordCharKeyDownErrorDistance))]
2092        #[unsafe(method_family = none)]
2093        pub unsafe fn shortWordCharKeyDownErrorDistance(
2094            &self,
2095        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2096
2097        /// The duration between touch down to touchup for any key
2098        #[unsafe(method(touchDownUp))]
2099        #[unsafe(method_family = none)]
2100        pub unsafe fn touchDownUp(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2101
2102        /// The duration between touch down and touchup of all space key events in the session.
2103        #[unsafe(method(spaceTouchDownUp))]
2104        #[unsafe(method_family = none)]
2105        pub unsafe fn spaceTouchDownUp(
2106            &self,
2107        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2108
2109        /// The duration between touch down and touchup of all delete key events in the session.
2110        #[unsafe(method(deleteTouchDownUp))]
2111        #[unsafe(method_family = none)]
2112        pub unsafe fn deleteTouchDownUp(
2113            &self,
2114        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2115
2116        /// The duration between touch down and touchup of all character keys in short words in the session.
2117        #[unsafe(method(shortWordCharKeyTouchDownUp))]
2118        #[unsafe(method_family = none)]
2119        pub unsafe fn shortWordCharKeyTouchDownUp(
2120            &self,
2121        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2122
2123        /// The duration between touch down to touch down for any key
2124        #[unsafe(method(touchDownDown))]
2125        #[unsafe(method_family = none)]
2126        pub unsafe fn touchDownDown(&self)
2127            -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2128
2129        /// The duration between touch up and touch down for any key
2130        #[unsafe(method(touchUpDown))]
2131        #[unsafe(method_family = none)]
2132        pub unsafe fn touchUpDown(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2133
2134        /// The duration between touchup on a character key and touch down on a word in the prediction bar
2135        #[unsafe(method(charKeyToPrediction))]
2136        #[unsafe(method_family = none)]
2137        pub unsafe fn charKeyToPrediction(
2138            &self,
2139        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2140
2141        /// The duration between touchup on a character key and touch down on any sequential character key in a short word
2142        #[unsafe(method(shortWordCharKeyToCharKey))]
2143        #[unsafe(method_family = none)]
2144        pub unsafe fn shortWordCharKeyToCharKey(
2145            &self,
2146        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2147
2148        /// The duration between touchup on a character key and touch down on the next sequential key (any key)
2149        #[unsafe(method(charKeyToAnyTapKey))]
2150        #[unsafe(method_family = none)]
2151        pub unsafe fn charKeyToAnyTapKey(
2152            &self,
2153        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2154
2155        /// The duration between touchup of any key and touch down on a sequential character key
2156        #[unsafe(method(anyTapToCharKey))]
2157        #[unsafe(method_family = none)]
2158        pub unsafe fn anyTapToCharKey(
2159            &self,
2160        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2161
2162        /// The duration between touchup of a space key and touch down of a sequential character key
2163        #[unsafe(method(spaceToCharKey))]
2164        #[unsafe(method_family = none)]
2165        pub unsafe fn spaceToCharKey(
2166            &self,
2167        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2168
2169        /// The duration between touchup of a character key and touch down of a sequential space key
2170        #[unsafe(method(charKeyToSpaceKey))]
2171        #[unsafe(method_family = none)]
2172        pub unsafe fn charKeyToSpaceKey(
2173            &self,
2174        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2175
2176        /// The duration between touchup of a space key and touch down of a sequential delete key
2177        #[unsafe(method(spaceToDeleteKey))]
2178        #[unsafe(method_family = none)]
2179        pub unsafe fn spaceToDeleteKey(
2180            &self,
2181        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2182
2183        /// The duration between touchup of a delete key and touch down of a sequential space key
2184        #[unsafe(method(deleteToSpaceKey))]
2185        #[unsafe(method_family = none)]
2186        pub unsafe fn deleteToSpaceKey(
2187            &self,
2188        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2189
2190        /// The duration between touchup of a space key and touch down of a sequential space key
2191        #[unsafe(method(spaceToSpaceKey))]
2192        #[unsafe(method_family = none)]
2193        pub unsafe fn spaceToSpaceKey(
2194            &self,
2195        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2196
2197        /// The duration between touchup of a space key and touch down of a sequential Shift key
2198        #[unsafe(method(spaceToShiftKey))]
2199        #[unsafe(method_family = none)]
2200        pub unsafe fn spaceToShiftKey(
2201            &self,
2202        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2203
2204        /// The duration between touchup of a space key and touch down of a sequential plane change key
2205        #[unsafe(method(spaceToPlaneChangeKey))]
2206        #[unsafe(method_family = none)]
2207        pub unsafe fn spaceToPlaneChangeKey(
2208            &self,
2209        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2210
2211        /// The duration between touchup on the space key and touch down of a sequential selection from the prediction bar
2212        #[unsafe(method(spaceToPredictionKey))]
2213        #[unsafe(method_family = none)]
2214        pub unsafe fn spaceToPredictionKey(
2215            &self,
2216        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2217
2218        /// The duration between touchup of a delete key and touch down of a sequential character key
2219        #[unsafe(method(deleteToCharKey))]
2220        #[unsafe(method_family = none)]
2221        pub unsafe fn deleteToCharKey(
2222            &self,
2223        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2224
2225        /// The duration between touchup of a character key and touch down of a sequential delete key
2226        #[unsafe(method(charKeyToDelete))]
2227        #[unsafe(method_family = none)]
2228        pub unsafe fn charKeyToDelete(
2229            &self,
2230        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2231
2232        /// The duration between touchup of a delete key and touch down of a sequential delete key
2233        #[unsafe(method(deleteToDelete))]
2234        #[unsafe(method_family = none)]
2235        pub unsafe fn deleteToDelete(
2236            &self,
2237        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2238
2239        /// The duration between touchup of a delete key and touch down of a sequential Shift key
2240        #[unsafe(method(deleteToShiftKey))]
2241        #[unsafe(method_family = none)]
2242        pub unsafe fn deleteToShiftKey(
2243            &self,
2244        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2245
2246        /// The duration between touchup of a delete key and touch down of a sequential plane change key
2247        #[unsafe(method(deleteToPlaneChangeKey))]
2248        #[unsafe(method_family = none)]
2249        pub unsafe fn deleteToPlaneChangeKey(
2250            &self,
2251        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2252
2253        /// The duration between touchup of any key and touch down on a plane change key
2254        #[unsafe(method(anyTapToPlaneChangeKey))]
2255        #[unsafe(method_family = none)]
2256        pub unsafe fn anyTapToPlaneChangeKey(
2257            &self,
2258        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2259
2260        /// The duration between touchup on a plane change key and touch down on the next sequential key
2261        #[unsafe(method(planeChangeToAnyTap))]
2262        #[unsafe(method_family = none)]
2263        pub unsafe fn planeChangeToAnyTap(
2264            &self,
2265        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2266
2267        /// The duration between touchup of a character key and touch down of a sequential plane change key
2268        #[unsafe(method(charKeyToPlaneChangeKey))]
2269        #[unsafe(method_family = none)]
2270        pub unsafe fn charKeyToPlaneChangeKey(
2271            &self,
2272        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2273
2274        /// The duration between touchup of a plane change key and touch down of any key
2275        #[unsafe(method(planeChangeKeyToCharKey))]
2276        #[unsafe(method_family = none)]
2277        pub unsafe fn planeChangeKeyToCharKey(
2278            &self,
2279        ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2280
2281        /// sample values of the ratio of error distance between intended and actual path
2282        #[unsafe(method(pathErrorDistanceRatio))]
2283        #[unsafe(method_family = none)]
2284        pub unsafe fn pathErrorDistanceRatio(&self) -> Retained<NSArray<NSNumber>>;
2285
2286        /// The duration between touchup of a delete key and touch down of a sequential path
2287        #[unsafe(method(deleteToPath))]
2288        #[unsafe(method_family = none)]
2289        pub unsafe fn deleteToPath(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2290
2291        /// The duration between touchup of a delete key and touch down of a sequential path (ie. Continuous Path)
2292        #[unsafe(method(pathToDelete))]
2293        #[unsafe(method_family = none)]
2294        pub unsafe fn pathToDelete(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2295
2296        /// The duration between touchup on the space key and touch down to begin a sequential path
2297        #[unsafe(method(spaceToPath))]
2298        #[unsafe(method_family = none)]
2299        pub unsafe fn spaceToPath(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2300
2301        /// The duration between touchup of a path and touch down of a sequential space key
2302        #[unsafe(method(pathToSpace))]
2303        #[unsafe(method_family = none)]
2304        pub unsafe fn pathToSpace(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2305
2306        /// The duration between touchup of a path and touch down of a sequential path
2307        #[unsafe(method(pathToPath))]
2308        #[unsafe(method_family = none)]
2309        pub unsafe fn pathToPath(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2310    );
2311}
2312
2313/// PositionalMetrics.
2314///
2315/// Probability metrics for each character in a word in their respective positions (first, second, third, fourth, fifth, and the rest)
2316impl SRKeyboardMetrics {
2317    extern_methods!(
2318        /// The distance from the touch up to the center of the intended key of the characters of a long word
2319        #[unsafe(method(longWordUpErrorDistance))]
2320        #[unsafe(method_family = none)]
2321        pub unsafe fn longWordUpErrorDistance(
2322            &self,
2323        ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitLength>>>;
2324
2325        /// The distance from the touch down to the center of the intended key of the characters of a long word
2326        #[unsafe(method(longWordDownErrorDistance))]
2327        #[unsafe(method_family = none)]
2328        pub unsafe fn longWordDownErrorDistance(
2329            &self,
2330        ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitLength>>>;
2331
2332        /// The duration between touch down and touchup of the character keys of all the long words in the session.
2333        #[unsafe(method(longWordTouchDownUp))]
2334        #[unsafe(method_family = none)]
2335        pub unsafe fn longWordTouchDownUp(
2336            &self,
2337        ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2338
2339        /// The duration between touch down and touch down of the character keys of all the long words in the session.
2340        #[unsafe(method(longWordTouchDownDown))]
2341        #[unsafe(method_family = none)]
2342        pub unsafe fn longWordTouchDownDown(
2343            &self,
2344        ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2345
2346        /// The duration between touch up and touch down of the character keys of all the long words in the session.
2347        #[unsafe(method(longWordTouchUpDown))]
2348        #[unsafe(method_family = none)]
2349        pub unsafe fn longWordTouchUpDown(
2350            &self,
2351        ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2352
2353        /// The duration between touchup of the delete key and touch down of a sequential delete key
2354        #[unsafe(method(deleteToDeletes))]
2355        #[unsafe(method_family = none)]
2356        pub unsafe fn deleteToDeletes(
2357            &self,
2358        ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2359    );
2360}
2361
2362/// SpeedMetrics.
2363impl SRKeyboardMetrics {
2364    extern_methods!(
2365        /// The total number of pauses during the session
2366        #[unsafe(method(totalPauses))]
2367        #[unsafe(method_family = none)]
2368        pub unsafe fn totalPauses(&self) -> NSInteger;
2369
2370        /// The total number of pauses made while entering the path for any words composed using continuous path during the session
2371        #[unsafe(method(totalPathPauses))]
2372        #[unsafe(method_family = none)]
2373        pub unsafe fn totalPathPauses(&self) -> NSInteger;
2374
2375        /// The words per minute typed during the session
2376        #[unsafe(method(typingSpeed))]
2377        #[unsafe(method_family = none)]
2378        pub unsafe fn typingSpeed(&self) -> c_double;
2379
2380        /// The words per minute typed using continuous path during the session
2381        #[unsafe(method(pathTypingSpeed))]
2382        #[unsafe(method_family = none)]
2383        pub unsafe fn pathTypingSpeed(&self) -> c_double;
2384
2385        /// Total number of continuous typing episodes during the session
2386        #[unsafe(method(totalTypingEpisodes))]
2387        #[unsafe(method_family = none)]
2388        pub unsafe fn totalTypingEpisodes(&self) -> NSInteger;
2389    );
2390}
2391
2392/// Categories of sentiment from words or emoji
2393///
2394/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srkeyboardmetricssentimentcategory?language=objc)
2395// NS_ENUM
2396#[repr(transparent)]
2397#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2398pub struct SRKeyboardMetricsSentimentCategory(pub NSInteger);
2399impl SRKeyboardMetricsSentimentCategory {
2400    #[doc(alias = "SRKeyboardMetricsSentimentCategoryAbsolutist")]
2401    pub const Absolutist: Self = Self(0);
2402    #[doc(alias = "SRKeyboardMetricsSentimentCategoryDown")]
2403    pub const Down: Self = Self(1);
2404    #[doc(alias = "SRKeyboardMetricsSentimentCategoryDeath")]
2405    pub const Death: Self = Self(2);
2406    #[doc(alias = "SRKeyboardMetricsSentimentCategoryAnxiety")]
2407    pub const Anxiety: Self = Self(3);
2408    #[doc(alias = "SRKeyboardMetricsSentimentCategoryAnger")]
2409    pub const Anger: Self = Self(4);
2410    #[doc(alias = "SRKeyboardMetricsSentimentCategoryHealth")]
2411    pub const Health: Self = Self(5);
2412    #[doc(alias = "SRKeyboardMetricsSentimentCategoryPositive")]
2413    pub const Positive: Self = Self(6);
2414    #[doc(alias = "SRKeyboardMetricsSentimentCategorySad")]
2415    pub const Sad: Self = Self(7);
2416    #[doc(alias = "SRKeyboardMetricsSentimentCategoryLowEnergy")]
2417    pub const LowEnergy: Self = Self(8);
2418    #[doc(alias = "SRKeyboardMetricsSentimentCategoryConfused")]
2419    pub const Confused: Self = Self(9);
2420}
2421
2422unsafe impl Encode for SRKeyboardMetricsSentimentCategory {
2423    const ENCODING: Encoding = NSInteger::ENCODING;
2424}
2425
2426unsafe impl RefEncode for SRKeyboardMetricsSentimentCategory {
2427    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2428}
2429
2430/// SentimentCounts.
2431///
2432/// These metrics describe the number of words and emoji of a particular category typed during
2433/// a keyboard session. Words and emoji may be counted in multiple categories.
2434impl SRKeyboardMetrics {
2435    extern_methods!(
2436        /// The count of words typed per category in the session
2437        #[unsafe(method(wordCountForSentimentCategory:))]
2438        #[unsafe(method_family = none)]
2439        pub unsafe fn wordCountForSentimentCategory(
2440            &self,
2441            category: SRKeyboardMetricsSentimentCategory,
2442        ) -> NSInteger;
2443
2444        /// The count of emoji typed per category in the session
2445        #[unsafe(method(emojiCountForSentimentCategory:))]
2446        #[unsafe(method_family = none)]
2447        pub unsafe fn emojiCountForSentimentCategory(
2448            &self,
2449            category: SRKeyboardMetricsSentimentCategory,
2450        ) -> NSInteger;
2451    );
2452}
2453
2454/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeletionreason?language=objc)
2455// NS_ENUM
2456#[repr(transparent)]
2457#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2458pub struct SRDeletionReason(pub NSInteger);
2459impl SRDeletionReason {
2460    /// The user initiated deletion
2461    #[doc(alias = "SRDeletionReasonUserInitiated")]
2462    pub const UserInitiated: Self = Self(0);
2463    /// Samples were removed due to low disk conditions
2464    #[doc(alias = "SRDeletionReasonLowDiskSpace")]
2465    pub const LowDiskSpace: Self = Self(1);
2466    /// Samples were removed because they were recorded beyond our retention limit
2467    #[doc(alias = "SRDeletionReasonAgeLimit")]
2468    pub const AgeLimit: Self = Self(2);
2469    /// Samples were removed because there are no longer any interested clients
2470    #[doc(alias = "SRDeletionReasonNoInterestedClients")]
2471    pub const NoInterestedClients: Self = Self(3);
2472    /// Samples were removed because the system was in an invalid state
2473    #[doc(alias = "SRDeletionReasonSystemInitiated")]
2474    pub const SystemInitiated: Self = Self(4);
2475}
2476
2477unsafe impl Encode for SRDeletionReason {
2478    const ENCODING: Encoding = NSInteger::ENCODING;
2479}
2480
2481unsafe impl RefEncode for SRDeletionReason {
2482    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2483}
2484
2485extern_class!(
2486    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srdeletionrecord?language=objc)
2487    #[unsafe(super(NSObject))]
2488    #[derive(Debug, PartialEq, Eq, Hash)]
2489    pub struct SRDeletionRecord;
2490);
2491
2492extern_conformance!(
2493    unsafe impl NSCoding for SRDeletionRecord {}
2494);
2495
2496extern_conformance!(
2497    unsafe impl NSObjectProtocol for SRDeletionRecord {}
2498);
2499
2500extern_conformance!(
2501    unsafe impl NSSecureCoding for SRDeletionRecord {}
2502);
2503
2504impl SRDeletionRecord {
2505    extern_methods!(
2506        #[cfg(feature = "objc2-core-foundation")]
2507        #[unsafe(method(startTime))]
2508        #[unsafe(method_family = none)]
2509        pub unsafe fn startTime(&self) -> SRAbsoluteTime;
2510
2511        #[cfg(feature = "objc2-core-foundation")]
2512        #[unsafe(method(endTime))]
2513        #[unsafe(method_family = none)]
2514        pub unsafe fn endTime(&self) -> SRAbsoluteTime;
2515
2516        #[unsafe(method(reason))]
2517        #[unsafe(method_family = none)]
2518        pub unsafe fn reason(&self) -> SRDeletionReason;
2519    );
2520}
2521
2522/// Methods declared on superclass `NSObject`.
2523impl SRDeletionRecord {
2524    extern_methods!(
2525        #[unsafe(method(init))]
2526        #[unsafe(method_family = init)]
2527        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2528
2529        #[unsafe(method(new))]
2530        #[unsafe(method_family = new)]
2531        pub unsafe fn new() -> Retained<Self>;
2532    );
2533}
2534
2535mod private_NSStringSRDeletionRecord {
2536    pub trait Sealed {}
2537}
2538
2539/// Category "SRDeletionRecord" on [`NSString`].
2540#[doc(alias = "SRDeletionRecord")]
2541pub unsafe trait NSStringSRDeletionRecord:
2542    ClassType + Sized + private_NSStringSRDeletionRecord::Sealed
2543{
2544    extern_methods!(
2545        /// Returns a sensor stream that contains deletion records of the sensor
2546        ///
2547        ///
2548        /// This sensor stream should only be used for fetching. All other
2549        /// operations will be ignored. Deletion records share the recording and authorization
2550        /// state with their parent sensor.
2551        ///
2552        ///
2553        /// Returns: May return nil if there is no deletion record available for this sensor
2554        #[unsafe(method(sr_sensorForDeletionRecordsFromSensor))]
2555        #[unsafe(method_family = none)]
2556        unsafe fn sr_sensorForDeletionRecordsFromSensor(&self) -> Option<Retained<SRSensor>>;
2557    );
2558}
2559
2560impl private_NSStringSRDeletionRecord::Sealed for NSString {}
2561unsafe impl NSStringSRDeletionRecord for NSString {}
2562
2563/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srwristlocation?language=objc)
2564// NS_ENUM
2565#[repr(transparent)]
2566#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2567pub struct SRWristLocation(pub NSInteger);
2568impl SRWristLocation {
2569    #[doc(alias = "SRWristLocationLeft")]
2570    pub const Left: Self = Self(0);
2571    #[doc(alias = "SRWristLocationRight")]
2572    pub const Right: Self = Self(1);
2573}
2574
2575unsafe impl Encode for SRWristLocation {
2576    const ENCODING: Encoding = NSInteger::ENCODING;
2577}
2578
2579unsafe impl RefEncode for SRWristLocation {
2580    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2581}
2582
2583/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srcrownorientation?language=objc)
2584// NS_ENUM
2585#[repr(transparent)]
2586#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2587pub struct SRCrownOrientation(pub NSInteger);
2588impl SRCrownOrientation {
2589    #[doc(alias = "SRCrownOrientationLeft")]
2590    pub const Left: Self = Self(0);
2591    #[doc(alias = "SRCrownOrientationRight")]
2592    pub const Right: Self = Self(1);
2593}
2594
2595unsafe impl Encode for SRCrownOrientation {
2596    const ENCODING: Encoding = NSInteger::ENCODING;
2597}
2598
2599unsafe impl RefEncode for SRCrownOrientation {
2600    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2601}
2602
2603extern_class!(
2604    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srwristdetection?language=objc)
2605    #[unsafe(super(NSObject))]
2606    #[derive(Debug, PartialEq, Eq, Hash)]
2607    pub struct SRWristDetection;
2608);
2609
2610extern_conformance!(
2611    unsafe impl NSObjectProtocol for SRWristDetection {}
2612);
2613
2614impl SRWristDetection {
2615    extern_methods!(
2616        #[unsafe(method(onWrist))]
2617        #[unsafe(method_family = none)]
2618        pub unsafe fn onWrist(&self) -> bool;
2619
2620        #[unsafe(method(wristLocation))]
2621        #[unsafe(method_family = none)]
2622        pub unsafe fn wristLocation(&self) -> SRWristLocation;
2623
2624        #[unsafe(method(crownOrientation))]
2625        #[unsafe(method_family = none)]
2626        pub unsafe fn crownOrientation(&self) -> SRCrownOrientation;
2627
2628        /// Start date of the recent on-wrist state.
2629        ///
2630        ///
2631        /// - When the state changes from off-wrist to on-wrist, onWristDate would be updated to the current date, and offWristDate would remain the same.
2632        /// - When the state changes from on-wrist to off-wrist, offWristDate would be updated to the current date, and onWristDate would remain the same.
2633        #[unsafe(method(onWristDate))]
2634        #[unsafe(method_family = none)]
2635        pub unsafe fn onWristDate(&self) -> Option<Retained<NSDate>>;
2636
2637        /// Start date of the recent off-wrist state.
2638        ///
2639        ///
2640        /// - When the state changes from off-wrist to on-wrist, onWristDate would be updated to the current date, and offWristDate would remain the same.
2641        /// - When the state changes from on-wrist to off-wrist, offWristDate would be updated to the current date, and onWristDate would remain the same.
2642        #[unsafe(method(offWristDate))]
2643        #[unsafe(method_family = none)]
2644        pub unsafe fn offWristDate(&self) -> Option<Retained<NSDate>>;
2645    );
2646}
2647
2648/// Methods declared on superclass `NSObject`.
2649impl SRWristDetection {
2650    extern_methods!(
2651        #[unsafe(method(init))]
2652        #[unsafe(method_family = init)]
2653        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2654
2655        #[unsafe(method(new))]
2656        #[unsafe(method_family = new)]
2657        pub unsafe fn new() -> Retained<Self>;
2658    );
2659}
2660
2661/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srwristtemperaturecondition?language=objc)
2662// NS_OPTIONS
2663#[repr(transparent)]
2664#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2665pub struct SRWristTemperatureCondition(pub NSUInteger);
2666bitflags::bitflags! {
2667    impl SRWristTemperatureCondition: NSUInteger {
2668        #[doc(alias = "SRWristTemperatureConditionNone")]
2669        const None = 0;
2670        #[doc(alias = "SRWristTemperatureConditionOffWrist")]
2671        const OffWrist = 1<<0;
2672        #[doc(alias = "SRWristTemperatureConditionOnCharger")]
2673        const OnCharger = 1<<1;
2674        #[doc(alias = "SRWristTemperatureConditionInMotion")]
2675        const InMotion = 1<<2;
2676    }
2677}
2678
2679unsafe impl Encode for SRWristTemperatureCondition {
2680    const ENCODING: Encoding = NSUInteger::ENCODING;
2681}
2682
2683unsafe impl RefEncode for SRWristTemperatureCondition {
2684    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2685}
2686
2687extern_class!(
2688    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srwristtemperature?language=objc)
2689    #[unsafe(super(NSObject))]
2690    #[derive(Debug, PartialEq, Eq, Hash)]
2691    pub struct SRWristTemperature;
2692);
2693
2694unsafe impl Send for SRWristTemperature {}
2695
2696unsafe impl Sync for SRWristTemperature {}
2697
2698extern_conformance!(
2699    unsafe impl NSCoding for SRWristTemperature {}
2700);
2701
2702extern_conformance!(
2703    unsafe impl NSCopying for SRWristTemperature {}
2704);
2705
2706unsafe impl CopyingHelper for SRWristTemperature {
2707    type Result = Self;
2708}
2709
2710extern_conformance!(
2711    unsafe impl NSObjectProtocol for SRWristTemperature {}
2712);
2713
2714extern_conformance!(
2715    unsafe impl NSSecureCoding for SRWristTemperature {}
2716);
2717
2718impl SRWristTemperature {
2719    extern_methods!(
2720        #[unsafe(method(init))]
2721        #[unsafe(method_family = init)]
2722        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2723
2724        #[unsafe(method(new))]
2725        #[unsafe(method_family = new)]
2726        pub unsafe fn new() -> Retained<Self>;
2727
2728        /// Timestamp of when temperature measurement was taken.
2729        ///
2730        /// This property is not atomic.
2731        ///
2732        /// # Safety
2733        ///
2734        /// This might not be thread-safe.
2735        #[unsafe(method(timestamp))]
2736        #[unsafe(method_family = none)]
2737        pub unsafe fn timestamp(&self) -> Retained<NSDate>;
2738
2739        /// Temperature sensor value in celsius
2740        ///
2741        /// This property is not atomic.
2742        ///
2743        /// # Safety
2744        ///
2745        /// This might not be thread-safe.
2746        #[unsafe(method(value))]
2747        #[unsafe(method_family = none)]
2748        pub unsafe fn value(&self) -> Retained<NSMeasurement<NSUnitTemperature>>;
2749
2750        /// Indicate system conditions that may impact the temperature sample.
2751        ///
2752        /// This property is not atomic.
2753        ///
2754        /// # Safety
2755        ///
2756        /// This might not be thread-safe.
2757        #[unsafe(method(condition))]
2758        #[unsafe(method_family = none)]
2759        pub unsafe fn condition(&self) -> SRWristTemperatureCondition;
2760
2761        /// Estimated temperature error per sample.
2762        /// Error could be in either positive or negative direction.
2763        ///
2764        /// This property is not atomic.
2765        ///
2766        /// # Safety
2767        ///
2768        /// This might not be thread-safe.
2769        #[unsafe(method(errorEstimate))]
2770        #[unsafe(method_family = none)]
2771        pub unsafe fn errorEstimate(&self) -> Retained<NSMeasurement<NSUnitTemperature>>;
2772    );
2773}
2774
2775extern_class!(
2776    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srwristtemperaturesession?language=objc)
2777    #[unsafe(super(NSObject))]
2778    #[derive(Debug, PartialEq, Eq, Hash)]
2779    pub struct SRWristTemperatureSession;
2780);
2781
2782unsafe impl Send for SRWristTemperatureSession {}
2783
2784unsafe impl Sync for SRWristTemperatureSession {}
2785
2786extern_conformance!(
2787    unsafe impl NSCoding for SRWristTemperatureSession {}
2788);
2789
2790extern_conformance!(
2791    unsafe impl NSCopying for SRWristTemperatureSession {}
2792);
2793
2794unsafe impl CopyingHelper for SRWristTemperatureSession {
2795    type Result = Self;
2796}
2797
2798extern_conformance!(
2799    unsafe impl NSObjectProtocol for SRWristTemperatureSession {}
2800);
2801
2802extern_conformance!(
2803    unsafe impl NSSecureCoding for SRWristTemperatureSession {}
2804);
2805
2806impl SRWristTemperatureSession {
2807    extern_methods!(
2808        #[unsafe(method(init))]
2809        #[unsafe(method_family = init)]
2810        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2811
2812        #[unsafe(method(new))]
2813        #[unsafe(method_family = new)]
2814        pub unsafe fn new() -> Retained<Self>;
2815
2816        /// Indicates when temperatures were collected.
2817        ///
2818        /// This property is not atomic.
2819        ///
2820        /// # Safety
2821        ///
2822        /// This might not be thread-safe.
2823        #[unsafe(method(startDate))]
2824        #[unsafe(method_family = none)]
2825        pub unsafe fn startDate(&self) -> Retained<NSDate>;
2826
2827        /// Precise number of seconds temperatures were collected.
2828        ///
2829        /// This property is not atomic.
2830        ///
2831        /// # Safety
2832        ///
2833        /// This might not be thread-safe.
2834        #[unsafe(method(duration))]
2835        #[unsafe(method_family = none)]
2836        pub unsafe fn duration(&self) -> NSTimeInterval;
2837
2838        /// Algorithm version.
2839        ///
2840        /// This property is not atomic.
2841        ///
2842        /// # Safety
2843        ///
2844        /// This might not be thread-safe.
2845        #[unsafe(method(version))]
2846        #[unsafe(method_family = none)]
2847        pub unsafe fn version(&self) -> Retained<NSString>;
2848
2849        /// Enumerator which could be used to view calculated wrist temperatures, along with their reading accuracy.
2850        ///
2851        /// This property is not atomic.
2852        ///
2853        /// # Safety
2854        ///
2855        /// - The returned enumerator's underlying collection should not be mutated while in use.
2856        /// - This might not be thread-safe.
2857        #[unsafe(method(temperatures))]
2858        #[unsafe(method_family = none)]
2859        pub unsafe fn temperatures(&self) -> Retained<NSEnumerator<SRWristTemperature>>;
2860    );
2861}
2862
2863/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srmediaeventtype?language=objc)
2864// NS_ENUM
2865#[repr(transparent)]
2866#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2867pub struct SRMediaEventType(pub NSInteger);
2868impl SRMediaEventType {
2869    #[doc(alias = "SRMediaEventOnScreen")]
2870    pub const OnScreen: Self = Self(1);
2871    #[doc(alias = "SRMediaEventOffScreen")]
2872    pub const OffScreen: Self = Self(2);
2873}
2874
2875unsafe impl Encode for SRMediaEventType {
2876    const ENCODING: Encoding = NSInteger::ENCODING;
2877}
2878
2879unsafe impl RefEncode for SRMediaEventType {
2880    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2881}
2882
2883extern_class!(
2884    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srmediaevent?language=objc)
2885    #[unsafe(super(NSObject))]
2886    #[derive(Debug, PartialEq, Eq, Hash)]
2887    pub struct SRMediaEvent;
2888);
2889
2890unsafe impl Send for SRMediaEvent {}
2891
2892unsafe impl Sync for SRMediaEvent {}
2893
2894extern_conformance!(
2895    unsafe impl NSCoding for SRMediaEvent {}
2896);
2897
2898extern_conformance!(
2899    unsafe impl NSCopying for SRMediaEvent {}
2900);
2901
2902unsafe impl CopyingHelper for SRMediaEvent {
2903    type Result = Self;
2904}
2905
2906extern_conformance!(
2907    unsafe impl NSObjectProtocol for SRMediaEvent {}
2908);
2909
2910extern_conformance!(
2911    unsafe impl NSSecureCoding for SRMediaEvent {}
2912);
2913
2914impl SRMediaEvent {
2915    extern_methods!(
2916        /// Unique media identifier
2917        ///
2918        ///
2919        /// Unique media identifier to track a specific media object.
2920        ///
2921        /// This property is not atomic.
2922        ///
2923        /// # Safety
2924        ///
2925        /// This might not be thread-safe.
2926        #[unsafe(method(mediaIdentifier))]
2927        #[unsafe(method_family = none)]
2928        pub unsafe fn mediaIdentifier(&self) -> Retained<NSString>;
2929
2930        /// Type of the event
2931        ///
2932        ///
2933        /// Type of media event (e.g., media has been displayed on a screen).
2934        ///
2935        /// This property is not atomic.
2936        ///
2937        /// # Safety
2938        ///
2939        /// This might not be thread-safe.
2940        #[unsafe(method(eventType))]
2941        #[unsafe(method_family = none)]
2942        pub unsafe fn eventType(&self) -> SRMediaEventType;
2943    );
2944}
2945
2946/// Methods declared on superclass `NSObject`.
2947impl SRMediaEvent {
2948    extern_methods!(
2949        #[unsafe(method(init))]
2950        #[unsafe(method_family = init)]
2951        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2952
2953        #[unsafe(method(new))]
2954        #[unsafe(method_family = new)]
2955        pub unsafe fn new() -> Retained<Self>;
2956    );
2957}
2958
2959extern_class!(
2960    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srspeechexpression?language=objc)
2961    #[unsafe(super(NSObject))]
2962    #[derive(Debug, PartialEq, Eq, Hash)]
2963    pub struct SRSpeechExpression;
2964);
2965
2966unsafe impl Send for SRSpeechExpression {}
2967
2968unsafe impl Sync for SRSpeechExpression {}
2969
2970extern_conformance!(
2971    unsafe impl NSCoding for SRSpeechExpression {}
2972);
2973
2974extern_conformance!(
2975    unsafe impl NSCopying for SRSpeechExpression {}
2976);
2977
2978unsafe impl CopyingHelper for SRSpeechExpression {
2979    type Result = Self;
2980}
2981
2982extern_conformance!(
2983    unsafe impl NSObjectProtocol for SRSpeechExpression {}
2984);
2985
2986extern_conformance!(
2987    unsafe impl NSSecureCoding for SRSpeechExpression {}
2988);
2989
2990impl SRSpeechExpression {
2991    extern_methods!(
2992        #[unsafe(method(init))]
2993        #[unsafe(method_family = init)]
2994        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2995
2996        #[unsafe(method(new))]
2997        #[unsafe(method_family = new)]
2998        pub unsafe fn new() -> Retained<Self>;
2999
3000        /// Version of the algorithm used to generate
3001        /// `SRSpeechExpression`
3002        ///
3003        /// This property is not atomic.
3004        ///
3005        /// # Safety
3006        ///
3007        /// This might not be thread-safe.
3008        #[unsafe(method(version))]
3009        #[unsafe(method_family = none)]
3010        pub unsafe fn version(&self) -> Retained<NSString>;
3011
3012        #[cfg(feature = "objc2-core-media")]
3013        /// The time range in the client-provided audio stream to which this classification
3014        /// result corresponds
3015        ///
3016        /// This property is not atomic.
3017        ///
3018        /// # Safety
3019        ///
3020        /// This might not be thread-safe.
3021        #[unsafe(method(timeRange))]
3022        #[unsafe(method_family = none)]
3023        pub unsafe fn timeRange(&self) -> CMTimeRange;
3024
3025        /// The level of confidence normalized to [0, 1], where 1 is most confident
3026        ///
3027        /// This property is not atomic.
3028        ///
3029        /// # Safety
3030        ///
3031        /// This might not be thread-safe.
3032        #[unsafe(method(confidence))]
3033        #[unsafe(method_family = none)]
3034        pub unsafe fn confidence(&self) -> c_double;
3035
3036        /// Indicator of how slurry/tired/exhausted the speaker sounds as opposed to normal.
3037        ///
3038        ///
3039        /// on a scale from -1 to 1, where negative scores indicate 'negative'
3040        /// sentiment, and positive scores indicate 'positive' sentiment.
3041        ///
3042        /// This property is not atomic.
3043        ///
3044        /// # Safety
3045        ///
3046        /// This might not be thread-safe.
3047        #[unsafe(method(mood))]
3048        #[unsafe(method_family = none)]
3049        pub unsafe fn mood(&self) -> c_double;
3050
3051        /// Degree of (perceived) positive or negative emotion/sentiment from voice
3052        ///
3053        ///
3054        /// on a scale from -1 to 1, where negative scores indicate 'negative'
3055        /// sentiment, and positive scores indicate 'positive' sentiment.
3056        ///
3057        /// This property is not atomic.
3058        ///
3059        /// # Safety
3060        ///
3061        /// This might not be thread-safe.
3062        #[unsafe(method(valence))]
3063        #[unsafe(method_family = none)]
3064        pub unsafe fn valence(&self) -> c_double;
3065
3066        /// Level of energy or activation (perceived) in voice
3067        ///
3068        ///
3069        /// on a scale from -1 to 1, where negative scores indicate 'negative'
3070        /// sentiment, and positive scores indicate 'positive' sentiment.
3071        ///
3072        /// This property is not atomic.
3073        ///
3074        /// # Safety
3075        ///
3076        /// This might not be thread-safe.
3077        #[unsafe(method(activation))]
3078        #[unsafe(method_family = none)]
3079        pub unsafe fn activation(&self) -> c_double;
3080
3081        /// Degree of how strong or meek a person sounds (perceptually)
3082        ///
3083        ///
3084        /// on a scale from -1 to 1, where negative scores indicate 'negative'
3085        /// sentiment, and positive scores indicate 'positive' sentiment.
3086        ///
3087        /// This property is not atomic.
3088        ///
3089        /// # Safety
3090        ///
3091        /// This might not be thread-safe.
3092        #[unsafe(method(dominance))]
3093        #[unsafe(method_family = none)]
3094        pub unsafe fn dominance(&self) -> c_double;
3095    );
3096}
3097
3098extern_class!(
3099    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sraudiolevel?language=objc)
3100    #[unsafe(super(NSObject))]
3101    #[derive(Debug, PartialEq, Eq, Hash)]
3102    pub struct SRAudioLevel;
3103);
3104
3105unsafe impl Send for SRAudioLevel {}
3106
3107unsafe impl Sync for SRAudioLevel {}
3108
3109extern_conformance!(
3110    unsafe impl NSCoding for SRAudioLevel {}
3111);
3112
3113extern_conformance!(
3114    unsafe impl NSCopying for SRAudioLevel {}
3115);
3116
3117unsafe impl CopyingHelper for SRAudioLevel {
3118    type Result = Self;
3119}
3120
3121extern_conformance!(
3122    unsafe impl NSObjectProtocol for SRAudioLevel {}
3123);
3124
3125extern_conformance!(
3126    unsafe impl NSSecureCoding for SRAudioLevel {}
3127);
3128
3129impl SRAudioLevel {
3130    extern_methods!(
3131        #[unsafe(method(init))]
3132        #[unsafe(method_family = init)]
3133        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3134
3135        #[unsafe(method(new))]
3136        #[unsafe(method_family = new)]
3137        pub unsafe fn new() -> Retained<Self>;
3138
3139        #[cfg(feature = "objc2-core-media")]
3140        /// The time range in the client-provided audio stream to which this classification
3141        /// result corresponds
3142        ///
3143        /// This property is not atomic.
3144        ///
3145        /// # Safety
3146        ///
3147        /// This might not be thread-safe.
3148        #[unsafe(method(timeRange))]
3149        #[unsafe(method_family = none)]
3150        pub unsafe fn timeRange(&self) -> CMTimeRange;
3151
3152        /// Measure of the audio level in decibels
3153        ///
3154        /// This property is not atomic.
3155        ///
3156        /// # Safety
3157        ///
3158        /// This might not be thread-safe.
3159        #[unsafe(method(loudness))]
3160        #[unsafe(method_family = none)]
3161        pub unsafe fn loudness(&self) -> c_double;
3162    );
3163}
3164
3165/// Flags indicating more information about how audio processing was done
3166/// on the audio stream
3167///
3168///
3169///
3170/// Audio stream went through the system voice processor
3171///
3172///
3173///
3174/// Audio stream bypassed the system voice processor.
3175///
3176/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srspeechmetricssessionflags?language=objc)
3177// NS_OPTIONS
3178#[repr(transparent)]
3179#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3180pub struct SRSpeechMetricsSessionFlags(pub NSUInteger);
3181bitflags::bitflags! {
3182    impl SRSpeechMetricsSessionFlags: NSUInteger {
3183        #[doc(alias = "SRSpeechMetricsSessionFlagsDefault")]
3184        const Default = 0;
3185        #[doc(alias = "SRSpeechMetricsSessionFlagsBypassVoiceProcessing")]
3186        const BypassVoiceProcessing = 1<<0;
3187    }
3188}
3189
3190unsafe impl Encode for SRSpeechMetricsSessionFlags {
3191    const ENCODING: Encoding = NSUInteger::ENCODING;
3192}
3193
3194unsafe impl RefEncode for SRSpeechMetricsSessionFlags {
3195    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3196}
3197
3198extern_class!(
3199    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srspeechmetrics?language=objc)
3200    #[unsafe(super(NSObject))]
3201    #[derive(Debug, PartialEq, Eq, Hash)]
3202    pub struct SRSpeechMetrics;
3203);
3204
3205unsafe impl Send for SRSpeechMetrics {}
3206
3207unsafe impl Sync for SRSpeechMetrics {}
3208
3209extern_conformance!(
3210    unsafe impl NSCoding for SRSpeechMetrics {}
3211);
3212
3213extern_conformance!(
3214    unsafe impl NSCopying for SRSpeechMetrics {}
3215);
3216
3217unsafe impl CopyingHelper for SRSpeechMetrics {
3218    type Result = Self;
3219}
3220
3221extern_conformance!(
3222    unsafe impl NSObjectProtocol for SRSpeechMetrics {}
3223);
3224
3225extern_conformance!(
3226    unsafe impl NSSecureCoding for SRSpeechMetrics {}
3227);
3228
3229impl SRSpeechMetrics {
3230    extern_methods!(
3231        #[unsafe(method(init))]
3232        #[unsafe(method_family = init)]
3233        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3234
3235        #[unsafe(method(new))]
3236        #[unsafe(method_family = new)]
3237        pub unsafe fn new() -> Retained<Self>;
3238
3239        /// Identifier of an audio session e.g., a Phone call or Siri utterance
3240        ///
3241        /// This property is not atomic.
3242        ///
3243        /// # Safety
3244        ///
3245        /// This might not be thread-safe.
3246        #[unsafe(method(sessionIdentifier))]
3247        #[unsafe(method_family = none)]
3248        pub unsafe fn sessionIdentifier(&self) -> Retained<NSString>;
3249
3250        /// This property is not atomic.
3251        ///
3252        /// # Safety
3253        ///
3254        /// This might not be thread-safe.
3255        #[unsafe(method(sessionFlags))]
3256        #[unsafe(method_family = none)]
3257        pub unsafe fn sessionFlags(&self) -> SRSpeechMetricsSessionFlags;
3258
3259        /// The wall time when this sample was generated
3260        ///
3261        /// This property is not atomic.
3262        ///
3263        /// # Safety
3264        ///
3265        /// This might not be thread-safe.
3266        #[unsafe(method(timestamp))]
3267        #[unsafe(method_family = none)]
3268        pub unsafe fn timestamp(&self) -> Retained<NSDate>;
3269
3270        /// The number of seconds since the start of the audio stream
3271        ///
3272        ///
3273        /// When an audio stream like a phone call starts,
3274        /// `SRSpeechMetrics`samples are collected
3275        /// periodically. This field can be used to determine where each sample falls in the audio stream
3276        ///
3277        /// This property is not atomic.
3278        ///
3279        /// # Safety
3280        ///
3281        /// This might not be thread-safe.
3282        #[unsafe(method(timeSinceAudioStart))]
3283        #[unsafe(method_family = none)]
3284        pub unsafe fn timeSinceAudioStart(&self) -> NSTimeInterval;
3285
3286        /// This property is not atomic.
3287        ///
3288        /// # Safety
3289        ///
3290        /// This might not be thread-safe.
3291        #[unsafe(method(audioLevel))]
3292        #[unsafe(method_family = none)]
3293        pub unsafe fn audioLevel(&self) -> Option<Retained<SRAudioLevel>>;
3294
3295        #[cfg(feature = "objc2-speech")]
3296        /// This property is not atomic.
3297        ///
3298        /// # Safety
3299        ///
3300        /// This might not be thread-safe.
3301        #[unsafe(method(speechRecognition))]
3302        #[unsafe(method_family = none)]
3303        pub unsafe fn speechRecognition(&self) -> Option<Retained<SFSpeechRecognitionResult>>;
3304
3305        #[cfg(feature = "objc2-sound-analysis")]
3306        /// This property is not atomic.
3307        ///
3308        /// # Safety
3309        ///
3310        /// This might not be thread-safe.
3311        #[unsafe(method(soundClassification))]
3312        #[unsafe(method_family = none)]
3313        pub unsafe fn soundClassification(&self) -> Option<Retained<SNClassificationResult>>;
3314
3315        /// This property is not atomic.
3316        ///
3317        /// # Safety
3318        ///
3319        /// This might not be thread-safe.
3320        #[unsafe(method(speechExpression))]
3321        #[unsafe(method_family = none)]
3322        pub unsafe fn speechExpression(&self) -> Option<Retained<SRSpeechExpression>>;
3323    );
3324}
3325
3326/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srfacemetricscontext?language=objc)
3327// NS_OPTIONS
3328#[repr(transparent)]
3329#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3330pub struct SRFaceMetricsContext(pub NSUInteger);
3331bitflags::bitflags! {
3332    impl SRFaceMetricsContext: NSUInteger {
3333        #[doc(alias = "SRFaceMetricsContextDeviceUnlock")]
3334        const DeviceUnlock = 1<<0;
3335        #[doc(alias = "SRFaceMetricsContextMessagingAppUsage")]
3336        const MessagingAppUsage = 1<<1;
3337    }
3338}
3339
3340unsafe impl Encode for SRFaceMetricsContext {
3341    const ENCODING: Encoding = NSUInteger::ENCODING;
3342}
3343
3344unsafe impl RefEncode for SRFaceMetricsContext {
3345    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3346}
3347
3348extern_class!(
3349    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srfacemetricsexpression?language=objc)
3350    #[unsafe(super(NSObject))]
3351    #[derive(Debug, PartialEq, Eq, Hash)]
3352    pub struct SRFaceMetricsExpression;
3353);
3354
3355unsafe impl Send for SRFaceMetricsExpression {}
3356
3357unsafe impl Sync for SRFaceMetricsExpression {}
3358
3359extern_conformance!(
3360    unsafe impl NSCoding for SRFaceMetricsExpression {}
3361);
3362
3363extern_conformance!(
3364    unsafe impl NSCopying for SRFaceMetricsExpression {}
3365);
3366
3367unsafe impl CopyingHelper for SRFaceMetricsExpression {
3368    type Result = Self;
3369}
3370
3371extern_conformance!(
3372    unsafe impl NSObjectProtocol for SRFaceMetricsExpression {}
3373);
3374
3375extern_conformance!(
3376    unsafe impl NSSecureCoding for SRFaceMetricsExpression {}
3377);
3378
3379impl SRFaceMetricsExpression {
3380    extern_methods!(
3381        #[unsafe(method(init))]
3382        #[unsafe(method_family = init)]
3383        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3384
3385        #[unsafe(method(new))]
3386        #[unsafe(method_family = new)]
3387        pub unsafe fn new() -> Retained<Self>;
3388
3389        /// An opaque identifier for the face expression
3390        ///
3391        /// More information about what this face expression represents can be found in Apple's developer documentation
3392        ///
3393        /// This property is not atomic.
3394        ///
3395        /// # Safety
3396        ///
3397        /// This might not be thread-safe.
3398        #[unsafe(method(identifier))]
3399        #[unsafe(method_family = none)]
3400        pub unsafe fn identifier(&self) -> Retained<NSString>;
3401
3402        /// double value indicating the current position of the expression
3403        ///
3404        /// This property is not atomic.
3405        ///
3406        /// # Safety
3407        ///
3408        /// This might not be thread-safe.
3409        #[unsafe(method(value))]
3410        #[unsafe(method_family = none)]
3411        pub unsafe fn value(&self) -> c_double;
3412    );
3413}
3414
3415extern_class!(
3416    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srfacemetrics?language=objc)
3417    #[unsafe(super(NSObject))]
3418    #[derive(Debug, PartialEq, Eq, Hash)]
3419    pub struct SRFaceMetrics;
3420);
3421
3422unsafe impl Send for SRFaceMetrics {}
3423
3424unsafe impl Sync for SRFaceMetrics {}
3425
3426extern_conformance!(
3427    unsafe impl NSCoding for SRFaceMetrics {}
3428);
3429
3430extern_conformance!(
3431    unsafe impl NSCopying for SRFaceMetrics {}
3432);
3433
3434unsafe impl CopyingHelper for SRFaceMetrics {
3435    type Result = Self;
3436}
3437
3438extern_conformance!(
3439    unsafe impl NSObjectProtocol for SRFaceMetrics {}
3440);
3441
3442extern_conformance!(
3443    unsafe impl NSSecureCoding for SRFaceMetrics {}
3444);
3445
3446impl SRFaceMetrics {
3447    extern_methods!(
3448        #[unsafe(method(init))]
3449        #[unsafe(method_family = init)]
3450        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3451
3452        #[unsafe(method(new))]
3453        #[unsafe(method_family = new)]
3454        pub unsafe fn new() -> Retained<Self>;
3455
3456        /// Algorithm version
3457        ///
3458        /// This property is not atomic.
3459        ///
3460        /// # Safety
3461        ///
3462        /// This might not be thread-safe.
3463        #[unsafe(method(version))]
3464        #[unsafe(method_family = none)]
3465        pub unsafe fn version(&self) -> Retained<NSString>;
3466
3467        /// Identifier of a camera session
3468        ///
3469        /// This property is not atomic.
3470        ///
3471        /// # Safety
3472        ///
3473        /// This might not be thread-safe.
3474        #[unsafe(method(sessionIdentifier))]
3475        #[unsafe(method_family = none)]
3476        pub unsafe fn sessionIdentifier(&self) -> Retained<NSString>;
3477
3478        /// Indicates system context during a camera session, e.g., if the device was unlocked or (and) a messaging app was used
3479        ///
3480        /// This property is not atomic.
3481        ///
3482        /// # Safety
3483        ///
3484        /// This might not be thread-safe.
3485        #[unsafe(method(context))]
3486        #[unsafe(method_family = none)]
3487        pub unsafe fn context(&self) -> SRFaceMetricsContext;
3488
3489        #[cfg(feature = "objc2-ar-kit")]
3490        /// This property is not atomic.
3491        ///
3492        /// # Safety
3493        ///
3494        /// This might not be thread-safe.
3495        #[unsafe(method(faceAnchor))]
3496        #[unsafe(method_family = none)]
3497        pub unsafe fn faceAnchor(&self) -> Retained<ARFaceAnchor>;
3498
3499        /// Detected whole face expressions
3500        ///
3501        /// This property is not atomic.
3502        ///
3503        /// # Safety
3504        ///
3505        /// This might not be thread-safe.
3506        #[unsafe(method(wholeFaceExpressions))]
3507        #[unsafe(method_family = none)]
3508        pub unsafe fn wholeFaceExpressions(&self) -> Retained<NSArray<SRFaceMetricsExpression>>;
3509
3510        /// Detected partial face expressions
3511        ///
3512        /// This property is not atomic.
3513        ///
3514        /// # Safety
3515        ///
3516        /// This might not be thread-safe.
3517        #[unsafe(method(partialFaceExpressions))]
3518        #[unsafe(method_family = none)]
3519        pub unsafe fn partialFaceExpressions(&self) -> Retained<NSArray<SRFaceMetricsExpression>>;
3520    );
3521}
3522
3523/// The state of the ECG session when this sample was taken
3524///
3525/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramsessionstate?language=objc)
3526// NS_ENUM
3527#[repr(transparent)]
3528#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3529pub struct SRElectrocardiogramSessionState(pub NSInteger);
3530impl SRElectrocardiogramSessionState {
3531    #[doc(alias = "SRElectrocardiogramSessionStateBegin")]
3532    pub const Begin: Self = Self(1);
3533    #[doc(alias = "SRElectrocardiogramSessionStateActive")]
3534    pub const Active: Self = Self(2);
3535    #[doc(alias = "SRElectrocardiogramSessionStateEnd")]
3536    pub const End: Self = Self(3);
3537}
3538
3539unsafe impl Encode for SRElectrocardiogramSessionState {
3540    const ENCODING: Encoding = NSInteger::ENCODING;
3541}
3542
3543unsafe impl RefEncode for SRElectrocardiogramSessionState {
3544    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3545}
3546
3547/// The type of session used to record the ECG sample
3548///
3549///
3550///
3551/// A session, usually of fixed duration, where the user is provided coaching to guide the ECG readings
3552///
3553///
3554///
3555/// A session, usually of undefined duration, where the user is not provided coaching to guide the ECG readings
3556///
3557/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramsessionguidance?language=objc)
3558// NS_ENUM
3559#[repr(transparent)]
3560#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3561pub struct SRElectrocardiogramSessionGuidance(pub NSInteger);
3562impl SRElectrocardiogramSessionGuidance {
3563    #[doc(alias = "SRElectrocardiogramSessionGuidanceGuided")]
3564    pub const Guided: Self = Self(1);
3565    #[doc(alias = "SRElectrocardiogramSessionGuidanceUnguided")]
3566    pub const Unguided: Self = Self(2);
3567}
3568
3569unsafe impl Encode for SRElectrocardiogramSessionGuidance {
3570    const ENCODING: Encoding = NSInteger::ENCODING;
3571}
3572
3573unsafe impl RefEncode for SRElectrocardiogramSessionGuidance {
3574    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3575}
3576
3577extern_class!(
3578    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramsession?language=objc)
3579    #[unsafe(super(NSObject))]
3580    #[derive(Debug, PartialEq, Eq, Hash)]
3581    pub struct SRElectrocardiogramSession;
3582);
3583
3584unsafe impl Send for SRElectrocardiogramSession {}
3585
3586unsafe impl Sync for SRElectrocardiogramSession {}
3587
3588extern_conformance!(
3589    unsafe impl NSCoding for SRElectrocardiogramSession {}
3590);
3591
3592extern_conformance!(
3593    unsafe impl NSCopying for SRElectrocardiogramSession {}
3594);
3595
3596unsafe impl CopyingHelper for SRElectrocardiogramSession {
3597    type Result = Self;
3598}
3599
3600extern_conformance!(
3601    unsafe impl NSObjectProtocol for SRElectrocardiogramSession {}
3602);
3603
3604extern_conformance!(
3605    unsafe impl NSSecureCoding for SRElectrocardiogramSession {}
3606);
3607
3608impl SRElectrocardiogramSession {
3609    extern_methods!(
3610        #[unsafe(method(init))]
3611        #[unsafe(method_family = init)]
3612        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3613
3614        #[unsafe(method(new))]
3615        #[unsafe(method_family = new)]
3616        pub unsafe fn new() -> Retained<Self>;
3617
3618        /// The state of the ECG session when the sample was recorded
3619        ///
3620        /// This property is not atomic.
3621        ///
3622        /// # Safety
3623        ///
3624        /// This might not be thread-safe.
3625        #[unsafe(method(state))]
3626        #[unsafe(method_family = none)]
3627        pub unsafe fn state(&self) -> SRElectrocardiogramSessionState;
3628
3629        /// The type of session guidance during the the ECG session
3630        ///
3631        /// This property is not atomic.
3632        ///
3633        /// # Safety
3634        ///
3635        /// This might not be thread-safe.
3636        #[unsafe(method(sessionGuidance))]
3637        #[unsafe(method_family = none)]
3638        pub unsafe fn sessionGuidance(&self) -> SRElectrocardiogramSessionGuidance;
3639
3640        /// Used to tie samples across multiple
3641        /// `SRFetchResult`s to the same session
3642        ///
3643        /// This property is not atomic.
3644        ///
3645        /// # Safety
3646        ///
3647        /// This might not be thread-safe.
3648        #[unsafe(method(identifier))]
3649        #[unsafe(method_family = none)]
3650        pub unsafe fn identifier(&self) -> Retained<NSString>;
3651    );
3652}
3653
3654/// Flags indicating sensor context or events that occurred during
3655/// the sample reading
3656///
3657///
3658/// These flags can provide some indication of data validity or other system conditions
3659/// that may influence how the recorded data should be treated.
3660///
3661/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramdataflags?language=objc)
3662// NS_OPTIONS
3663#[repr(transparent)]
3664#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3665pub struct SRElectrocardiogramDataFlags(pub NSUInteger);
3666bitflags::bitflags! {
3667    impl SRElectrocardiogramDataFlags: NSUInteger {
3668        #[doc(alias = "SRElectrocardiogramDataFlagsNone")]
3669        const None = 0;
3670/// Indicates an invalid sensor signal in the ECG data
3671        #[doc(alias = "SRElectrocardiogramDataFlagsSignalInvalid")]
3672        const SignalInvalid = 1<<0;
3673/// Indicates ECG data was recorded when the crown was being touched
3674        #[doc(alias = "SRElectrocardiogramDataFlagsCrownTouched")]
3675        const CrownTouched = 1<<1;
3676    }
3677}
3678
3679unsafe impl Encode for SRElectrocardiogramDataFlags {
3680    const ENCODING: Encoding = NSUInteger::ENCODING;
3681}
3682
3683unsafe impl RefEncode for SRElectrocardiogramDataFlags {
3684    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3685}
3686
3687extern_class!(
3688    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramdata?language=objc)
3689    #[unsafe(super(NSObject))]
3690    #[derive(Debug, PartialEq, Eq, Hash)]
3691    pub struct SRElectrocardiogramData;
3692);
3693
3694unsafe impl Send for SRElectrocardiogramData {}
3695
3696unsafe impl Sync for SRElectrocardiogramData {}
3697
3698extern_conformance!(
3699    unsafe impl NSCoding for SRElectrocardiogramData {}
3700);
3701
3702extern_conformance!(
3703    unsafe impl NSCopying for SRElectrocardiogramData {}
3704);
3705
3706unsafe impl CopyingHelper for SRElectrocardiogramData {
3707    type Result = Self;
3708}
3709
3710extern_conformance!(
3711    unsafe impl NSObjectProtocol for SRElectrocardiogramData {}
3712);
3713
3714extern_conformance!(
3715    unsafe impl NSSecureCoding for SRElectrocardiogramData {}
3716);
3717
3718impl SRElectrocardiogramData {
3719    extern_methods!(
3720        #[unsafe(method(init))]
3721        #[unsafe(method_family = init)]
3722        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3723
3724        #[unsafe(method(new))]
3725        #[unsafe(method_family = new)]
3726        pub unsafe fn new() -> Retained<Self>;
3727
3728        /// This property is not atomic.
3729        ///
3730        /// # Safety
3731        ///
3732        /// This might not be thread-safe.
3733        #[unsafe(method(flags))]
3734        #[unsafe(method_family = none)]
3735        pub unsafe fn flags(&self) -> SRElectrocardiogramDataFlags;
3736
3737        /// Value of the ECG AC data in microvolts
3738        ///
3739        /// This property is not atomic.
3740        ///
3741        /// # Safety
3742        ///
3743        /// This might not be thread-safe.
3744        #[unsafe(method(value))]
3745        #[unsafe(method_family = none)]
3746        pub unsafe fn value(&self) -> Retained<NSMeasurement<NSUnitElectricPotentialDifference>>;
3747    );
3748}
3749
3750/// Which lead was used to record the ECG data
3751///
3752/// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramlead?language=objc)
3753// NS_ENUM
3754#[repr(transparent)]
3755#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3756pub struct SRElectrocardiogramLead(pub NSInteger);
3757impl SRElectrocardiogramLead {
3758    #[doc(alias = "SRElectrocardiogramLeadRightArmMinusLeftArm")]
3759    pub const RightArmMinusLeftArm: Self = Self(1);
3760    #[doc(alias = "SRElectrocardiogramLeadLeftArmMinusRightArm")]
3761    pub const LeftArmMinusRightArm: Self = Self(2);
3762}
3763
3764unsafe impl Encode for SRElectrocardiogramLead {
3765    const ENCODING: Encoding = NSInteger::ENCODING;
3766}
3767
3768unsafe impl RefEncode for SRElectrocardiogramLead {
3769    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3770}
3771
3772extern_class!(
3773    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srelectrocardiogramsample?language=objc)
3774    #[unsafe(super(NSObject))]
3775    #[derive(Debug, PartialEq, Eq, Hash)]
3776    pub struct SRElectrocardiogramSample;
3777);
3778
3779unsafe impl Send for SRElectrocardiogramSample {}
3780
3781unsafe impl Sync for SRElectrocardiogramSample {}
3782
3783extern_conformance!(
3784    unsafe impl NSCoding for SRElectrocardiogramSample {}
3785);
3786
3787extern_conformance!(
3788    unsafe impl NSCopying for SRElectrocardiogramSample {}
3789);
3790
3791unsafe impl CopyingHelper for SRElectrocardiogramSample {
3792    type Result = Self;
3793}
3794
3795extern_conformance!(
3796    unsafe impl NSObjectProtocol for SRElectrocardiogramSample {}
3797);
3798
3799extern_conformance!(
3800    unsafe impl NSSecureCoding for SRElectrocardiogramSample {}
3801);
3802
3803impl SRElectrocardiogramSample {
3804    extern_methods!(
3805        #[unsafe(method(init))]
3806        #[unsafe(method_family = init)]
3807        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3808
3809        #[unsafe(method(new))]
3810        #[unsafe(method_family = new)]
3811        pub unsafe fn new() -> Retained<Self>;
3812
3813        /// Date of the start of the batch of ECG data
3814        ///
3815        /// This property is not atomic.
3816        ///
3817        /// # Safety
3818        ///
3819        /// This might not be thread-safe.
3820        #[unsafe(method(date))]
3821        #[unsafe(method_family = none)]
3822        pub unsafe fn date(&self) -> Retained<NSDate>;
3823
3824        /// Frequency in hertz at which the ECG data was recorded
3825        ///
3826        /// This property is not atomic.
3827        ///
3828        /// # Safety
3829        ///
3830        /// This might not be thread-safe.
3831        #[unsafe(method(frequency))]
3832        #[unsafe(method_family = none)]
3833        pub unsafe fn frequency(&self) -> Retained<NSMeasurement<NSUnitFrequency>>;
3834
3835        /// The session to which this sample belongs
3836        ///
3837        /// This property is not atomic.
3838        ///
3839        /// # Safety
3840        ///
3841        /// This might not be thread-safe.
3842        #[unsafe(method(session))]
3843        #[unsafe(method_family = none)]
3844        pub unsafe fn session(&self) -> Retained<SRElectrocardiogramSession>;
3845
3846        /// This property is not atomic.
3847        ///
3848        /// # Safety
3849        ///
3850        /// This might not be thread-safe.
3851        #[unsafe(method(lead))]
3852        #[unsafe(method_family = none)]
3853        pub unsafe fn lead(&self) -> SRElectrocardiogramLead;
3854
3855        /// This property is not atomic.
3856        ///
3857        /// # Safety
3858        ///
3859        /// This might not be thread-safe.
3860        #[unsafe(method(data))]
3861        #[unsafe(method_family = none)]
3862        pub unsafe fn data(&self) -> Retained<NSArray<SRElectrocardiogramData>>;
3863    );
3864}
3865
3866/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramopticalsamplecondition?language=objc)
3867// NS_TYPED_ENUM
3868pub type SRPhotoplethysmogramOpticalSampleCondition = NSString;
3869
3870extern "C" {
3871    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramopticalsampleconditionsignalsaturation?language=objc)
3872    pub static SRPhotoplethysmogramOpticalSampleConditionSignalSaturation:
3873        &'static SRPhotoplethysmogramOpticalSampleCondition;
3874}
3875
3876extern "C" {
3877    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramopticalsampleconditionunreliablenoise?language=objc)
3878    pub static SRPhotoplethysmogramOpticalSampleConditionUnreliableNoise:
3879        &'static SRPhotoplethysmogramOpticalSampleCondition;
3880}
3881
3882extern_class!(
3883    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramopticalsample?language=objc)
3884    #[unsafe(super(NSObject))]
3885    #[derive(Debug, PartialEq, Eq, Hash)]
3886    pub struct SRPhotoplethysmogramOpticalSample;
3887);
3888
3889unsafe impl Send for SRPhotoplethysmogramOpticalSample {}
3890
3891unsafe impl Sync for SRPhotoplethysmogramOpticalSample {}
3892
3893extern_conformance!(
3894    unsafe impl NSCoding for SRPhotoplethysmogramOpticalSample {}
3895);
3896
3897extern_conformance!(
3898    unsafe impl NSCopying for SRPhotoplethysmogramOpticalSample {}
3899);
3900
3901unsafe impl CopyingHelper for SRPhotoplethysmogramOpticalSample {
3902    type Result = Self;
3903}
3904
3905extern_conformance!(
3906    unsafe impl NSObjectProtocol for SRPhotoplethysmogramOpticalSample {}
3907);
3908
3909extern_conformance!(
3910    unsafe impl NSSecureCoding for SRPhotoplethysmogramOpticalSample {}
3911);
3912
3913impl SRPhotoplethysmogramOpticalSample {
3914    extern_methods!(
3915        #[unsafe(method(init))]
3916        #[unsafe(method_family = init)]
3917        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3918
3919        #[unsafe(method(new))]
3920        #[unsafe(method_family = new)]
3921        pub unsafe fn new() -> Retained<Self>;
3922
3923        /// The index of the LED in use during the sample reading
3924        ///
3925        /// This property is not atomic.
3926        ///
3927        /// # Safety
3928        ///
3929        /// This might not be thread-safe.
3930        #[unsafe(method(emitter))]
3931        #[unsafe(method_family = none)]
3932        pub unsafe fn emitter(&self) -> NSInteger;
3933
3934        /// The set of photodiodes in use during the sample reading
3935        ///
3936        /// This property is not atomic.
3937        ///
3938        /// # Safety
3939        ///
3940        /// This might not be thread-safe.
3941        #[unsafe(method(activePhotodiodeIndexes))]
3942        #[unsafe(method_family = none)]
3943        pub unsafe fn activePhotodiodeIndexes(&self) -> Retained<NSIndexSet>;
3944
3945        /// identifier to distinguish between different signals produced
3946        /// using the same photodiodes and emitters
3947        ///
3948        ///
3949        /// To provide the same quality of service certain system conditions may require configuring the
3950        /// PPG sensor behavior differently while using the same photodiodes and emitters. This
3951        /// identifier can be used distinguish between the different signals generated by these
3952        /// different configurations.
3953        ///
3954        /// This property is not atomic.
3955        ///
3956        /// # Safety
3957        ///
3958        /// This might not be thread-safe.
3959        #[unsafe(method(signalIdentifier))]
3960        #[unsafe(method_family = none)]
3961        pub unsafe fn signalIdentifier(&self) -> NSInteger;
3962
3963        /// the wavelength in nanometers the emitter was designed to produce while
3964        /// operating at a specific temperature
3965        ///
3966        /// This property is not atomic.
3967        ///
3968        /// # Safety
3969        ///
3970        /// This might not be thread-safe.
3971        #[unsafe(method(nominalWavelength))]
3972        #[unsafe(method_family = none)]
3973        pub unsafe fn nominalWavelength(&self) -> Retained<NSMeasurement<NSUnitLength>>;
3974
3975        /// a temperature compensated wavelength in nanometers estimate that the emitter is producing
3976        ///
3977        /// This property is not atomic.
3978        ///
3979        /// # Safety
3980        ///
3981        /// This might not be thread-safe.
3982        #[unsafe(method(effectiveWavelength))]
3983        #[unsafe(method_family = none)]
3984        pub unsafe fn effectiveWavelength(&self) -> Retained<NSMeasurement<NSUnitLength>>;
3985
3986        /// Sampling frequency of PPG data in Hz
3987        ///
3988        /// This property is not atomic.
3989        ///
3990        /// # Safety
3991        ///
3992        /// This might not be thread-safe.
3993        #[unsafe(method(samplingFrequency))]
3994        #[unsafe(method_family = none)]
3995        pub unsafe fn samplingFrequency(&self) -> Retained<NSMeasurement<NSUnitFrequency>>;
3996
3997        /// nanoseconds since the
3998        /// `SRPhotoplethysmogramSample`start date of the
3999        /// specific optical sample
4000        ///
4001        /// This property is not atomic.
4002        ///
4003        /// # Safety
4004        ///
4005        /// This might not be thread-safe.
4006        #[unsafe(method(nanosecondsSinceStart))]
4007        #[unsafe(method_family = none)]
4008        pub unsafe fn nanosecondsSinceStart(&self) -> i64;
4009
4010        /// The PPG waveform
4011        ///
4012        ///
4013        /// This may be
4014        /// `nil`when the sensor data reading is invalid
4015        ///
4016        /// This property is not atomic.
4017        ///
4018        /// # Safety
4019        ///
4020        /// This might not be thread-safe.
4021        #[unsafe(method(normalizedReflectance))]
4022        #[unsafe(method_family = none)]
4023        pub unsafe fn normalizedReflectance(&self) -> Option<Retained<NSNumber>>;
4024
4025        /// White noise estimation
4026        ///
4027        ///
4028        /// This may be
4029        /// `nil`when the sensor data reading is invalid
4030        ///
4031        /// This property is not atomic.
4032        ///
4033        /// # Safety
4034        ///
4035        /// This might not be thread-safe.
4036        #[unsafe(method(whiteNoise))]
4037        #[unsafe(method_family = none)]
4038        pub unsafe fn whiteNoise(&self) -> Option<Retained<NSNumber>>;
4039
4040        /// Pink noise estimation
4041        ///
4042        ///
4043        /// This may be
4044        /// `nil`when the sensor data reading is invalid
4045        ///
4046        /// This property is not atomic.
4047        ///
4048        /// # Safety
4049        ///
4050        /// This might not be thread-safe.
4051        #[unsafe(method(pinkNoise))]
4052        #[unsafe(method_family = none)]
4053        pub unsafe fn pinkNoise(&self) -> Option<Retained<NSNumber>>;
4054
4055        /// Estimated ambient noise intrusion
4056        ///
4057        ///
4058        /// This may be
4059        /// `nil`when the sensor data reading is invalid
4060        ///
4061        /// This property is not atomic.
4062        ///
4063        /// # Safety
4064        ///
4065        /// This might not be thread-safe.
4066        #[unsafe(method(backgroundNoise))]
4067        #[unsafe(method_family = none)]
4068        pub unsafe fn backgroundNoise(&self) -> Option<Retained<NSNumber>>;
4069
4070        /// Estimated electronics noise floor level of the sensor
4071        ///
4072        ///
4073        /// To estimate the total ambient noise, subtract scaled background noise offset
4074        /// from the background noise. The scaling factor can be computed based on
4075        /// the researcher's digital filter setup.
4076        /// This may be
4077        /// `nil`when the sensor data reading is invalid
4078        ///
4079        /// This property is not atomic.
4080        ///
4081        /// # Safety
4082        ///
4083        /// This might not be thread-safe.
4084        #[unsafe(method(backgroundNoiseOffset))]
4085        #[unsafe(method_family = none)]
4086        pub unsafe fn backgroundNoiseOffset(&self) -> Option<Retained<NSNumber>>;
4087
4088        /// Flags indicating sensor context or conditions that may effect
4089        /// the sample reading
4090        ///
4091        ///
4092        /// These flags can provide some indication of data validity or other system conditions
4093        /// that may influence how the recorded data should be treated.
4094        ///
4095        /// This property is not atomic.
4096        ///
4097        /// # Safety
4098        ///
4099        /// This might not be thread-safe.
4100        #[unsafe(method(conditions))]
4101        #[unsafe(method_family = none)]
4102        pub unsafe fn conditions(
4103            &self,
4104        ) -> Retained<NSArray<SRPhotoplethysmogramOpticalSampleCondition>>;
4105    );
4106}
4107
4108extern_class!(
4109    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramaccelerometersample?language=objc)
4110    #[unsafe(super(NSObject))]
4111    #[derive(Debug, PartialEq, Eq, Hash)]
4112    pub struct SRPhotoplethysmogramAccelerometerSample;
4113);
4114
4115unsafe impl Send for SRPhotoplethysmogramAccelerometerSample {}
4116
4117unsafe impl Sync for SRPhotoplethysmogramAccelerometerSample {}
4118
4119extern_conformance!(
4120    unsafe impl NSCoding for SRPhotoplethysmogramAccelerometerSample {}
4121);
4122
4123extern_conformance!(
4124    unsafe impl NSCopying for SRPhotoplethysmogramAccelerometerSample {}
4125);
4126
4127unsafe impl CopyingHelper for SRPhotoplethysmogramAccelerometerSample {
4128    type Result = Self;
4129}
4130
4131extern_conformance!(
4132    unsafe impl NSObjectProtocol for SRPhotoplethysmogramAccelerometerSample {}
4133);
4134
4135extern_conformance!(
4136    unsafe impl NSSecureCoding for SRPhotoplethysmogramAccelerometerSample {}
4137);
4138
4139impl SRPhotoplethysmogramAccelerometerSample {
4140    extern_methods!(
4141        #[unsafe(method(init))]
4142        #[unsafe(method_family = init)]
4143        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4144
4145        #[unsafe(method(new))]
4146        #[unsafe(method_family = new)]
4147        pub unsafe fn new() -> Retained<Self>;
4148
4149        /// nanoseconds since the
4150        /// `SRPhotoplethysmogramSample`start date of the specific
4151        /// accelerometer sample
4152        ///
4153        /// This property is not atomic.
4154        ///
4155        /// # Safety
4156        ///
4157        /// This might not be thread-safe.
4158        #[unsafe(method(nanosecondsSinceStart))]
4159        #[unsafe(method_family = none)]
4160        pub unsafe fn nanosecondsSinceStart(&self) -> i64;
4161
4162        /// Sampling frequency of accelerometer data in Hz
4163        ///
4164        /// This property is not atomic.
4165        ///
4166        /// # Safety
4167        ///
4168        /// This might not be thread-safe.
4169        #[unsafe(method(samplingFrequency))]
4170        #[unsafe(method_family = none)]
4171        pub unsafe fn samplingFrequency(&self) -> Retained<NSMeasurement<NSUnitFrequency>>;
4172
4173        /// X-axis acceleration in G's
4174        ///
4175        /// This property is not atomic.
4176        ///
4177        /// # Safety
4178        ///
4179        /// This might not be thread-safe.
4180        #[unsafe(method(x))]
4181        #[unsafe(method_family = none)]
4182        pub unsafe fn x(&self) -> Retained<NSMeasurement<NSUnitAcceleration>>;
4183
4184        /// Y-axis acceleration in G's
4185        ///
4186        /// This property is not atomic.
4187        ///
4188        /// # Safety
4189        ///
4190        /// This might not be thread-safe.
4191        #[unsafe(method(y))]
4192        #[unsafe(method_family = none)]
4193        pub unsafe fn y(&self) -> Retained<NSMeasurement<NSUnitAcceleration>>;
4194
4195        /// Z-axis acceleration in G's
4196        ///
4197        /// This property is not atomic.
4198        ///
4199        /// # Safety
4200        ///
4201        /// This might not be thread-safe.
4202        #[unsafe(method(z))]
4203        #[unsafe(method_family = none)]
4204        pub unsafe fn z(&self) -> Retained<NSMeasurement<NSUnitAcceleration>>;
4205    );
4206}
4207
4208/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramsampleusage?language=objc)
4209// NS_TYPED_ENUM
4210pub type SRPhotoplethysmogramSampleUsage = NSString;
4211
4212extern "C" {
4213    /// A heart rate reading actively taken by a user in an app context
4214    ///
4215    ///
4216    /// Typically driven by the user using the HeartRate app or a workout session.
4217    ///
4218    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramsampleusageforegroundheartrate?language=objc)
4219    pub static SRPhotoplethysmogramSampleUsageForegroundHeartRate:
4220        &'static SRPhotoplethysmogramSampleUsage;
4221}
4222
4223extern "C" {
4224    /// A sensor reading actively taken by a user in a deep breathing context
4225    ///
4226    ///
4227    /// Typically driven by the user performing a reflect or breathe session
4228    /// in the Mindfulness app.
4229    ///
4230    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramsampleusagedeepbreathing?language=objc)
4231    pub static SRPhotoplethysmogramSampleUsageDeepBreathing:
4232        &'static SRPhotoplethysmogramSampleUsage;
4233}
4234
4235extern "C" {
4236    /// A blood oxygen reading actively taken by a user in app context
4237    ///
4238    ///
4239    /// Typically driven by the user using the BloodOxygen app
4240    ///
4241    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramsampleusageforegroundbloodoxygen?language=objc)
4242    pub static SRPhotoplethysmogramSampleUsageForegroundBloodOxygen:
4243        &'static SRPhotoplethysmogramSampleUsage;
4244}
4245
4246extern "C" {
4247    /// A sample reading passively taken by the system
4248    ///
4249    ///
4250    /// These are driven by the system to perform the various heart features of watchOS
4251    /// (e.g., background blood oxygen, afib notifications, low cardio notifications, etc)
4252    ///
4253    /// See also [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramsampleusagebackgroundsystem?language=objc)
4254    pub static SRPhotoplethysmogramSampleUsageBackgroundSystem:
4255        &'static SRPhotoplethysmogramSampleUsage;
4256}
4257
4258extern_class!(
4259    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srphotoplethysmogramsample?language=objc)
4260    #[unsafe(super(NSObject))]
4261    #[derive(Debug, PartialEq, Eq, Hash)]
4262    pub struct SRPhotoplethysmogramSample;
4263);
4264
4265unsafe impl Send for SRPhotoplethysmogramSample {}
4266
4267unsafe impl Sync for SRPhotoplethysmogramSample {}
4268
4269extern_conformance!(
4270    unsafe impl NSCoding for SRPhotoplethysmogramSample {}
4271);
4272
4273extern_conformance!(
4274    unsafe impl NSCopying for SRPhotoplethysmogramSample {}
4275);
4276
4277unsafe impl CopyingHelper for SRPhotoplethysmogramSample {
4278    type Result = Self;
4279}
4280
4281extern_conformance!(
4282    unsafe impl NSObjectProtocol for SRPhotoplethysmogramSample {}
4283);
4284
4285extern_conformance!(
4286    unsafe impl NSSecureCoding for SRPhotoplethysmogramSample {}
4287);
4288
4289impl SRPhotoplethysmogramSample {
4290    extern_methods!(
4291        #[unsafe(method(init))]
4292        #[unsafe(method_family = init)]
4293        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4294
4295        #[unsafe(method(new))]
4296        #[unsafe(method_family = new)]
4297        pub unsafe fn new() -> Retained<Self>;
4298
4299        /// the start date of a data collection session
4300        ///
4301        /// This property is not atomic.
4302        ///
4303        /// # Safety
4304        ///
4305        /// This might not be thread-safe.
4306        #[unsafe(method(startDate))]
4307        #[unsafe(method_family = none)]
4308        pub unsafe fn startDate(&self) -> Retained<NSDate>;
4309
4310        /// nanoseconds since the start date of this specific sample
4311        ///
4312        /// This property is not atomic.
4313        ///
4314        /// # Safety
4315        ///
4316        /// This might not be thread-safe.
4317        #[unsafe(method(nanosecondsSinceStart))]
4318        #[unsafe(method_family = none)]
4319        pub unsafe fn nanosecondsSinceStart(&self) -> i64;
4320
4321        /// How the sensor was being used during the sample reading
4322        ///
4323        ///
4324        /// It is possible for these to occur in combination
4325        ///
4326        /// This property is not atomic.
4327        ///
4328        /// # Safety
4329        ///
4330        /// This might not be thread-safe.
4331        #[unsafe(method(usage))]
4332        #[unsafe(method_family = none)]
4333        pub unsafe fn usage(&self) -> Retained<NSArray<SRPhotoplethysmogramSampleUsage>>;
4334
4335        /// This property is not atomic.
4336        ///
4337        /// # Safety
4338        ///
4339        /// This might not be thread-safe.
4340        #[unsafe(method(opticalSamples))]
4341        #[unsafe(method_family = none)]
4342        pub unsafe fn opticalSamples(&self)
4343            -> Retained<NSArray<SRPhotoplethysmogramOpticalSample>>;
4344
4345        /// This property is not atomic.
4346        ///
4347        /// # Safety
4348        ///
4349        /// This might not be thread-safe.
4350        #[unsafe(method(accelerometerSamples))]
4351        #[unsafe(method_family = none)]
4352        pub unsafe fn accelerometerSamples(
4353            &self,
4354        ) -> Retained<NSArray<SRPhotoplethysmogramAccelerometerSample>>;
4355
4356        /// temperature of the PPG sensors in the watch, measured in celsius
4357        ///
4358        ///
4359        /// This may be
4360        /// `nil`when the sensor data reading is invalid or if is not supported by the hardware
4361        ///
4362        /// This property is not atomic.
4363        ///
4364        /// # Safety
4365        ///
4366        /// This might not be thread-safe.
4367        #[unsafe(method(temperature))]
4368        #[unsafe(method_family = none)]
4369        pub unsafe fn temperature(&self) -> Option<Retained<NSMeasurement<NSUnitTemperature>>>;
4370    );
4371}
4372
4373/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingssamplelifetime?language=objc)
4374// NS_ENUM
4375#[repr(transparent)]
4376#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4377pub struct SRAcousticSettingsSampleLifetime(pub NSInteger);
4378impl SRAcousticSettingsSampleLifetime {
4379    #[doc(alias = "SRAcousticSettingsSampleLifetimeEightDays")]
4380    pub const EightDays: Self = Self(1);
4381    #[doc(alias = "SRAcousticSettingsSampleLifetimeUntilUserDeletes")]
4382    pub const UntilUserDeletes: Self = Self(2);
4383}
4384
4385unsafe impl Encode for SRAcousticSettingsSampleLifetime {
4386    const ENCODING: Encoding = NSInteger::ENCODING;
4387}
4388
4389unsafe impl RefEncode for SRAcousticSettingsSampleLifetime {
4390    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4391}
4392
4393/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibilitybackgroundsoundsname?language=objc)
4394// NS_ENUM
4395#[repr(transparent)]
4396#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4397pub struct SRAcousticSettingsAccessibilityBackgroundSoundsName(pub NSInteger);
4398impl SRAcousticSettingsAccessibilityBackgroundSoundsName {
4399    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameBalancedNoise")]
4400    pub const BalancedNoise: Self = Self(1);
4401    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameBrightNoise")]
4402    pub const BrightNoise: Self = Self(2);
4403    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameDarkNoise")]
4404    pub const DarkNoise: Self = Self(3);
4405    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameOcean")]
4406    pub const Ocean: Self = Self(4);
4407    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameRain")]
4408    pub const Rain: Self = Self(5);
4409    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameStream")]
4410    pub const Stream: Self = Self(6);
4411    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameNight")]
4412    pub const Night: Self = Self(7);
4413    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameFire")]
4414    pub const Fire: Self = Self(8);
4415    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameBabble")]
4416    pub const Babble: Self = Self(9);
4417    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameSteam")]
4418    pub const Steam: Self = Self(10);
4419    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameAirplane")]
4420    pub const Airplane: Self = Self(11);
4421    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameBoat")]
4422    pub const Boat: Self = Self(12);
4423    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameBus")]
4424    pub const Bus: Self = Self(13);
4425    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameTrain")]
4426    pub const Train: Self = Self(14);
4427    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameRainOnRoof")]
4428    pub const RainOnRoof: Self = Self(15);
4429    #[doc(alias = "SRAcousticSettingsAccessibilityBackgroundSoundsNameQuietNight")]
4430    pub const QuietNight: Self = Self(16);
4431}
4432
4433unsafe impl Encode for SRAcousticSettingsAccessibilityBackgroundSoundsName {
4434    const ENCODING: Encoding = NSInteger::ENCODING;
4435}
4436
4437unsafe impl RefEncode for SRAcousticSettingsAccessibilityBackgroundSoundsName {
4438    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4439}
4440
4441/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibilityheadphoneaccommodationsmediaenhancetuning?language=objc)
4442// NS_ENUM
4443#[repr(transparent)]
4444#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4445pub struct SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuning(pub NSInteger);
4446impl SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuning {
4447    #[doc(
4448        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuningBalancedTone"
4449    )]
4450    pub const BalancedTone: Self = Self(1);
4451    #[doc(
4452        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuningVocalRange"
4453    )]
4454    pub const VocalRange: Self = Self(2);
4455    #[doc(
4456        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuningBrightness"
4457    )]
4458    pub const Brightness: Self = Self(3);
4459}
4460
4461unsafe impl Encode for SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuning {
4462    const ENCODING: Encoding = NSInteger::ENCODING;
4463}
4464
4465unsafe impl RefEncode for SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuning {
4466    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4467}
4468
4469/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibilityheadphoneaccommodationsmediaenhanceboosting?language=objc)
4470// NS_ENUM
4471#[repr(transparent)]
4472#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4473pub struct SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoosting(
4474    pub NSInteger,
4475);
4476impl SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoosting {
4477    #[doc(
4478        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoostingSlight"
4479    )]
4480    pub const Slight: Self = Self(1);
4481    #[doc(
4482        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoostingModerate"
4483    )]
4484    pub const Moderate: Self = Self(2);
4485    #[doc(
4486        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoostingStrong"
4487    )]
4488    pub const Strong: Self = Self(3);
4489}
4490
4491unsafe impl Encode for SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoosting {
4492    const ENCODING: Encoding = NSInteger::ENCODING;
4493}
4494
4495unsafe impl RefEncode
4496    for SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoosting
4497{
4498    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4499}
4500
4501/// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibilityheadphoneaccommodationsmediaenhanceapplication?language=objc)
4502// NS_ENUM
4503#[repr(transparent)]
4504#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4505pub struct SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplication(
4506    pub NSInteger,
4507);
4508impl SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplication {
4509    #[doc(
4510        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplicationNone"
4511    )]
4512    pub const None: Self = Self(1);
4513    #[doc(
4514        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplicationPhone"
4515    )]
4516    pub const Phone: Self = Self(2);
4517    #[doc(
4518        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplicationMedia"
4519    )]
4520    pub const Media: Self = Self(3);
4521    #[doc(
4522        alias = "SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplicationPhoneAndMedia"
4523    )]
4524    pub const PhoneAndMedia: Self = Self(4);
4525}
4526
4527unsafe impl Encode
4528    for SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplication
4529{
4530    const ENCODING: Encoding = NSInteger::ENCODING;
4531}
4532
4533unsafe impl RefEncode
4534    for SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplication
4535{
4536    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
4537}
4538
4539extern_class!(
4540    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsmusiceq?language=objc)
4541    #[unsafe(super(NSObject))]
4542    #[derive(Debug, PartialEq, Eq, Hash)]
4543    pub struct SRAcousticSettingsMusicEQ;
4544);
4545
4546unsafe impl Send for SRAcousticSettingsMusicEQ {}
4547
4548unsafe impl Sync for SRAcousticSettingsMusicEQ {}
4549
4550extern_conformance!(
4551    unsafe impl NSCoding for SRAcousticSettingsMusicEQ {}
4552);
4553
4554extern_conformance!(
4555    unsafe impl NSCopying for SRAcousticSettingsMusicEQ {}
4556);
4557
4558unsafe impl CopyingHelper for SRAcousticSettingsMusicEQ {
4559    type Result = Self;
4560}
4561
4562extern_conformance!(
4563    unsafe impl NSObjectProtocol for SRAcousticSettingsMusicEQ {}
4564);
4565
4566extern_conformance!(
4567    unsafe impl NSSecureCoding for SRAcousticSettingsMusicEQ {}
4568);
4569
4570impl SRAcousticSettingsMusicEQ {
4571    extern_methods!(
4572        /// Sound Check is turned on/off
4573        ///
4574        /// This property is not atomic.
4575        ///
4576        /// # Safety
4577        ///
4578        /// This might not be thread-safe.
4579        #[unsafe(method(isSoundCheckEnabled))]
4580        #[unsafe(method_family = none)]
4581        pub unsafe fn isSoundCheckEnabled(&self) -> bool;
4582
4583        /// Late Night Mode is turned on/off
4584        ///
4585        ///
4586        /// Music EQ Setting to dynamically compress system level audio
4587        ///
4588        /// This property is not atomic.
4589        ///
4590        /// # Safety
4591        ///
4592        /// This might not be thread-safe.
4593        #[unsafe(method(isLateNightModeEnabled))]
4594        #[unsafe(method_family = none)]
4595        pub unsafe fn isLateNightModeEnabled(&self) -> bool;
4596    );
4597}
4598
4599/// Methods declared on superclass `NSObject`.
4600impl SRAcousticSettingsMusicEQ {
4601    extern_methods!(
4602        #[unsafe(method(init))]
4603        #[unsafe(method_family = init)]
4604        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4605
4606        #[unsafe(method(new))]
4607        #[unsafe(method_family = new)]
4608        pub unsafe fn new() -> Retained<Self>;
4609    );
4610}
4611
4612extern_class!(
4613    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibilitybackgroundsounds?language=objc)
4614    #[unsafe(super(NSObject))]
4615    #[derive(Debug, PartialEq, Eq, Hash)]
4616    pub struct SRAcousticSettingsAccessibilityBackgroundSounds;
4617);
4618
4619unsafe impl Send for SRAcousticSettingsAccessibilityBackgroundSounds {}
4620
4621unsafe impl Sync for SRAcousticSettingsAccessibilityBackgroundSounds {}
4622
4623extern_conformance!(
4624    unsafe impl NSCoding for SRAcousticSettingsAccessibilityBackgroundSounds {}
4625);
4626
4627extern_conformance!(
4628    unsafe impl NSCopying for SRAcousticSettingsAccessibilityBackgroundSounds {}
4629);
4630
4631unsafe impl CopyingHelper for SRAcousticSettingsAccessibilityBackgroundSounds {
4632    type Result = Self;
4633}
4634
4635extern_conformance!(
4636    unsafe impl NSObjectProtocol for SRAcousticSettingsAccessibilityBackgroundSounds {}
4637);
4638
4639extern_conformance!(
4640    unsafe impl NSSecureCoding for SRAcousticSettingsAccessibilityBackgroundSounds {}
4641);
4642
4643impl SRAcousticSettingsAccessibilityBackgroundSounds {
4644    extern_methods!(
4645        /// Background Sounds is turned on/off
4646        ///
4647        ///
4648        /// Plays background sounds to mask unwanted environmental noise.
4649        ///
4650        /// This property is not atomic.
4651        ///
4652        /// # Safety
4653        ///
4654        /// This might not be thread-safe.
4655        #[unsafe(method(isEnabled))]
4656        #[unsafe(method_family = none)]
4657        pub unsafe fn isEnabled(&self) -> bool;
4658
4659        /// Accessibility Background sounds name
4660        ///
4661        /// This property is not atomic.
4662        ///
4663        /// # Safety
4664        ///
4665        /// This might not be thread-safe.
4666        #[unsafe(method(soundName))]
4667        #[unsafe(method_family = none)]
4668        pub unsafe fn soundName(&self) -> SRAcousticSettingsAccessibilityBackgroundSoundsName;
4669
4670        /// Accessibility Background sounds volume
4671        ///
4672        ///
4673        /// Background sounds volume relative to system volume. Units is a percentage.
4674        ///
4675        /// This property is not atomic.
4676        ///
4677        /// # Safety
4678        ///
4679        /// This might not be thread-safe.
4680        #[unsafe(method(relativeVolume))]
4681        #[unsafe(method_family = none)]
4682        pub unsafe fn relativeVolume(&self) -> c_double;
4683
4684        /// Background sounds is to be played while media is also playing
4685        ///
4686        /// This property is not atomic.
4687        ///
4688        /// # Safety
4689        ///
4690        /// This might not be thread-safe.
4691        #[unsafe(method(isPlayWithMediaEnabled))]
4692        #[unsafe(method_family = none)]
4693        pub unsafe fn isPlayWithMediaEnabled(&self) -> bool;
4694
4695        /// Accessibility Background sounds volume with media
4696        ///
4697        ///
4698        /// Background sounds volume while media is playing. Units is a percentage.
4699        ///
4700        /// This property is not atomic.
4701        ///
4702        /// # Safety
4703        ///
4704        /// This might not be thread-safe.
4705        #[unsafe(method(relativeVolumeWithMedia))]
4706        #[unsafe(method_family = none)]
4707        pub unsafe fn relativeVolumeWithMedia(&self) -> c_double;
4708
4709        /// Stop background sounds when iPhone is locked
4710        ///
4711        /// This property is not atomic.
4712        ///
4713        /// # Safety
4714        ///
4715        /// This might not be thread-safe.
4716        #[unsafe(method(isStopOnLockEnabled))]
4717        #[unsafe(method_family = none)]
4718        pub unsafe fn isStopOnLockEnabled(&self) -> bool;
4719    );
4720}
4721
4722/// Methods declared on superclass `NSObject`.
4723impl SRAcousticSettingsAccessibilityBackgroundSounds {
4724    extern_methods!(
4725        #[unsafe(method(init))]
4726        #[unsafe(method_family = init)]
4727        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4728
4729        #[unsafe(method(new))]
4730        #[unsafe(method_family = new)]
4731        pub unsafe fn new() -> Retained<Self>;
4732    );
4733}
4734
4735extern_class!(
4736    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibilityheadphoneaccommodations?language=objc)
4737    #[unsafe(super(NSObject))]
4738    #[derive(Debug, PartialEq, Eq, Hash)]
4739    pub struct SRAcousticSettingsAccessibilityHeadphoneAccommodations;
4740);
4741
4742unsafe impl Send for SRAcousticSettingsAccessibilityHeadphoneAccommodations {}
4743
4744unsafe impl Sync for SRAcousticSettingsAccessibilityHeadphoneAccommodations {}
4745
4746extern_conformance!(
4747    unsafe impl NSCoding for SRAcousticSettingsAccessibilityHeadphoneAccommodations {}
4748);
4749
4750extern_conformance!(
4751    unsafe impl NSCopying for SRAcousticSettingsAccessibilityHeadphoneAccommodations {}
4752);
4753
4754unsafe impl CopyingHelper for SRAcousticSettingsAccessibilityHeadphoneAccommodations {
4755    type Result = Self;
4756}
4757
4758extern_conformance!(
4759    unsafe impl NSObjectProtocol for SRAcousticSettingsAccessibilityHeadphoneAccommodations {}
4760);
4761
4762extern_conformance!(
4763    unsafe impl NSSecureCoding for SRAcousticSettingsAccessibilityHeadphoneAccommodations {}
4764);
4765
4766impl SRAcousticSettingsAccessibilityHeadphoneAccommodations {
4767    extern_methods!(
4768        /// Headphone Accommodations is turned on/off
4769        ///
4770        /// This property is not atomic.
4771        ///
4772        /// # Safety
4773        ///
4774        /// This might not be thread-safe.
4775        #[unsafe(method(isEnabled))]
4776        #[unsafe(method_family = none)]
4777        pub unsafe fn isEnabled(&self) -> bool;
4778
4779        /// Tune for different range of frequencies
4780        ///
4781        ///
4782        /// Optimize for providing audio tuning for different ranges of frequencies.
4783        ///
4784        /// This property is not atomic.
4785        ///
4786        /// # Safety
4787        ///
4788        /// This might not be thread-safe.
4789        #[unsafe(method(mediaEnhanceTuning))]
4790        #[unsafe(method_family = none)]
4791        pub unsafe fn mediaEnhanceTuning(
4792            &self,
4793        ) -> SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceTuning;
4794
4795        /// Soft Sounds boost level
4796        ///
4797        ///
4798        /// Soft sounds will be boosted slightly, moderately, or strongly.
4799        ///
4800        /// This property is not atomic.
4801        ///
4802        /// # Safety
4803        ///
4804        /// This might not be thread-safe.
4805        #[unsafe(method(mediaEnhanceBoosting))]
4806        #[unsafe(method_family = none)]
4807        pub unsafe fn mediaEnhanceBoosting(
4808            &self,
4809        ) -> SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceBoosting;
4810
4811        /// Headphone Accommodations Application
4812        ///
4813        ///
4814        /// Headphone Accommodations Apply to phone, media, or both.
4815        ///
4816        /// This property is not atomic.
4817        ///
4818        /// # Safety
4819        ///
4820        /// This might not be thread-safe.
4821        #[unsafe(method(mediaEnhanceApplication))]
4822        #[unsafe(method_family = none)]
4823        pub unsafe fn mediaEnhanceApplication(
4824            &self,
4825        ) -> SRAcousticSettingsAccessibilityHeadphoneAccommodationsMediaEnhanceApplication;
4826    );
4827}
4828
4829/// Methods declared on superclass `NSObject`.
4830impl SRAcousticSettingsAccessibilityHeadphoneAccommodations {
4831    extern_methods!(
4832        #[unsafe(method(init))]
4833        #[unsafe(method_family = init)]
4834        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4835
4836        #[unsafe(method(new))]
4837        #[unsafe(method_family = new)]
4838        pub unsafe fn new() -> Retained<Self>;
4839    );
4840}
4841
4842extern_class!(
4843    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettingsaccessibility?language=objc)
4844    #[unsafe(super(NSObject))]
4845    #[derive(Debug, PartialEq, Eq, Hash)]
4846    pub struct SRAcousticSettingsAccessibility;
4847);
4848
4849unsafe impl Send for SRAcousticSettingsAccessibility {}
4850
4851unsafe impl Sync for SRAcousticSettingsAccessibility {}
4852
4853extern_conformance!(
4854    unsafe impl NSCoding for SRAcousticSettingsAccessibility {}
4855);
4856
4857extern_conformance!(
4858    unsafe impl NSCopying for SRAcousticSettingsAccessibility {}
4859);
4860
4861unsafe impl CopyingHelper for SRAcousticSettingsAccessibility {
4862    type Result = Self;
4863}
4864
4865extern_conformance!(
4866    unsafe impl NSObjectProtocol for SRAcousticSettingsAccessibility {}
4867);
4868
4869extern_conformance!(
4870    unsafe impl NSSecureCoding for SRAcousticSettingsAccessibility {}
4871);
4872
4873impl SRAcousticSettingsAccessibility {
4874    extern_methods!(
4875        /// Audio volume between left and right channels
4876        ///
4877        /// This property is not atomic.
4878        ///
4879        /// # Safety
4880        ///
4881        /// This might not be thread-safe.
4882        #[unsafe(method(leftRightBalance))]
4883        #[unsafe(method_family = none)]
4884        pub unsafe fn leftRightBalance(&self) -> c_double;
4885
4886        /// When in mono mode, audio output is the same audio from both the left and right channels
4887        ///
4888        /// This property is not atomic.
4889        ///
4890        /// # Safety
4891        ///
4892        /// This might not be thread-safe.
4893        #[unsafe(method(isMonoAudioEnabled))]
4894        #[unsafe(method_family = none)]
4895        pub unsafe fn isMonoAudioEnabled(&self) -> bool;
4896
4897        /// Background Sounds Settings
4898        ///
4899        /// This property is not atomic.
4900        ///
4901        /// # Safety
4902        ///
4903        /// This might not be thread-safe.
4904        #[unsafe(method(backgroundSounds))]
4905        #[unsafe(method_family = none)]
4906        pub unsafe fn backgroundSounds(
4907            &self,
4908        ) -> Retained<SRAcousticSettingsAccessibilityBackgroundSounds>;
4909
4910        /// Headphone Accommodations Settings
4911        ///
4912        /// This property is not atomic.
4913        ///
4914        /// # Safety
4915        ///
4916        /// This might not be thread-safe.
4917        #[unsafe(method(headphoneAccommodations))]
4918        #[unsafe(method_family = none)]
4919        pub unsafe fn headphoneAccommodations(
4920            &self,
4921        ) -> Retained<SRAcousticSettingsAccessibilityHeadphoneAccommodations>;
4922    );
4923}
4924
4925/// Methods declared on superclass `NSObject`.
4926impl SRAcousticSettingsAccessibility {
4927    extern_methods!(
4928        #[unsafe(method(init))]
4929        #[unsafe(method_family = init)]
4930        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
4931
4932        #[unsafe(method(new))]
4933        #[unsafe(method_family = new)]
4934        pub unsafe fn new() -> Retained<Self>;
4935    );
4936}
4937
4938extern_class!(
4939    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/sracousticsettings?language=objc)
4940    #[unsafe(super(NSObject))]
4941    #[derive(Debug, PartialEq, Eq, Hash)]
4942    pub struct SRAcousticSettings;
4943);
4944
4945unsafe impl Send for SRAcousticSettings {}
4946
4947unsafe impl Sync for SRAcousticSettings {}
4948
4949extern_conformance!(
4950    unsafe impl NSCoding for SRAcousticSettings {}
4951);
4952
4953extern_conformance!(
4954    unsafe impl NSCopying for SRAcousticSettings {}
4955);
4956
4957unsafe impl CopyingHelper for SRAcousticSettings {
4958    type Result = Self;
4959}
4960
4961extern_conformance!(
4962    unsafe impl NSObjectProtocol for SRAcousticSettings {}
4963);
4964
4965extern_conformance!(
4966    unsafe impl NSSecureCoding for SRAcousticSettings {}
4967);
4968
4969impl SRAcousticSettings {
4970    extern_methods!(
4971        /// Environmental Sound Measurements
4972        ///
4973        ///
4974        /// Setting for Apple Watch Environmental Sound Measurements.
4975        ///
4976        /// This property is not atomic.
4977        ///
4978        /// # Safety
4979        ///
4980        /// This might not be thread-safe.
4981        #[unsafe(method(isEnvironmentalSoundMeasurementsEnabled))]
4982        #[unsafe(method_family = none)]
4983        pub unsafe fn isEnvironmentalSoundMeasurementsEnabled(&self) -> bool;
4984
4985        /// Expected lifetime of headphone audio exposure samples in HealthKit
4986        ///
4987        /// This property is not atomic.
4988        ///
4989        /// # Safety
4990        ///
4991        /// This might not be thread-safe.
4992        #[unsafe(method(audioExposureSampleLifetime))]
4993        #[unsafe(method_family = none)]
4994        pub unsafe fn audioExposureSampleLifetime(&self) -> SRAcousticSettingsSampleLifetime;
4995
4996        /// Reduce Loud Audio
4997        ///
4998        ///
4999        /// iPhone can analyze headphone audio and reduce any sound that is over a set decibel level. A nil value
5000        /// means the setting is disabled. If the setting is enabled, the property will hold the decibel value
5001        /// that headphone audio sound volume is not to exceed.
5002        ///
5003        /// This property is not atomic.
5004        ///
5005        /// # Safety
5006        ///
5007        /// This might not be thread-safe.
5008        #[unsafe(method(headphoneSafetyAudioLevel))]
5009        #[unsafe(method_family = none)]
5010        pub unsafe fn headphoneSafetyAudioLevel(&self) -> Option<Retained<NSNumber>>;
5011
5012        /// Music EQ Settings
5013        ///
5014        /// This property is not atomic.
5015        ///
5016        /// # Safety
5017        ///
5018        /// This might not be thread-safe.
5019        #[unsafe(method(musicEQSettings))]
5020        #[unsafe(method_family = none)]
5021        pub unsafe fn musicEQSettings(&self) -> Retained<SRAcousticSettingsMusicEQ>;
5022
5023        /// Accessibility Settings
5024        ///
5025        /// This property is not atomic.
5026        ///
5027        /// # Safety
5028        ///
5029        /// This might not be thread-safe.
5030        #[unsafe(method(accessibilitySettings))]
5031        #[unsafe(method_family = none)]
5032        pub unsafe fn accessibilitySettings(&self) -> Retained<SRAcousticSettingsAccessibility>;
5033
5034        #[unsafe(method(init))]
5035        #[unsafe(method_family = init)]
5036        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5037
5038        #[unsafe(method(new))]
5039        #[unsafe(method_family = new)]
5040        pub unsafe fn new() -> Retained<Self>;
5041    );
5042}
5043
5044extern_class!(
5045    /// [Apple's documentation](https://developer.apple.com/documentation/sensorkit/srsleepsession?language=objc)
5046    #[unsafe(super(NSObject))]
5047    #[derive(Debug, PartialEq, Eq, Hash)]
5048    pub struct SRSleepSession;
5049);
5050
5051unsafe impl Send for SRSleepSession {}
5052
5053unsafe impl Sync for SRSleepSession {}
5054
5055extern_conformance!(
5056    unsafe impl NSCoding for SRSleepSession {}
5057);
5058
5059extern_conformance!(
5060    unsafe impl NSCopying for SRSleepSession {}
5061);
5062
5063unsafe impl CopyingHelper for SRSleepSession {
5064    type Result = Self;
5065}
5066
5067extern_conformance!(
5068    unsafe impl NSObjectProtocol for SRSleepSession {}
5069);
5070
5071extern_conformance!(
5072    unsafe impl NSSecureCoding for SRSleepSession {}
5073);
5074
5075impl SRSleepSession {
5076    extern_methods!(
5077        #[unsafe(method(init))]
5078        #[unsafe(method_family = init)]
5079        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
5080
5081        #[unsafe(method(new))]
5082        #[unsafe(method_family = new)]
5083        pub unsafe fn new() -> Retained<Self>;
5084
5085        /// Start date of sleep session
5086        ///
5087        /// This property is not atomic.
5088        ///
5089        /// # Safety
5090        ///
5091        /// This might not be thread-safe.
5092        #[unsafe(method(startDate))]
5093        #[unsafe(method_family = none)]
5094        pub unsafe fn startDate(&self) -> Retained<NSDate>;
5095
5096        /// Sleep session duration
5097        ///
5098        ///
5099        /// Equal to 0 if endReason is SRSleepSessionEndReasonNoEndEvent
5100        ///
5101        /// This property is not atomic.
5102        ///
5103        /// # Safety
5104        ///
5105        /// This might not be thread-safe.
5106        #[unsafe(method(duration))]
5107        #[unsafe(method_family = none)]
5108        pub unsafe fn duration(&self) -> NSTimeInterval;
5109
5110        /// Sleep session unique identifier
5111        ///
5112        /// This property is not atomic.
5113        ///
5114        /// # Safety
5115        ///
5116        /// This might not be thread-safe.
5117        #[unsafe(method(identifier))]
5118        #[unsafe(method_family = none)]
5119        pub unsafe fn identifier(&self) -> Retained<NSString>;
5120    );
5121}