1#![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::unportable_markdown)]
19#![allow(rustdoc::invalid_html_tags)]
20
21#[link(name = "SensorKit", kind = "framework")]
22extern "C" {}
23
24use core::ffi::*;
25use core::ptr::NonNull;
26use objc2::__framework_prelude::*;
27#[cfg(feature = "objc2-ar-kit")]
28use objc2_ar_kit::*;
29#[cfg(feature = "objc2-core-foundation")]
30use objc2_core_foundation::*;
31#[cfg(feature = "objc2-core-location")]
32use objc2_core_location::*;
33#[cfg(feature = "objc2-core-media")]
34use objc2_core_media::*;
35use objc2_foundation::*;
36#[cfg(feature = "objc2-sound-analysis")]
37use objc2_sound_analysis::*;
38#[cfg(feature = "objc2-speech")]
39use objc2_speech::*;
40
41use crate::*;
42
43pub type SRSensor = NSString;
48
49extern "C" {
50 pub static SRSensorAmbientLightSensor: &'static SRSensor;
58}
59
60extern "C" {
61 pub static SRSensorAccelerometer: &'static SRSensor;
71}
72
73extern "C" {
74 pub static SRSensorRotationRate: &'static SRSensor;
84}
85
86extern "C" {
87 pub static SRSensorVisits: &'static SRSensor;
102}
103
104extern "C" {
105 pub static SRSensorPedometerData: &'static SRSensor;
113}
114
115extern "C" {
116 pub static SRSensorDeviceUsageReport: &'static SRSensor;
133}
134
135extern "C" {
136 pub static SRSensorMessagesUsageReport: &'static SRSensor;
150}
151
152extern "C" {
153 pub static SRSensorPhoneUsageReport: &'static SRSensor;
167}
168
169extern "C" {
170 pub static SRSensorOnWristState: &'static SRSensor;
184}
185
186extern "C" {
187 pub static SRSensorKeyboardMetrics: &'static SRSensor;
203}
204
205extern "C" {
206 pub static SRSensorSiriSpeechMetrics: &'static SRSensor;
223}
224
225extern "C" {
226 pub static SRSensorTelephonySpeechMetrics: &'static SRSensor;
243}
244
245extern "C" {
246 pub static SRSensorAmbientPressure: &'static SRSensor;
262}
263
264extern "C" {
265 pub static SRSensorMediaEvents: &'static SRSensor;
279}
280
281extern "C" {
282 pub static SRSensorWristTemperature: &'static SRSensor;
298}
299
300extern "C" {
301 pub static SRSensorHeartRate: &'static SRSensor;
309}
310
311extern "C" {
312 pub static SRSensorFaceMetrics: &'static SRSensor;
327}
328
329extern "C" {
330 pub static SRSensorOdometer: &'static SRSensor;
339}
340
341extern "C" {
342 pub static SRSensorElectrocardiogram: &'static SRSensor;
351}
352
353extern "C" {
354 pub static SRSensorPhotoplethysmogram: &'static SRSensor;
363}
364
365#[cfg(feature = "objc2-core-foundation")]
367pub type SRAbsoluteTime = CFTimeInterval;
368
369extern "C-unwind" {
370 #[cfg(feature = "objc2-core-foundation")]
374 pub fn SRAbsoluteTimeGetCurrent() -> SRAbsoluteTime;
375}
376
377extern "C-unwind" {
378 #[cfg(feature = "objc2-core-foundation")]
386 pub fn SRAbsoluteTimeFromContinuousTime(cont: u64) -> SRAbsoluteTime;
387}
388
389extern "C-unwind" {
390 #[cfg(feature = "objc2-core-foundation")]
396 pub fn SRAbsoluteTimeToCFAbsoluteTime(sr: SRAbsoluteTime) -> CFAbsoluteTime;
397}
398
399extern "C-unwind" {
400 #[cfg(feature = "objc2-core-foundation")]
406 pub fn SRAbsoluteTimeFromCFAbsoluteTime(cf: CFAbsoluteTime) -> SRAbsoluteTime;
407}
408
409mod private_NSDateSensorKit {
410 pub trait Sealed {}
411}
412
413#[doc(alias = "SensorKit")]
415pub unsafe trait NSDateSensorKit:
416 ClassType + Sized + private_NSDateSensorKit::Sealed
417{
418 extern_methods!(
419 #[cfg(feature = "objc2-core-foundation")]
420 #[unsafe(method(dateWithSRAbsoluteTime:))]
421 #[unsafe(method_family = none)]
422 unsafe fn dateWithSRAbsoluteTime(time: SRAbsoluteTime) -> Retained<Self>;
423
424 #[cfg(feature = "objc2-core-foundation")]
425 #[unsafe(method(initWithSRAbsoluteTime:))]
426 #[unsafe(method_family = init)]
427 unsafe fn initWithSRAbsoluteTime(
428 this: Allocated<Self>,
429 time: SRAbsoluteTime,
430 ) -> Retained<Self>;
431
432 #[cfg(feature = "objc2-core-foundation")]
433 #[unsafe(method(srAbsoluteTime))]
434 #[unsafe(method_family = none)]
435 unsafe fn srAbsoluteTime(&self) -> SRAbsoluteTime;
436 );
437}
438
439impl private_NSDateSensorKit::Sealed for NSDate {}
440unsafe impl NSDateSensorKit for NSDate {}
441
442extern_class!(
443 #[unsafe(super(NSObject))]
445 #[derive(Debug, PartialEq, Eq, Hash)]
446 pub struct SRFetchResult<SampleType: ?Sized = AnyObject>;
447);
448
449extern_conformance!(
450 unsafe impl<SampleType: ?Sized> NSCopying for SRFetchResult<SampleType> {}
451);
452
453unsafe impl<SampleType: ?Sized + Message> CopyingHelper for SRFetchResult<SampleType> {
454 type Result = Self;
455}
456
457extern_conformance!(
458 unsafe impl<SampleType: ?Sized> NSObjectProtocol for SRFetchResult<SampleType> {}
459);
460
461impl<SampleType: Message> SRFetchResult<SampleType> {
462 extern_methods!(
463 #[unsafe(method(sample))]
470 #[unsafe(method_family = none)]
471 pub unsafe fn sample(&self) -> Retained<SampleType>;
472
473 #[cfg(feature = "objc2-core-foundation")]
474 #[unsafe(method(timestamp))]
476 #[unsafe(method_family = none)]
477 pub unsafe fn timestamp(&self) -> SRAbsoluteTime;
478
479 #[unsafe(method(init))]
480 #[unsafe(method_family = init)]
481 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
482
483 #[unsafe(method(new))]
484 #[unsafe(method_family = new)]
485 pub unsafe fn new() -> Retained<Self>;
486 );
487}
488
489extern_class!(
490 #[unsafe(super(NSObject))]
492 #[derive(Debug, PartialEq, Eq, Hash)]
493 pub struct SRDevice;
494);
495
496extern_conformance!(
497 unsafe impl NSCoding for SRDevice {}
498);
499
500extern_conformance!(
501 unsafe impl NSCopying for SRDevice {}
502);
503
504unsafe impl CopyingHelper for SRDevice {
505 type Result = Self;
506}
507
508extern_conformance!(
509 unsafe impl NSObjectProtocol for SRDevice {}
510);
511
512extern_conformance!(
513 unsafe impl NSSecureCoding for SRDevice {}
514);
515
516impl SRDevice {
517 extern_methods!(
518 #[unsafe(method(currentDevice))]
519 #[unsafe(method_family = none)]
520 pub unsafe fn currentDevice() -> Retained<SRDevice>;
521
522 #[unsafe(method(name))]
523 #[unsafe(method_family = none)]
524 pub unsafe fn name(&self) -> Retained<NSString>;
525
526 #[unsafe(method(model))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn model(&self) -> Retained<NSString>;
529
530 #[unsafe(method(systemName))]
531 #[unsafe(method_family = none)]
532 pub unsafe fn systemName(&self) -> Retained<NSString>;
533
534 #[unsafe(method(systemVersion))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn systemVersion(&self) -> Retained<NSString>;
537
538 #[unsafe(method(productType))]
539 #[unsafe(method_family = none)]
540 pub unsafe fn productType(&self) -> Retained<NSString>;
541 );
542}
543
544impl SRDevice {
546 extern_methods!(
547 #[unsafe(method(init))]
548 #[unsafe(method_family = init)]
549 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
550
551 #[unsafe(method(new))]
552 #[unsafe(method_family = new)]
553 pub unsafe fn new() -> Retained<Self>;
554 );
555}
556
557extern_class!(
558 #[unsafe(super(NSObject))]
560 #[derive(Debug, PartialEq, Eq, Hash)]
561 pub struct SRFetchRequest;
562);
563
564extern_conformance!(
565 unsafe impl NSObjectProtocol for SRFetchRequest {}
566);
567
568impl SRFetchRequest {
569 extern_methods!(
570 #[cfg(feature = "objc2-core-foundation")]
571 #[unsafe(method(from))]
581 #[unsafe(method_family = none)]
582 pub unsafe fn from(&self) -> SRAbsoluteTime;
583
584 #[cfg(feature = "objc2-core-foundation")]
585 #[unsafe(method(setFrom:))]
587 #[unsafe(method_family = none)]
588 pub unsafe fn setFrom(&self, from: SRAbsoluteTime);
589
590 #[cfg(feature = "objc2-core-foundation")]
591 #[unsafe(method(to))]
597 #[unsafe(method_family = none)]
598 pub unsafe fn to(&self) -> SRAbsoluteTime;
599
600 #[cfg(feature = "objc2-core-foundation")]
601 #[unsafe(method(setTo:))]
603 #[unsafe(method_family = none)]
604 pub unsafe fn setTo(&self, to: SRAbsoluteTime);
605
606 #[unsafe(method(device))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn device(&self) -> Retained<SRDevice>;
612
613 #[unsafe(method(setDevice:))]
615 #[unsafe(method_family = none)]
616 pub unsafe fn setDevice(&self, device: &SRDevice);
617 );
618}
619
620impl SRFetchRequest {
622 extern_methods!(
623 #[unsafe(method(init))]
624 #[unsafe(method_family = init)]
625 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
626
627 #[unsafe(method(new))]
628 #[unsafe(method_family = new)]
629 pub unsafe fn new() -> Retained<Self>;
630 );
631}
632
633#[repr(transparent)]
636#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
637pub struct SRAuthorizationStatus(pub NSInteger);
638impl SRAuthorizationStatus {
639 #[doc(alias = "SRAuthorizationStatusNotDetermined")]
641 pub const NotDetermined: Self = Self(0);
642 #[doc(alias = "SRAuthorizationStatusAuthorized")]
644 pub const Authorized: Self = Self(1);
645 #[doc(alias = "SRAuthorizationStatusDenied")]
648 pub const Denied: Self = Self(2);
649}
650
651unsafe impl Encode for SRAuthorizationStatus {
652 const ENCODING: Encoding = NSInteger::ENCODING;
653}
654
655unsafe impl RefEncode for SRAuthorizationStatus {
656 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
657}
658
659extern_protocol!(
660 pub unsafe trait SRSensorReaderDelegate: NSObjectProtocol {
662 #[optional]
680 #[unsafe(method(sensorReader:fetchingRequest:didFetchResult:))]
681 #[unsafe(method_family = none)]
682 unsafe fn sensorReader_fetchingRequest_didFetchResult(
683 &self,
684 reader: &SRSensorReader,
685 fetch_request: &SRFetchRequest,
686 result: &SRFetchResult,
687 ) -> bool;
688
689 #[optional]
691 #[unsafe(method(sensorReader:didCompleteFetch:))]
692 #[unsafe(method_family = none)]
693 unsafe fn sensorReader_didCompleteFetch(
694 &self,
695 reader: &SRSensorReader,
696 fetch_request: &SRFetchRequest,
697 );
698
699 #[optional]
701 #[unsafe(method(sensorReader:fetchingRequest:failedWithError:))]
702 #[unsafe(method_family = none)]
703 unsafe fn sensorReader_fetchingRequest_failedWithError(
704 &self,
705 reader: &SRSensorReader,
706 fetch_request: &SRFetchRequest,
707 error: &NSError,
708 );
709
710 #[optional]
712 #[unsafe(method(sensorReader:didChangeAuthorizationStatus:))]
713 #[unsafe(method_family = none)]
714 unsafe fn sensorReader_didChangeAuthorizationStatus(
715 &self,
716 reader: &SRSensorReader,
717 authorization_status: SRAuthorizationStatus,
718 );
719
720 #[optional]
723 #[unsafe(method(sensorReaderWillStartRecording:))]
724 #[unsafe(method_family = none)]
725 unsafe fn sensorReaderWillStartRecording(&self, reader: &SRSensorReader);
726
727 #[optional]
729 #[unsafe(method(sensorReader:startRecordingFailedWithError:))]
730 #[unsafe(method_family = none)]
731 unsafe fn sensorReader_startRecordingFailedWithError(
732 &self,
733 reader: &SRSensorReader,
734 error: &NSError,
735 );
736
737 #[optional]
740 #[unsafe(method(sensorReaderDidStopRecording:))]
741 #[unsafe(method_family = none)]
742 unsafe fn sensorReaderDidStopRecording(&self, reader: &SRSensorReader);
743
744 #[optional]
746 #[unsafe(method(sensorReader:stopRecordingFailedWithError:))]
747 #[unsafe(method_family = none)]
748 unsafe fn sensorReader_stopRecordingFailedWithError(
749 &self,
750 reader: &SRSensorReader,
751 error: &NSError,
752 );
753
754 #[optional]
755 #[unsafe(method(sensorReader:didFetchDevices:))]
756 #[unsafe(method_family = none)]
757 unsafe fn sensorReader_didFetchDevices(
758 &self,
759 reader: &SRSensorReader,
760 devices: &NSArray<SRDevice>,
761 );
762
763 #[optional]
764 #[unsafe(method(sensorReader:fetchDevicesDidFailWithError:))]
765 #[unsafe(method_family = none)]
766 unsafe fn sensorReader_fetchDevicesDidFailWithError(
767 &self,
768 reader: &SRSensorReader,
769 error: &NSError,
770 );
771 }
772);
773
774extern_class!(
775 #[unsafe(super(NSObject))]
777 #[derive(Debug, PartialEq, Eq, Hash)]
778 pub struct SRSensorReader;
779);
780
781extern_conformance!(
782 unsafe impl NSObjectProtocol for SRSensorReader {}
783);
784
785impl SRSensorReader {
786 extern_methods!(
787 #[unsafe(method(initWithSensor:))]
790 #[unsafe(method_family = init)]
791 pub unsafe fn initWithSensor(this: Allocated<Self>, sensor: &SRSensor) -> Retained<Self>;
792
793 #[unsafe(method(init))]
794 #[unsafe(method_family = init)]
795 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
796
797 #[unsafe(method(new))]
798 #[unsafe(method_family = new)]
799 pub unsafe fn new() -> Retained<Self>;
800
801 #[unsafe(method(startRecording))]
819 #[unsafe(method_family = none)]
820 pub unsafe fn startRecording(&self);
821
822 #[unsafe(method(stopRecording))]
838 #[unsafe(method_family = none)]
839 pub unsafe fn stopRecording(&self);
840
841 #[unsafe(method(fetchDevices))]
850 #[unsafe(method_family = none)]
851 pub unsafe fn fetchDevices(&self);
852
853 #[unsafe(method(fetch:))]
870 #[unsafe(method_family = none)]
871 pub unsafe fn fetch(&self, request: &SRFetchRequest);
872
873 #[unsafe(method(authorizationStatus))]
875 #[unsafe(method_family = none)]
876 pub unsafe fn authorizationStatus(&self) -> SRAuthorizationStatus;
877
878 #[unsafe(method(sensor))]
880 #[unsafe(method_family = none)]
881 pub unsafe fn sensor(&self) -> Retained<SRSensor>;
882
883 #[unsafe(method(delegate))]
884 #[unsafe(method_family = none)]
885 pub unsafe fn delegate(
886 &self,
887 ) -> Option<Retained<ProtocolObject<dyn SRSensorReaderDelegate>>>;
888
889 #[unsafe(method(setDelegate:))]
892 #[unsafe(method_family = none)]
893 pub unsafe fn setDelegate(
894 &self,
895 delegate: Option<&ProtocolObject<dyn SRSensorReaderDelegate>>,
896 );
897
898 #[cfg(feature = "block2")]
899 #[unsafe(method(requestAuthorizationForSensors:completion:))]
923 #[unsafe(method_family = none)]
924 pub unsafe fn requestAuthorizationForSensors_completion(
925 sensors: &NSSet<SRSensor>,
926 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
927 );
928 );
929}
930
931extern "C" {
932 pub static SRErrorDomain: &'static NSErrorDomain;
934}
935
936#[repr(transparent)]
939#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
940pub struct SRErrorCode(pub NSInteger);
941impl SRErrorCode {
942 #[doc(alias = "SRErrorInvalidEntitlement")]
944 pub const InvalidEntitlement: Self = Self(0);
945 #[doc(alias = "SRErrorNoAuthorization")]
947 pub const NoAuthorization: Self = Self(1);
948 #[doc(alias = "SRErrorDataInaccessible")]
950 pub const DataInaccessible: Self = Self(2);
951 #[doc(alias = "SRErrorFetchRequestInvalid")]
953 pub const FetchRequestInvalid: Self = Self(3);
954 #[doc(alias = "SRErrorPromptDeclined")]
956 pub const PromptDeclined: Self = Self(4);
957}
958
959unsafe impl Encode for SRErrorCode {
960 const ENCODING: Encoding = NSInteger::ENCODING;
961}
962
963unsafe impl RefEncode for SRErrorCode {
964 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
965}
966
967#[repr(transparent)]
970#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
971pub struct SRAmbientLightSensorPlacement(pub NSInteger);
972impl SRAmbientLightSensorPlacement {
973 #[doc(alias = "SRAmbientLightSensorPlacementUnknown")]
974 pub const Unknown: Self = Self(0);
975 #[doc(alias = "SRAmbientLightSensorPlacementFrontTop")]
976 pub const FrontTop: Self = Self(1);
977 #[doc(alias = "SRAmbientLightSensorPlacementFrontBottom")]
978 pub const FrontBottom: Self = Self(2);
979 #[doc(alias = "SRAmbientLightSensorPlacementFrontRight")]
980 pub const FrontRight: Self = Self(3);
981 #[doc(alias = "SRAmbientLightSensorPlacementFrontLeft")]
982 pub const FrontLeft: Self = Self(4);
983 #[doc(alias = "SRAmbientLightSensorPlacementFrontTopRight")]
984 pub const FrontTopRight: Self = Self(5);
985 #[doc(alias = "SRAmbientLightSensorPlacementFrontTopLeft")]
986 pub const FrontTopLeft: Self = Self(6);
987 #[doc(alias = "SRAmbientLightSensorPlacementFrontBottomRight")]
988 pub const FrontBottomRight: Self = Self(7);
989 #[doc(alias = "SRAmbientLightSensorPlacementFrontBottomLeft")]
990 pub const FrontBottomLeft: Self = Self(8);
991}
992
993unsafe impl Encode for SRAmbientLightSensorPlacement {
994 const ENCODING: Encoding = NSInteger::ENCODING;
995}
996
997unsafe impl RefEncode for SRAmbientLightSensorPlacement {
998 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
999}
1000
1001#[repr(C)]
1003#[derive(Clone, Copy, Debug, PartialEq)]
1004pub struct SRAmbientLightChromaticity {
1005 pub x: f32,
1006 pub y: f32,
1007}
1008
1009unsafe impl Encode for SRAmbientLightChromaticity {
1010 const ENCODING: Encoding = Encoding::Struct("?", &[<f32>::ENCODING, <f32>::ENCODING]);
1011}
1012
1013unsafe impl RefEncode for SRAmbientLightChromaticity {
1014 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1015}
1016
1017extern_class!(
1018 #[unsafe(super(NSObject))]
1020 #[derive(Debug, PartialEq, Eq, Hash)]
1021 pub struct SRAmbientLightSample;
1022);
1023
1024extern_conformance!(
1025 unsafe impl NSObjectProtocol for SRAmbientLightSample {}
1026);
1027
1028impl SRAmbientLightSample {
1029 extern_methods!(
1030 #[unsafe(method(placement))]
1031 #[unsafe(method_family = none)]
1032 pub unsafe fn placement(&self) -> SRAmbientLightSensorPlacement;
1033
1034 #[unsafe(method(chromaticity))]
1037 #[unsafe(method_family = none)]
1038 pub unsafe fn chromaticity(&self) -> SRAmbientLightChromaticity;
1039
1040 #[unsafe(method(lux))]
1041 #[unsafe(method_family = none)]
1042 pub unsafe fn lux(&self) -> Retained<NSMeasurement<NSUnitIlluminance>>;
1043 );
1044}
1045
1046impl SRAmbientLightSample {
1048 extern_methods!(
1049 #[unsafe(method(init))]
1050 #[unsafe(method_family = init)]
1051 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1052
1053 #[unsafe(method(new))]
1054 #[unsafe(method_family = new)]
1055 pub unsafe fn new() -> Retained<Self>;
1056 );
1057}
1058
1059#[repr(transparent)]
1062#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1063pub struct SRLocationCategory(pub NSInteger);
1064impl SRLocationCategory {
1065 #[doc(alias = "SRLocationCategoryUnknown")]
1066 pub const Unknown: Self = Self(0);
1067 #[doc(alias = "SRLocationCategoryHome")]
1068 pub const Home: Self = Self(1);
1069 #[doc(alias = "SRLocationCategoryWork")]
1070 pub const Work: Self = Self(2);
1071 #[doc(alias = "SRLocationCategorySchool")]
1072 pub const School: Self = Self(3);
1073 #[doc(alias = "SRLocationCategoryGym")]
1074 pub const Gym: Self = Self(4);
1075}
1076
1077unsafe impl Encode for SRLocationCategory {
1078 const ENCODING: Encoding = NSInteger::ENCODING;
1079}
1080
1081unsafe impl RefEncode for SRLocationCategory {
1082 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1083}
1084
1085extern_class!(
1086 #[unsafe(super(NSObject))]
1088 #[derive(Debug, PartialEq, Eq, Hash)]
1089 pub struct SRVisit;
1090);
1091
1092extern_conformance!(
1093 unsafe impl NSObjectProtocol for SRVisit {}
1094);
1095
1096impl SRVisit {
1097 extern_methods!(
1098 #[cfg(feature = "objc2-core-location")]
1099 #[unsafe(method(distanceFromHome))]
1101 #[unsafe(method_family = none)]
1102 pub unsafe fn distanceFromHome(&self) -> CLLocationDistance;
1103
1104 #[unsafe(method(arrivalDateInterval))]
1106 #[unsafe(method_family = none)]
1107 pub unsafe fn arrivalDateInterval(&self) -> Retained<NSDateInterval>;
1108
1109 #[unsafe(method(departureDateInterval))]
1111 #[unsafe(method_family = none)]
1112 pub unsafe fn departureDateInterval(&self) -> Retained<NSDateInterval>;
1113
1114 #[unsafe(method(locationCategory))]
1115 #[unsafe(method_family = none)]
1116 pub unsafe fn locationCategory(&self) -> SRLocationCategory;
1117
1118 #[unsafe(method(identifier))]
1121 #[unsafe(method_family = none)]
1122 pub unsafe fn identifier(&self) -> Retained<NSUUID>;
1123 );
1124}
1125
1126impl SRVisit {
1128 extern_methods!(
1129 #[unsafe(method(init))]
1130 #[unsafe(method_family = init)]
1131 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1132
1133 #[unsafe(method(new))]
1134 #[unsafe(method_family = new)]
1135 pub unsafe fn new() -> Retained<Self>;
1136 );
1137}
1138
1139pub type SRDeviceUsageCategoryKey = NSString;
1142
1143extern "C" {
1144 pub static SRDeviceUsageCategoryGames: &'static SRDeviceUsageCategoryKey;
1146}
1147
1148extern "C" {
1149 pub static SRDeviceUsageCategoryBusiness: &'static SRDeviceUsageCategoryKey;
1151}
1152
1153extern "C" {
1154 pub static SRDeviceUsageCategoryWeather: &'static SRDeviceUsageCategoryKey;
1156}
1157
1158extern "C" {
1159 pub static SRDeviceUsageCategoryUtilities: &'static SRDeviceUsageCategoryKey;
1161}
1162
1163extern "C" {
1164 pub static SRDeviceUsageCategoryTravel: &'static SRDeviceUsageCategoryKey;
1166}
1167
1168extern "C" {
1169 pub static SRDeviceUsageCategorySports: &'static SRDeviceUsageCategoryKey;
1171}
1172
1173extern "C" {
1174 pub static SRDeviceUsageCategorySocialNetworking: &'static SRDeviceUsageCategoryKey;
1176}
1177
1178extern "C" {
1179 pub static SRDeviceUsageCategoryReference: &'static SRDeviceUsageCategoryKey;
1181}
1182
1183extern "C" {
1184 pub static SRDeviceUsageCategoryProductivity: &'static SRDeviceUsageCategoryKey;
1186}
1187
1188extern "C" {
1189 pub static SRDeviceUsageCategoryPhotoAndVideo: &'static SRDeviceUsageCategoryKey;
1191}
1192
1193extern "C" {
1194 pub static SRDeviceUsageCategoryNews: &'static SRDeviceUsageCategoryKey;
1196}
1197
1198extern "C" {
1199 pub static SRDeviceUsageCategoryNavigation: &'static SRDeviceUsageCategoryKey;
1201}
1202
1203extern "C" {
1204 pub static SRDeviceUsageCategoryMusic: &'static SRDeviceUsageCategoryKey;
1206}
1207
1208extern "C" {
1209 pub static SRDeviceUsageCategoryLifestyle: &'static SRDeviceUsageCategoryKey;
1211}
1212
1213extern "C" {
1214 pub static SRDeviceUsageCategoryHealthAndFitness: &'static SRDeviceUsageCategoryKey;
1216}
1217
1218extern "C" {
1219 pub static SRDeviceUsageCategoryFinance: &'static SRDeviceUsageCategoryKey;
1221}
1222
1223extern "C" {
1224 pub static SRDeviceUsageCategoryEntertainment: &'static SRDeviceUsageCategoryKey;
1226}
1227
1228extern "C" {
1229 pub static SRDeviceUsageCategoryEducation: &'static SRDeviceUsageCategoryKey;
1231}
1232
1233extern "C" {
1234 pub static SRDeviceUsageCategoryBooks: &'static SRDeviceUsageCategoryKey;
1236}
1237
1238extern "C" {
1239 pub static SRDeviceUsageCategoryMedical: &'static SRDeviceUsageCategoryKey;
1241}
1242
1243extern "C" {
1244 pub static SRDeviceUsageCategoryNewsstand: &'static SRDeviceUsageCategoryKey;
1246}
1247
1248extern "C" {
1249 pub static SRDeviceUsageCategoryCatalogs: &'static SRDeviceUsageCategoryKey;
1251}
1252
1253extern "C" {
1254 pub static SRDeviceUsageCategoryKids: &'static SRDeviceUsageCategoryKey;
1256}
1257
1258extern "C" {
1259 pub static SRDeviceUsageCategoryMiscellaneous: &'static SRDeviceUsageCategoryKey;
1261}
1262
1263extern "C" {
1264 pub static SRDeviceUsageCategoryFoodAndDrink: &'static SRDeviceUsageCategoryKey;
1266}
1267
1268extern "C" {
1269 pub static SRDeviceUsageCategoryDeveloperTools: &'static SRDeviceUsageCategoryKey;
1271}
1272
1273extern "C" {
1274 pub static SRDeviceUsageCategoryGraphicsAndDesign: &'static SRDeviceUsageCategoryKey;
1276}
1277
1278extern "C" {
1279 pub static SRDeviceUsageCategoryShopping: &'static SRDeviceUsageCategoryKey;
1281}
1282
1283extern "C" {
1284 pub static SRDeviceUsageCategoryStickers: &'static SRDeviceUsageCategoryKey;
1286}
1287
1288extern_class!(
1289 #[unsafe(super(NSObject))]
1299 #[derive(Debug, PartialEq, Eq, Hash)]
1300 pub struct SRSupplementalCategory;
1301);
1302
1303unsafe impl Send for SRSupplementalCategory {}
1304
1305unsafe impl Sync for SRSupplementalCategory {}
1306
1307extern_conformance!(
1308 unsafe impl NSCoding for SRSupplementalCategory {}
1309);
1310
1311extern_conformance!(
1312 unsafe impl NSCopying for SRSupplementalCategory {}
1313);
1314
1315unsafe impl CopyingHelper for SRSupplementalCategory {
1316 type Result = Self;
1317}
1318
1319extern_conformance!(
1320 unsafe impl NSObjectProtocol for SRSupplementalCategory {}
1321);
1322
1323extern_conformance!(
1324 unsafe impl NSSecureCoding for SRSupplementalCategory {}
1325);
1326
1327impl SRSupplementalCategory {
1328 extern_methods!(
1329 #[unsafe(method(identifier))]
1333 #[unsafe(method_family = none)]
1334 pub unsafe fn identifier(&self) -> Retained<NSString>;
1335
1336 #[unsafe(method(init))]
1337 #[unsafe(method_family = init)]
1338 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1339
1340 #[unsafe(method(new))]
1341 #[unsafe(method_family = new)]
1342 pub unsafe fn new() -> Retained<Self>;
1343 );
1344}
1345
1346extern_class!(
1347 #[unsafe(super(NSObject))]
1349 #[derive(Debug, PartialEq, Eq, Hash)]
1350 pub struct SRDeviceUsageReport;
1351);
1352
1353extern_conformance!(
1354 unsafe impl NSObjectProtocol for SRDeviceUsageReport {}
1355);
1356
1357impl SRDeviceUsageReport {
1358 extern_methods!(
1359 #[unsafe(method(duration))]
1361 #[unsafe(method_family = none)]
1362 pub unsafe fn duration(&self) -> NSTimeInterval;
1363
1364 #[unsafe(method(applicationUsageByCategory))]
1369 #[unsafe(method_family = none)]
1370 pub unsafe fn applicationUsageByCategory(
1371 &self,
1372 ) -> Retained<NSDictionary<SRDeviceUsageCategoryKey, NSArray<SRApplicationUsage>>>;
1373
1374 #[unsafe(method(notificationUsageByCategory))]
1379 #[unsafe(method_family = none)]
1380 pub unsafe fn notificationUsageByCategory(
1381 &self,
1382 ) -> Retained<NSDictionary<SRDeviceUsageCategoryKey, NSArray<SRNotificationUsage>>>;
1383
1384 #[unsafe(method(webUsageByCategory))]
1389 #[unsafe(method_family = none)]
1390 pub unsafe fn webUsageByCategory(
1391 &self,
1392 ) -> Retained<NSDictionary<SRDeviceUsageCategoryKey, NSArray<SRWebUsage>>>;
1393
1394 #[unsafe(method(totalScreenWakes))]
1396 #[unsafe(method_family = none)]
1397 pub unsafe fn totalScreenWakes(&self) -> NSInteger;
1398
1399 #[unsafe(method(totalUnlocks))]
1401 #[unsafe(method_family = none)]
1402 pub unsafe fn totalUnlocks(&self) -> NSInteger;
1403
1404 #[unsafe(method(totalUnlockDuration))]
1406 #[unsafe(method_family = none)]
1407 pub unsafe fn totalUnlockDuration(&self) -> NSTimeInterval;
1408
1409 #[unsafe(method(version))]
1411 #[unsafe(method_family = none)]
1412 pub unsafe fn version(&self) -> Retained<NSString>;
1413 );
1414}
1415
1416impl SRDeviceUsageReport {
1418 extern_methods!(
1419 #[unsafe(method(init))]
1420 #[unsafe(method_family = init)]
1421 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1422
1423 #[unsafe(method(new))]
1424 #[unsafe(method_family = new)]
1425 pub unsafe fn new() -> Retained<Self>;
1426 );
1427}
1428
1429#[repr(transparent)]
1432#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1433pub struct SRTextInputSessionType(pub NSInteger);
1434impl SRTextInputSessionType {
1435 #[doc(alias = "SRTextInputSessionTypeKeyboard")]
1436 pub const Keyboard: Self = Self(1);
1437 #[doc(alias = "SRTextInputSessionTypeThirdPartyKeyboard")]
1438 pub const ThirdPartyKeyboard: Self = Self(2);
1439 #[doc(alias = "SRTextInputSessionTypePencil")]
1440 pub const Pencil: Self = Self(3);
1441 #[doc(alias = "SRTextInputSessionTypeDictation")]
1442 pub const Dictation: Self = Self(4);
1443}
1444
1445unsafe impl Encode for SRTextInputSessionType {
1446 const ENCODING: Encoding = NSInteger::ENCODING;
1447}
1448
1449unsafe impl RefEncode for SRTextInputSessionType {
1450 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1451}
1452
1453extern_class!(
1454 #[unsafe(super(NSObject))]
1456 #[derive(Debug, PartialEq, Eq, Hash)]
1457 pub struct SRTextInputSession;
1458);
1459
1460extern_conformance!(
1461 unsafe impl NSObjectProtocol for SRTextInputSession {}
1462);
1463
1464impl SRTextInputSession {
1465 extern_methods!(
1466 #[unsafe(method(duration))]
1467 #[unsafe(method_family = none)]
1468 pub unsafe fn duration(&self) -> NSTimeInterval;
1469
1470 #[unsafe(method(sessionType))]
1471 #[unsafe(method_family = none)]
1472 pub unsafe fn sessionType(&self) -> SRTextInputSessionType;
1473
1474 #[unsafe(method(sessionIdentifier))]
1476 #[unsafe(method_family = none)]
1477 pub unsafe fn sessionIdentifier(&self) -> Retained<NSString>;
1478 );
1479}
1480
1481impl SRTextInputSession {
1483 extern_methods!(
1484 #[unsafe(method(init))]
1485 #[unsafe(method_family = init)]
1486 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1487
1488 #[unsafe(method(new))]
1489 #[unsafe(method_family = new)]
1490 pub unsafe fn new() -> Retained<Self>;
1491 );
1492}
1493
1494extern_class!(
1495 #[unsafe(super(NSObject))]
1497 #[derive(Debug, PartialEq, Eq, Hash)]
1498 pub struct SRApplicationUsage;
1499);
1500
1501extern_conformance!(
1502 unsafe impl NSObjectProtocol for SRApplicationUsage {}
1503);
1504
1505impl SRApplicationUsage {
1506 extern_methods!(
1507 #[unsafe(method(bundleIdentifier))]
1509 #[unsafe(method_family = none)]
1510 pub unsafe fn bundleIdentifier(&self) -> Option<Retained<NSString>>;
1511
1512 #[unsafe(method(usageTime))]
1514 #[unsafe(method_family = none)]
1515 pub unsafe fn usageTime(&self) -> NSTimeInterval;
1516
1517 #[unsafe(method(reportApplicationIdentifier))]
1523 #[unsafe(method_family = none)]
1524 pub unsafe fn reportApplicationIdentifier(&self) -> Retained<NSString>;
1525
1526 #[unsafe(method(textInputSessions))]
1534 #[unsafe(method_family = none)]
1535 pub unsafe fn textInputSessions(&self) -> Retained<NSArray<SRTextInputSession>>;
1536
1537 #[unsafe(method(supplementalCategories))]
1539 #[unsafe(method_family = none)]
1540 pub unsafe fn supplementalCategories(&self) -> Retained<NSArray<SRSupplementalCategory>>;
1541
1542 #[unsafe(method(relativeStartTime))]
1548 #[unsafe(method_family = none)]
1549 pub unsafe fn relativeStartTime(&self) -> NSTimeInterval;
1550 );
1551}
1552
1553impl SRApplicationUsage {
1555 extern_methods!(
1556 #[unsafe(method(init))]
1557 #[unsafe(method_family = init)]
1558 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1559
1560 #[unsafe(method(new))]
1561 #[unsafe(method_family = new)]
1562 pub unsafe fn new() -> Retained<Self>;
1563 );
1564}
1565
1566#[repr(transparent)]
1569#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1570pub struct SRNotificationEvent(pub NSInteger);
1571impl SRNotificationEvent {
1572 #[doc(alias = "SRNotificationEventUnknown")]
1573 pub const Unknown: Self = Self(0);
1574 #[doc(alias = "SRNotificationEventReceived")]
1575 pub const Received: Self = Self(1);
1576 #[doc(alias = "SRNotificationEventDefaultAction")]
1577 pub const DefaultAction: Self = Self(2);
1578 #[doc(alias = "SRNotificationEventSupplementaryAction")]
1579 pub const SupplementaryAction: Self = Self(3);
1580 #[doc(alias = "SRNotificationEventClear")]
1581 pub const Clear: Self = Self(4);
1582 #[doc(alias = "SRNotificationEventNotificationCenterClearAll")]
1583 pub const NotificationCenterClearAll: Self = Self(5);
1584 #[doc(alias = "SRNotificationEventRemoved")]
1585 pub const Removed: Self = Self(6);
1586 #[doc(alias = "SRNotificationEventHide")]
1587 pub const Hide: Self = Self(7);
1588 #[doc(alias = "SRNotificationEventLongLook")]
1589 pub const LongLook: Self = Self(8);
1590 #[doc(alias = "SRNotificationEventSilence")]
1591 pub const Silence: Self = Self(9);
1592 #[doc(alias = "SRNotificationEventAppLaunch")]
1593 pub const AppLaunch: Self = Self(10);
1594 #[doc(alias = "SRNotificationEventExpired")]
1595 pub const Expired: Self = Self(11);
1596 #[doc(alias = "SRNotificationEventBannerPulldown")]
1597 pub const BannerPulldown: Self = Self(12);
1598 #[doc(alias = "SRNotificationEventTapCoalesce")]
1599 pub const TapCoalesce: Self = Self(13);
1600 #[doc(alias = "SRNotificationEventDeduped")]
1601 pub const Deduped: Self = Self(14);
1602 #[doc(alias = "SRNotificationEventDeviceActivated")]
1603 pub const DeviceActivated: Self = Self(15);
1604 #[doc(alias = "SRNotificationEventDeviceUnlocked")]
1605 pub const DeviceUnlocked: Self = Self(16);
1606}
1607
1608unsafe impl Encode for SRNotificationEvent {
1609 const ENCODING: Encoding = NSInteger::ENCODING;
1610}
1611
1612unsafe impl RefEncode for SRNotificationEvent {
1613 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1614}
1615
1616extern_class!(
1617 #[unsafe(super(NSObject))]
1619 #[derive(Debug, PartialEq, Eq, Hash)]
1620 pub struct SRNotificationUsage;
1621);
1622
1623extern_conformance!(
1624 unsafe impl NSObjectProtocol for SRNotificationUsage {}
1625);
1626
1627impl SRNotificationUsage {
1628 extern_methods!(
1629 #[unsafe(method(bundleIdentifier))]
1631 #[unsafe(method_family = none)]
1632 pub unsafe fn bundleIdentifier(&self) -> Option<Retained<NSString>>;
1633
1634 #[unsafe(method(event))]
1635 #[unsafe(method_family = none)]
1636 pub unsafe fn event(&self) -> SRNotificationEvent;
1637 );
1638}
1639
1640impl SRNotificationUsage {
1642 extern_methods!(
1643 #[unsafe(method(init))]
1644 #[unsafe(method_family = init)]
1645 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1646
1647 #[unsafe(method(new))]
1648 #[unsafe(method_family = new)]
1649 pub unsafe fn new() -> Retained<Self>;
1650 );
1651}
1652
1653extern_class!(
1654 #[unsafe(super(NSObject))]
1656 #[derive(Debug, PartialEq, Eq, Hash)]
1657 pub struct SRWebUsage;
1658);
1659
1660extern_conformance!(
1661 unsafe impl NSObjectProtocol for SRWebUsage {}
1662);
1663
1664impl SRWebUsage {
1665 extern_methods!(
1666 #[unsafe(method(totalUsageTime))]
1667 #[unsafe(method_family = none)]
1668 pub unsafe fn totalUsageTime(&self) -> NSTimeInterval;
1669 );
1670}
1671
1672impl SRWebUsage {
1674 extern_methods!(
1675 #[unsafe(method(init))]
1676 #[unsafe(method_family = init)]
1677 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1678
1679 #[unsafe(method(new))]
1680 #[unsafe(method_family = new)]
1681 pub unsafe fn new() -> Retained<Self>;
1682 );
1683}
1684
1685extern_class!(
1686 #[unsafe(super(NSObject))]
1688 #[derive(Debug, PartialEq, Eq, Hash)]
1689 pub struct SRMessagesUsageReport;
1690);
1691
1692extern_conformance!(
1693 unsafe impl NSObjectProtocol for SRMessagesUsageReport {}
1694);
1695
1696impl SRMessagesUsageReport {
1697 extern_methods!(
1698 #[unsafe(method(duration))]
1699 #[unsafe(method_family = none)]
1700 pub unsafe fn duration(&self) -> NSTimeInterval;
1701
1702 #[unsafe(method(totalOutgoingMessages))]
1703 #[unsafe(method_family = none)]
1704 pub unsafe fn totalOutgoingMessages(&self) -> NSInteger;
1705
1706 #[unsafe(method(totalIncomingMessages))]
1707 #[unsafe(method_family = none)]
1708 pub unsafe fn totalIncomingMessages(&self) -> NSInteger;
1709
1710 #[unsafe(method(totalUniqueContacts))]
1711 #[unsafe(method_family = none)]
1712 pub unsafe fn totalUniqueContacts(&self) -> NSInteger;
1713 );
1714}
1715
1716impl SRMessagesUsageReport {
1718 extern_methods!(
1719 #[unsafe(method(init))]
1720 #[unsafe(method_family = init)]
1721 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1722
1723 #[unsafe(method(new))]
1724 #[unsafe(method_family = new)]
1725 pub unsafe fn new() -> Retained<Self>;
1726 );
1727}
1728
1729extern_class!(
1730 #[unsafe(super(NSObject))]
1732 #[derive(Debug, PartialEq, Eq, Hash)]
1733 pub struct SRPhoneUsageReport;
1734);
1735
1736extern_conformance!(
1737 unsafe impl NSObjectProtocol for SRPhoneUsageReport {}
1738);
1739
1740impl SRPhoneUsageReport {
1741 extern_methods!(
1742 #[unsafe(method(duration))]
1743 #[unsafe(method_family = none)]
1744 pub unsafe fn duration(&self) -> NSTimeInterval;
1745
1746 #[unsafe(method(totalOutgoingCalls))]
1747 #[unsafe(method_family = none)]
1748 pub unsafe fn totalOutgoingCalls(&self) -> NSInteger;
1749
1750 #[unsafe(method(totalIncomingCalls))]
1751 #[unsafe(method_family = none)]
1752 pub unsafe fn totalIncomingCalls(&self) -> NSInteger;
1753
1754 #[unsafe(method(totalUniqueContacts))]
1755 #[unsafe(method_family = none)]
1756 pub unsafe fn totalUniqueContacts(&self) -> NSInteger;
1757
1758 #[unsafe(method(totalPhoneCallDuration))]
1759 #[unsafe(method_family = none)]
1760 pub unsafe fn totalPhoneCallDuration(&self) -> NSTimeInterval;
1761 );
1762}
1763
1764impl SRPhoneUsageReport {
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 #[unsafe(super(NSObject))]
1780 #[derive(Debug, PartialEq, Eq, Hash)]
1781 pub struct SRKeyboardMetrics;
1782);
1783
1784extern_conformance!(
1785 unsafe impl NSObjectProtocol for SRKeyboardMetrics {}
1786);
1787
1788impl SRKeyboardMetrics {
1789 extern_methods!(
1790 #[unsafe(method(duration))]
1792 #[unsafe(method_family = none)]
1793 pub unsafe fn duration(&self) -> NSTimeInterval;
1794
1795 #[unsafe(method(keyboardIdentifier))]
1797 #[unsafe(method_family = none)]
1798 pub unsafe fn keyboardIdentifier(&self) -> Retained<NSString>;
1799
1800 #[unsafe(method(version))]
1802 #[unsafe(method_family = none)]
1803 pub unsafe fn version(&self) -> Retained<NSString>;
1804
1805 #[unsafe(method(width))]
1807 #[unsafe(method_family = none)]
1808 pub unsafe fn width(&self) -> Retained<NSMeasurement<NSUnitLength>>;
1809
1810 #[unsafe(method(height))]
1812 #[unsafe(method_family = none)]
1813 pub unsafe fn height(&self) -> Retained<NSMeasurement<NSUnitLength>>;
1814
1815 #[unsafe(method(inputModes))]
1817 #[unsafe(method_family = none)]
1818 pub unsafe fn inputModes(&self) -> Retained<NSArray<NSString>>;
1819
1820 #[unsafe(method(sessionIdentifiers))]
1822 #[unsafe(method_family = none)]
1823 pub unsafe fn sessionIdentifiers(&self) -> Retained<NSArray<NSString>>;
1824 );
1825}
1826
1827impl SRKeyboardMetrics {
1829 extern_methods!(
1830 #[unsafe(method(init))]
1831 #[unsafe(method_family = init)]
1832 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1833
1834 #[unsafe(method(new))]
1835 #[unsafe(method_family = new)]
1836 pub unsafe fn new() -> Retained<Self>;
1837 );
1838}
1839
1840impl SRKeyboardMetrics {
1842 extern_methods!(
1843 #[unsafe(method(totalWords))]
1845 #[unsafe(method_family = none)]
1846 pub unsafe fn totalWords(&self) -> NSInteger;
1847
1848 #[unsafe(method(totalAlteredWords))]
1850 #[unsafe(method_family = none)]
1851 pub unsafe fn totalAlteredWords(&self) -> NSInteger;
1852
1853 #[unsafe(method(totalTaps))]
1855 #[unsafe(method_family = none)]
1856 pub unsafe fn totalTaps(&self) -> NSInteger;
1857
1858 #[unsafe(method(totalDrags))]
1860 #[unsafe(method_family = none)]
1861 pub unsafe fn totalDrags(&self) -> NSInteger;
1862
1863 #[unsafe(method(totalDeletes))]
1865 #[unsafe(method_family = none)]
1866 pub unsafe fn totalDeletes(&self) -> NSInteger;
1867
1868 #[unsafe(method(totalEmojis))]
1870 #[unsafe(method_family = none)]
1871 pub unsafe fn totalEmojis(&self) -> NSInteger;
1872
1873 #[unsafe(method(totalPaths))]
1875 #[unsafe(method_family = none)]
1876 pub unsafe fn totalPaths(&self) -> NSInteger;
1877
1878 #[unsafe(method(totalPathTime))]
1880 #[unsafe(method_family = none)]
1881 pub unsafe fn totalPathTime(&self) -> NSTimeInterval;
1882
1883 #[unsafe(method(totalPathLength))]
1885 #[unsafe(method_family = none)]
1886 pub unsafe fn totalPathLength(&self) -> Retained<NSMeasurement<NSUnitLength>>;
1887
1888 #[unsafe(method(totalAutoCorrections))]
1890 #[unsafe(method_family = none)]
1891 pub unsafe fn totalAutoCorrections(&self) -> NSInteger;
1892
1893 #[unsafe(method(totalSpaceCorrections))]
1895 #[unsafe(method_family = none)]
1896 pub unsafe fn totalSpaceCorrections(&self) -> NSInteger;
1897
1898 #[unsafe(method(totalRetroCorrections))]
1900 #[unsafe(method_family = none)]
1901 pub unsafe fn totalRetroCorrections(&self) -> NSInteger;
1902
1903 #[unsafe(method(totalTranspositionCorrections))]
1905 #[unsafe(method_family = none)]
1906 pub unsafe fn totalTranspositionCorrections(&self) -> NSInteger;
1907
1908 #[unsafe(method(totalInsertKeyCorrections))]
1910 #[unsafe(method_family = none)]
1911 pub unsafe fn totalInsertKeyCorrections(&self) -> NSInteger;
1912
1913 #[unsafe(method(totalSkipTouchCorrections))]
1915 #[unsafe(method_family = none)]
1916 pub unsafe fn totalSkipTouchCorrections(&self) -> NSInteger;
1917
1918 #[unsafe(method(totalNearKeyCorrections))]
1920 #[unsafe(method_family = none)]
1921 pub unsafe fn totalNearKeyCorrections(&self) -> NSInteger;
1922
1923 #[unsafe(method(totalSubstitutionCorrections))]
1925 #[unsafe(method_family = none)]
1926 pub unsafe fn totalSubstitutionCorrections(&self) -> NSInteger;
1927
1928 #[unsafe(method(totalHitTestCorrections))]
1930 #[unsafe(method_family = none)]
1931 pub unsafe fn totalHitTestCorrections(&self) -> NSInteger;
1932
1933 #[unsafe(method(totalTypingDuration))]
1935 #[unsafe(method_family = none)]
1936 pub unsafe fn totalTypingDuration(&self) -> NSTimeInterval;
1937 );
1938}
1939
1940extern_class!(
1941 #[unsafe(super(NSObject))]
1943 #[derive(Debug, PartialEq, Eq, Hash)]
1944 pub struct SRKeyboardProbabilityMetric<UnitType: ?Sized = AnyObject>;
1945);
1946
1947extern_conformance!(
1948 unsafe impl<UnitType: ?Sized> NSObjectProtocol for SRKeyboardProbabilityMetric<UnitType> {}
1949);
1950
1951impl<UnitType: Message> SRKeyboardProbabilityMetric<UnitType> {
1952 extern_methods!(
1953 #[unsafe(method(distributionSampleValues))]
1955 #[unsafe(method_family = none)]
1956 pub unsafe fn distributionSampleValues(&self)
1957 -> Retained<NSArray<NSMeasurement<UnitType>>>;
1958 );
1959}
1960
1961impl<UnitType: Message> SRKeyboardProbabilityMetric<UnitType> {
1963 extern_methods!(
1964 #[unsafe(method(init))]
1965 #[unsafe(method_family = init)]
1966 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1967
1968 #[unsafe(method(new))]
1969 #[unsafe(method_family = new)]
1970 pub unsafe fn new() -> Retained<Self>;
1971 );
1972}
1973
1974impl SRKeyboardMetrics {
1976 extern_methods!(
1977 #[unsafe(method(upErrorDistance))]
1979 #[unsafe(method_family = none)]
1980 pub unsafe fn upErrorDistance(&self)
1981 -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
1982
1983 #[unsafe(method(downErrorDistance))]
1985 #[unsafe(method_family = none)]
1986 pub unsafe fn downErrorDistance(
1987 &self,
1988 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
1989
1990 #[unsafe(method(spaceUpErrorDistance))]
1992 #[unsafe(method_family = none)]
1993 pub unsafe fn spaceUpErrorDistance(
1994 &self,
1995 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
1996
1997 #[unsafe(method(spaceDownErrorDistance))]
1999 #[unsafe(method_family = none)]
2000 pub unsafe fn spaceDownErrorDistance(
2001 &self,
2002 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2003
2004 #[unsafe(method(deleteUpErrorDistance))]
2006 #[unsafe(method_family = none)]
2007 pub unsafe fn deleteUpErrorDistance(
2008 &self,
2009 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2010
2011 #[unsafe(method(deleteDownErrorDistance))]
2013 #[unsafe(method_family = none)]
2014 pub unsafe fn deleteDownErrorDistance(
2015 &self,
2016 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2017
2018 #[unsafe(method(shortWordCharKeyUpErrorDistance))]
2020 #[unsafe(method_family = none)]
2021 pub unsafe fn shortWordCharKeyUpErrorDistance(
2022 &self,
2023 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2024
2025 #[unsafe(method(shortWordCharKeyDownErrorDistance))]
2027 #[unsafe(method_family = none)]
2028 pub unsafe fn shortWordCharKeyDownErrorDistance(
2029 &self,
2030 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitLength>>;
2031
2032 #[unsafe(method(touchDownUp))]
2034 #[unsafe(method_family = none)]
2035 pub unsafe fn touchDownUp(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2036
2037 #[unsafe(method(spaceTouchDownUp))]
2039 #[unsafe(method_family = none)]
2040 pub unsafe fn spaceTouchDownUp(
2041 &self,
2042 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2043
2044 #[unsafe(method(deleteTouchDownUp))]
2046 #[unsafe(method_family = none)]
2047 pub unsafe fn deleteTouchDownUp(
2048 &self,
2049 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2050
2051 #[unsafe(method(shortWordCharKeyTouchDownUp))]
2053 #[unsafe(method_family = none)]
2054 pub unsafe fn shortWordCharKeyTouchDownUp(
2055 &self,
2056 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2057
2058 #[unsafe(method(touchDownDown))]
2060 #[unsafe(method_family = none)]
2061 pub unsafe fn touchDownDown(&self)
2062 -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2063
2064 #[unsafe(method(touchUpDown))]
2066 #[unsafe(method_family = none)]
2067 pub unsafe fn touchUpDown(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2068
2069 #[unsafe(method(charKeyToPrediction))]
2071 #[unsafe(method_family = none)]
2072 pub unsafe fn charKeyToPrediction(
2073 &self,
2074 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2075
2076 #[unsafe(method(shortWordCharKeyToCharKey))]
2078 #[unsafe(method_family = none)]
2079 pub unsafe fn shortWordCharKeyToCharKey(
2080 &self,
2081 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2082
2083 #[unsafe(method(charKeyToAnyTapKey))]
2085 #[unsafe(method_family = none)]
2086 pub unsafe fn charKeyToAnyTapKey(
2087 &self,
2088 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2089
2090 #[unsafe(method(anyTapToCharKey))]
2092 #[unsafe(method_family = none)]
2093 pub unsafe fn anyTapToCharKey(
2094 &self,
2095 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2096
2097 #[unsafe(method(spaceToCharKey))]
2099 #[unsafe(method_family = none)]
2100 pub unsafe fn spaceToCharKey(
2101 &self,
2102 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2103
2104 #[unsafe(method(charKeyToSpaceKey))]
2106 #[unsafe(method_family = none)]
2107 pub unsafe fn charKeyToSpaceKey(
2108 &self,
2109 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2110
2111 #[unsafe(method(spaceToDeleteKey))]
2113 #[unsafe(method_family = none)]
2114 pub unsafe fn spaceToDeleteKey(
2115 &self,
2116 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2117
2118 #[unsafe(method(deleteToSpaceKey))]
2120 #[unsafe(method_family = none)]
2121 pub unsafe fn deleteToSpaceKey(
2122 &self,
2123 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2124
2125 #[unsafe(method(spaceToSpaceKey))]
2127 #[unsafe(method_family = none)]
2128 pub unsafe fn spaceToSpaceKey(
2129 &self,
2130 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2131
2132 #[unsafe(method(spaceToShiftKey))]
2134 #[unsafe(method_family = none)]
2135 pub unsafe fn spaceToShiftKey(
2136 &self,
2137 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2138
2139 #[unsafe(method(spaceToPlaneChangeKey))]
2141 #[unsafe(method_family = none)]
2142 pub unsafe fn spaceToPlaneChangeKey(
2143 &self,
2144 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2145
2146 #[unsafe(method(spaceToPredictionKey))]
2148 #[unsafe(method_family = none)]
2149 pub unsafe fn spaceToPredictionKey(
2150 &self,
2151 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2152
2153 #[unsafe(method(deleteToCharKey))]
2155 #[unsafe(method_family = none)]
2156 pub unsafe fn deleteToCharKey(
2157 &self,
2158 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2159
2160 #[unsafe(method(charKeyToDelete))]
2162 #[unsafe(method_family = none)]
2163 pub unsafe fn charKeyToDelete(
2164 &self,
2165 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2166
2167 #[unsafe(method(deleteToDelete))]
2169 #[unsafe(method_family = none)]
2170 pub unsafe fn deleteToDelete(
2171 &self,
2172 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2173
2174 #[unsafe(method(deleteToShiftKey))]
2176 #[unsafe(method_family = none)]
2177 pub unsafe fn deleteToShiftKey(
2178 &self,
2179 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2180
2181 #[unsafe(method(deleteToPlaneChangeKey))]
2183 #[unsafe(method_family = none)]
2184 pub unsafe fn deleteToPlaneChangeKey(
2185 &self,
2186 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2187
2188 #[unsafe(method(anyTapToPlaneChangeKey))]
2190 #[unsafe(method_family = none)]
2191 pub unsafe fn anyTapToPlaneChangeKey(
2192 &self,
2193 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2194
2195 #[unsafe(method(planeChangeToAnyTap))]
2197 #[unsafe(method_family = none)]
2198 pub unsafe fn planeChangeToAnyTap(
2199 &self,
2200 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2201
2202 #[unsafe(method(charKeyToPlaneChangeKey))]
2204 #[unsafe(method_family = none)]
2205 pub unsafe fn charKeyToPlaneChangeKey(
2206 &self,
2207 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2208
2209 #[unsafe(method(planeChangeKeyToCharKey))]
2211 #[unsafe(method_family = none)]
2212 pub unsafe fn planeChangeKeyToCharKey(
2213 &self,
2214 ) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2215
2216 #[unsafe(method(pathErrorDistanceRatio))]
2218 #[unsafe(method_family = none)]
2219 pub unsafe fn pathErrorDistanceRatio(&self) -> Retained<NSArray<NSNumber>>;
2220
2221 #[unsafe(method(deleteToPath))]
2223 #[unsafe(method_family = none)]
2224 pub unsafe fn deleteToPath(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2225
2226 #[unsafe(method(pathToDelete))]
2228 #[unsafe(method_family = none)]
2229 pub unsafe fn pathToDelete(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2230
2231 #[unsafe(method(spaceToPath))]
2233 #[unsafe(method_family = none)]
2234 pub unsafe fn spaceToPath(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2235
2236 #[unsafe(method(pathToSpace))]
2238 #[unsafe(method_family = none)]
2239 pub unsafe fn pathToSpace(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2240
2241 #[unsafe(method(pathToPath))]
2243 #[unsafe(method_family = none)]
2244 pub unsafe fn pathToPath(&self) -> Retained<SRKeyboardProbabilityMetric<NSUnitDuration>>;
2245 );
2246}
2247
2248impl SRKeyboardMetrics {
2251 extern_methods!(
2252 #[unsafe(method(longWordUpErrorDistance))]
2254 #[unsafe(method_family = none)]
2255 pub unsafe fn longWordUpErrorDistance(
2256 &self,
2257 ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitLength>>>;
2258
2259 #[unsafe(method(longWordDownErrorDistance))]
2261 #[unsafe(method_family = none)]
2262 pub unsafe fn longWordDownErrorDistance(
2263 &self,
2264 ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitLength>>>;
2265
2266 #[unsafe(method(longWordTouchDownUp))]
2268 #[unsafe(method_family = none)]
2269 pub unsafe fn longWordTouchDownUp(
2270 &self,
2271 ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2272
2273 #[unsafe(method(longWordTouchDownDown))]
2275 #[unsafe(method_family = none)]
2276 pub unsafe fn longWordTouchDownDown(
2277 &self,
2278 ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2279
2280 #[unsafe(method(longWordTouchUpDown))]
2282 #[unsafe(method_family = none)]
2283 pub unsafe fn longWordTouchUpDown(
2284 &self,
2285 ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2286
2287 #[unsafe(method(deleteToDeletes))]
2289 #[unsafe(method_family = none)]
2290 pub unsafe fn deleteToDeletes(
2291 &self,
2292 ) -> Retained<NSArray<SRKeyboardProbabilityMetric<NSUnitDuration>>>;
2293 );
2294}
2295
2296impl SRKeyboardMetrics {
2298 extern_methods!(
2299 #[unsafe(method(totalPauses))]
2301 #[unsafe(method_family = none)]
2302 pub unsafe fn totalPauses(&self) -> NSInteger;
2303
2304 #[unsafe(method(totalPathPauses))]
2306 #[unsafe(method_family = none)]
2307 pub unsafe fn totalPathPauses(&self) -> NSInteger;
2308
2309 #[unsafe(method(typingSpeed))]
2311 #[unsafe(method_family = none)]
2312 pub unsafe fn typingSpeed(&self) -> c_double;
2313
2314 #[unsafe(method(pathTypingSpeed))]
2316 #[unsafe(method_family = none)]
2317 pub unsafe fn pathTypingSpeed(&self) -> c_double;
2318
2319 #[unsafe(method(totalTypingEpisodes))]
2321 #[unsafe(method_family = none)]
2322 pub unsafe fn totalTypingEpisodes(&self) -> NSInteger;
2323 );
2324}
2325
2326#[repr(transparent)]
2331#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2332pub struct SRKeyboardMetricsSentimentCategory(pub NSInteger);
2333impl SRKeyboardMetricsSentimentCategory {
2334 #[doc(alias = "SRKeyboardMetricsSentimentCategoryAbsolutist")]
2335 pub const Absolutist: Self = Self(0);
2336 #[doc(alias = "SRKeyboardMetricsSentimentCategoryDown")]
2337 pub const Down: Self = Self(1);
2338 #[doc(alias = "SRKeyboardMetricsSentimentCategoryDeath")]
2339 pub const Death: Self = Self(2);
2340 #[doc(alias = "SRKeyboardMetricsSentimentCategoryAnxiety")]
2341 pub const Anxiety: Self = Self(3);
2342 #[doc(alias = "SRKeyboardMetricsSentimentCategoryAnger")]
2343 pub const Anger: Self = Self(4);
2344 #[doc(alias = "SRKeyboardMetricsSentimentCategoryHealth")]
2345 pub const Health: Self = Self(5);
2346 #[doc(alias = "SRKeyboardMetricsSentimentCategoryPositive")]
2347 pub const Positive: Self = Self(6);
2348 #[doc(alias = "SRKeyboardMetricsSentimentCategorySad")]
2349 pub const Sad: Self = Self(7);
2350 #[doc(alias = "SRKeyboardMetricsSentimentCategoryLowEnergy")]
2351 pub const LowEnergy: Self = Self(8);
2352 #[doc(alias = "SRKeyboardMetricsSentimentCategoryConfused")]
2353 pub const Confused: Self = Self(9);
2354}
2355
2356unsafe impl Encode for SRKeyboardMetricsSentimentCategory {
2357 const ENCODING: Encoding = NSInteger::ENCODING;
2358}
2359
2360unsafe impl RefEncode for SRKeyboardMetricsSentimentCategory {
2361 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2362}
2363
2364impl SRKeyboardMetrics {
2368 extern_methods!(
2369 #[unsafe(method(wordCountForSentimentCategory:))]
2371 #[unsafe(method_family = none)]
2372 pub unsafe fn wordCountForSentimentCategory(
2373 &self,
2374 category: SRKeyboardMetricsSentimentCategory,
2375 ) -> NSInteger;
2376
2377 #[unsafe(method(emojiCountForSentimentCategory:))]
2379 #[unsafe(method_family = none)]
2380 pub unsafe fn emojiCountForSentimentCategory(
2381 &self,
2382 category: SRKeyboardMetricsSentimentCategory,
2383 ) -> NSInteger;
2384 );
2385}
2386
2387#[repr(transparent)]
2390#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2391pub struct SRDeletionReason(pub NSInteger);
2392impl SRDeletionReason {
2393 #[doc(alias = "SRDeletionReasonUserInitiated")]
2395 pub const UserInitiated: Self = Self(0);
2396 #[doc(alias = "SRDeletionReasonLowDiskSpace")]
2398 pub const LowDiskSpace: Self = Self(1);
2399 #[doc(alias = "SRDeletionReasonAgeLimit")]
2401 pub const AgeLimit: Self = Self(2);
2402 #[doc(alias = "SRDeletionReasonNoInterestedClients")]
2404 pub const NoInterestedClients: Self = Self(3);
2405 #[doc(alias = "SRDeletionReasonSystemInitiated")]
2407 pub const SystemInitiated: Self = Self(4);
2408}
2409
2410unsafe impl Encode for SRDeletionReason {
2411 const ENCODING: Encoding = NSInteger::ENCODING;
2412}
2413
2414unsafe impl RefEncode for SRDeletionReason {
2415 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2416}
2417
2418extern_class!(
2419 #[unsafe(super(NSObject))]
2421 #[derive(Debug, PartialEq, Eq, Hash)]
2422 pub struct SRDeletionRecord;
2423);
2424
2425extern_conformance!(
2426 unsafe impl NSCoding for SRDeletionRecord {}
2427);
2428
2429extern_conformance!(
2430 unsafe impl NSObjectProtocol for SRDeletionRecord {}
2431);
2432
2433extern_conformance!(
2434 unsafe impl NSSecureCoding for SRDeletionRecord {}
2435);
2436
2437impl SRDeletionRecord {
2438 extern_methods!(
2439 #[cfg(feature = "objc2-core-foundation")]
2440 #[unsafe(method(startTime))]
2441 #[unsafe(method_family = none)]
2442 pub unsafe fn startTime(&self) -> SRAbsoluteTime;
2443
2444 #[cfg(feature = "objc2-core-foundation")]
2445 #[unsafe(method(endTime))]
2446 #[unsafe(method_family = none)]
2447 pub unsafe fn endTime(&self) -> SRAbsoluteTime;
2448
2449 #[unsafe(method(reason))]
2450 #[unsafe(method_family = none)]
2451 pub unsafe fn reason(&self) -> SRDeletionReason;
2452 );
2453}
2454
2455impl SRDeletionRecord {
2457 extern_methods!(
2458 #[unsafe(method(init))]
2459 #[unsafe(method_family = init)]
2460 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2461
2462 #[unsafe(method(new))]
2463 #[unsafe(method_family = new)]
2464 pub unsafe fn new() -> Retained<Self>;
2465 );
2466}
2467
2468mod private_NSStringSRDeletionRecord {
2469 pub trait Sealed {}
2470}
2471
2472#[doc(alias = "SRDeletionRecord")]
2474pub unsafe trait NSStringSRDeletionRecord:
2475 ClassType + Sized + private_NSStringSRDeletionRecord::Sealed
2476{
2477 extern_methods!(
2478 #[unsafe(method(sr_sensorForDeletionRecordsFromSensor))]
2488 #[unsafe(method_family = none)]
2489 unsafe fn sr_sensorForDeletionRecordsFromSensor(&self) -> Option<Retained<SRSensor>>;
2490 );
2491}
2492
2493impl private_NSStringSRDeletionRecord::Sealed for NSString {}
2494unsafe impl NSStringSRDeletionRecord for NSString {}
2495
2496#[repr(transparent)]
2499#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2500pub struct SRWristLocation(pub NSInteger);
2501impl SRWristLocation {
2502 #[doc(alias = "SRWristLocationLeft")]
2503 pub const Left: Self = Self(0);
2504 #[doc(alias = "SRWristLocationRight")]
2505 pub const Right: Self = Self(1);
2506}
2507
2508unsafe impl Encode for SRWristLocation {
2509 const ENCODING: Encoding = NSInteger::ENCODING;
2510}
2511
2512unsafe impl RefEncode for SRWristLocation {
2513 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2514}
2515
2516#[repr(transparent)]
2519#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2520pub struct SRCrownOrientation(pub NSInteger);
2521impl SRCrownOrientation {
2522 #[doc(alias = "SRCrownOrientationLeft")]
2523 pub const Left: Self = Self(0);
2524 #[doc(alias = "SRCrownOrientationRight")]
2525 pub const Right: Self = Self(1);
2526}
2527
2528unsafe impl Encode for SRCrownOrientation {
2529 const ENCODING: Encoding = NSInteger::ENCODING;
2530}
2531
2532unsafe impl RefEncode for SRCrownOrientation {
2533 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2534}
2535
2536extern_class!(
2537 #[unsafe(super(NSObject))]
2539 #[derive(Debug, PartialEq, Eq, Hash)]
2540 pub struct SRWristDetection;
2541);
2542
2543extern_conformance!(
2544 unsafe impl NSObjectProtocol for SRWristDetection {}
2545);
2546
2547impl SRWristDetection {
2548 extern_methods!(
2549 #[unsafe(method(onWrist))]
2550 #[unsafe(method_family = none)]
2551 pub unsafe fn onWrist(&self) -> bool;
2552
2553 #[unsafe(method(wristLocation))]
2554 #[unsafe(method_family = none)]
2555 pub unsafe fn wristLocation(&self) -> SRWristLocation;
2556
2557 #[unsafe(method(crownOrientation))]
2558 #[unsafe(method_family = none)]
2559 pub unsafe fn crownOrientation(&self) -> SRCrownOrientation;
2560
2561 #[unsafe(method(onWristDate))]
2567 #[unsafe(method_family = none)]
2568 pub unsafe fn onWristDate(&self) -> Option<Retained<NSDate>>;
2569
2570 #[unsafe(method(offWristDate))]
2576 #[unsafe(method_family = none)]
2577 pub unsafe fn offWristDate(&self) -> Option<Retained<NSDate>>;
2578 );
2579}
2580
2581impl SRWristDetection {
2583 extern_methods!(
2584 #[unsafe(method(init))]
2585 #[unsafe(method_family = init)]
2586 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2587
2588 #[unsafe(method(new))]
2589 #[unsafe(method_family = new)]
2590 pub unsafe fn new() -> Retained<Self>;
2591 );
2592}
2593
2594#[repr(transparent)]
2597#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2598pub struct SRWristTemperatureCondition(pub NSUInteger);
2599bitflags::bitflags! {
2600 impl SRWristTemperatureCondition: NSUInteger {
2601 #[doc(alias = "SRWristTemperatureConditionNone")]
2602 const None = 0;
2603 #[doc(alias = "SRWristTemperatureConditionOffWrist")]
2604 const OffWrist = 1<<0;
2605 #[doc(alias = "SRWristTemperatureConditionOnCharger")]
2606 const OnCharger = 1<<1;
2607 #[doc(alias = "SRWristTemperatureConditionInMotion")]
2608 const InMotion = 1<<2;
2609 }
2610}
2611
2612unsafe impl Encode for SRWristTemperatureCondition {
2613 const ENCODING: Encoding = NSUInteger::ENCODING;
2614}
2615
2616unsafe impl RefEncode for SRWristTemperatureCondition {
2617 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2618}
2619
2620extern_class!(
2621 #[unsafe(super(NSObject))]
2623 #[derive(Debug, PartialEq, Eq, Hash)]
2624 pub struct SRWristTemperature;
2625);
2626
2627unsafe impl Send for SRWristTemperature {}
2628
2629unsafe impl Sync for SRWristTemperature {}
2630
2631extern_conformance!(
2632 unsafe impl NSCoding for SRWristTemperature {}
2633);
2634
2635extern_conformance!(
2636 unsafe impl NSCopying for SRWristTemperature {}
2637);
2638
2639unsafe impl CopyingHelper for SRWristTemperature {
2640 type Result = Self;
2641}
2642
2643extern_conformance!(
2644 unsafe impl NSObjectProtocol for SRWristTemperature {}
2645);
2646
2647extern_conformance!(
2648 unsafe impl NSSecureCoding for SRWristTemperature {}
2649);
2650
2651impl SRWristTemperature {
2652 extern_methods!(
2653 #[unsafe(method(init))]
2654 #[unsafe(method_family = init)]
2655 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2656
2657 #[unsafe(method(new))]
2658 #[unsafe(method_family = new)]
2659 pub unsafe fn new() -> Retained<Self>;
2660
2661 #[unsafe(method(timestamp))]
2663 #[unsafe(method_family = none)]
2664 pub unsafe fn timestamp(&self) -> Retained<NSDate>;
2665
2666 #[unsafe(method(value))]
2668 #[unsafe(method_family = none)]
2669 pub unsafe fn value(&self) -> Retained<NSMeasurement<NSUnitTemperature>>;
2670
2671 #[unsafe(method(condition))]
2673 #[unsafe(method_family = none)]
2674 pub unsafe fn condition(&self) -> SRWristTemperatureCondition;
2675
2676 #[unsafe(method(errorEstimate))]
2679 #[unsafe(method_family = none)]
2680 pub unsafe fn errorEstimate(&self) -> Retained<NSMeasurement<NSUnitTemperature>>;
2681 );
2682}
2683
2684extern_class!(
2685 #[unsafe(super(NSObject))]
2687 #[derive(Debug, PartialEq, Eq, Hash)]
2688 pub struct SRWristTemperatureSession;
2689);
2690
2691unsafe impl Send for SRWristTemperatureSession {}
2692
2693unsafe impl Sync for SRWristTemperatureSession {}
2694
2695extern_conformance!(
2696 unsafe impl NSCoding for SRWristTemperatureSession {}
2697);
2698
2699extern_conformance!(
2700 unsafe impl NSCopying for SRWristTemperatureSession {}
2701);
2702
2703unsafe impl CopyingHelper for SRWristTemperatureSession {
2704 type Result = Self;
2705}
2706
2707extern_conformance!(
2708 unsafe impl NSObjectProtocol for SRWristTemperatureSession {}
2709);
2710
2711extern_conformance!(
2712 unsafe impl NSSecureCoding for SRWristTemperatureSession {}
2713);
2714
2715impl SRWristTemperatureSession {
2716 extern_methods!(
2717 #[unsafe(method(init))]
2718 #[unsafe(method_family = init)]
2719 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2720
2721 #[unsafe(method(new))]
2722 #[unsafe(method_family = new)]
2723 pub unsafe fn new() -> Retained<Self>;
2724
2725 #[unsafe(method(startDate))]
2727 #[unsafe(method_family = none)]
2728 pub unsafe fn startDate(&self) -> Retained<NSDate>;
2729
2730 #[unsafe(method(duration))]
2732 #[unsafe(method_family = none)]
2733 pub unsafe fn duration(&self) -> NSTimeInterval;
2734
2735 #[unsafe(method(version))]
2737 #[unsafe(method_family = none)]
2738 pub unsafe fn version(&self) -> Retained<NSString>;
2739
2740 #[unsafe(method(temperatures))]
2742 #[unsafe(method_family = none)]
2743 pub unsafe fn temperatures(&self) -> Retained<NSEnumerator<SRWristTemperature>>;
2744 );
2745}
2746
2747#[repr(transparent)]
2750#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2751pub struct SRMediaEventType(pub NSInteger);
2752impl SRMediaEventType {
2753 #[doc(alias = "SRMediaEventOnScreen")]
2754 pub const OnScreen: Self = Self(1);
2755 #[doc(alias = "SRMediaEventOffScreen")]
2756 pub const OffScreen: Self = Self(2);
2757}
2758
2759unsafe impl Encode for SRMediaEventType {
2760 const ENCODING: Encoding = NSInteger::ENCODING;
2761}
2762
2763unsafe impl RefEncode for SRMediaEventType {
2764 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2765}
2766
2767extern_class!(
2768 #[unsafe(super(NSObject))]
2770 #[derive(Debug, PartialEq, Eq, Hash)]
2771 pub struct SRMediaEvent;
2772);
2773
2774unsafe impl Send for SRMediaEvent {}
2775
2776unsafe impl Sync for SRMediaEvent {}
2777
2778extern_conformance!(
2779 unsafe impl NSCoding for SRMediaEvent {}
2780);
2781
2782extern_conformance!(
2783 unsafe impl NSCopying for SRMediaEvent {}
2784);
2785
2786unsafe impl CopyingHelper for SRMediaEvent {
2787 type Result = Self;
2788}
2789
2790extern_conformance!(
2791 unsafe impl NSObjectProtocol for SRMediaEvent {}
2792);
2793
2794extern_conformance!(
2795 unsafe impl NSSecureCoding for SRMediaEvent {}
2796);
2797
2798impl SRMediaEvent {
2799 extern_methods!(
2800 #[unsafe(method(mediaIdentifier))]
2805 #[unsafe(method_family = none)]
2806 pub unsafe fn mediaIdentifier(&self) -> Retained<NSString>;
2807
2808 #[unsafe(method(eventType))]
2813 #[unsafe(method_family = none)]
2814 pub unsafe fn eventType(&self) -> SRMediaEventType;
2815 );
2816}
2817
2818impl SRMediaEvent {
2820 extern_methods!(
2821 #[unsafe(method(init))]
2822 #[unsafe(method_family = init)]
2823 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2824
2825 #[unsafe(method(new))]
2826 #[unsafe(method_family = new)]
2827 pub unsafe fn new() -> Retained<Self>;
2828 );
2829}
2830
2831extern_class!(
2832 #[unsafe(super(NSObject))]
2834 #[derive(Debug, PartialEq, Eq, Hash)]
2835 pub struct SRSpeechExpression;
2836);
2837
2838unsafe impl Send for SRSpeechExpression {}
2839
2840unsafe impl Sync for SRSpeechExpression {}
2841
2842extern_conformance!(
2843 unsafe impl NSCoding for SRSpeechExpression {}
2844);
2845
2846extern_conformance!(
2847 unsafe impl NSCopying for SRSpeechExpression {}
2848);
2849
2850unsafe impl CopyingHelper for SRSpeechExpression {
2851 type Result = Self;
2852}
2853
2854extern_conformance!(
2855 unsafe impl NSObjectProtocol for SRSpeechExpression {}
2856);
2857
2858extern_conformance!(
2859 unsafe impl NSSecureCoding for SRSpeechExpression {}
2860);
2861
2862impl SRSpeechExpression {
2863 extern_methods!(
2864 #[unsafe(method(init))]
2865 #[unsafe(method_family = init)]
2866 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2867
2868 #[unsafe(method(new))]
2869 #[unsafe(method_family = new)]
2870 pub unsafe fn new() -> Retained<Self>;
2871
2872 #[unsafe(method(version))]
2875 #[unsafe(method_family = none)]
2876 pub unsafe fn version(&self) -> Retained<NSString>;
2877
2878 #[cfg(feature = "objc2-core-media")]
2879 #[unsafe(method(timeRange))]
2882 #[unsafe(method_family = none)]
2883 pub unsafe fn timeRange(&self) -> CMTimeRange;
2884
2885 #[unsafe(method(confidence))]
2887 #[unsafe(method_family = none)]
2888 pub unsafe fn confidence(&self) -> c_double;
2889
2890 #[unsafe(method(mood))]
2896 #[unsafe(method_family = none)]
2897 pub unsafe fn mood(&self) -> c_double;
2898
2899 #[unsafe(method(valence))]
2905 #[unsafe(method_family = none)]
2906 pub unsafe fn valence(&self) -> c_double;
2907
2908 #[unsafe(method(activation))]
2914 #[unsafe(method_family = none)]
2915 pub unsafe fn activation(&self) -> c_double;
2916
2917 #[unsafe(method(dominance))]
2923 #[unsafe(method_family = none)]
2924 pub unsafe fn dominance(&self) -> c_double;
2925 );
2926}
2927
2928extern_class!(
2929 #[unsafe(super(NSObject))]
2931 #[derive(Debug, PartialEq, Eq, Hash)]
2932 pub struct SRAudioLevel;
2933);
2934
2935unsafe impl Send for SRAudioLevel {}
2936
2937unsafe impl Sync for SRAudioLevel {}
2938
2939extern_conformance!(
2940 unsafe impl NSCoding for SRAudioLevel {}
2941);
2942
2943extern_conformance!(
2944 unsafe impl NSCopying for SRAudioLevel {}
2945);
2946
2947unsafe impl CopyingHelper for SRAudioLevel {
2948 type Result = Self;
2949}
2950
2951extern_conformance!(
2952 unsafe impl NSObjectProtocol for SRAudioLevel {}
2953);
2954
2955extern_conformance!(
2956 unsafe impl NSSecureCoding for SRAudioLevel {}
2957);
2958
2959impl SRAudioLevel {
2960 extern_methods!(
2961 #[unsafe(method(init))]
2962 #[unsafe(method_family = init)]
2963 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2964
2965 #[unsafe(method(new))]
2966 #[unsafe(method_family = new)]
2967 pub unsafe fn new() -> Retained<Self>;
2968
2969 #[cfg(feature = "objc2-core-media")]
2970 #[unsafe(method(timeRange))]
2973 #[unsafe(method_family = none)]
2974 pub unsafe fn timeRange(&self) -> CMTimeRange;
2975
2976 #[unsafe(method(loudness))]
2978 #[unsafe(method_family = none)]
2979 pub unsafe fn loudness(&self) -> c_double;
2980 );
2981}
2982
2983#[repr(transparent)]
2997#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2998pub struct SRSpeechMetricsSessionFlags(pub NSUInteger);
2999bitflags::bitflags! {
3000 impl SRSpeechMetricsSessionFlags: NSUInteger {
3001 #[doc(alias = "SRSpeechMetricsSessionFlagsDefault")]
3002 const Default = 0;
3003 #[doc(alias = "SRSpeechMetricsSessionFlagsBypassVoiceProcessing")]
3004 const BypassVoiceProcessing = 1<<0;
3005 }
3006}
3007
3008unsafe impl Encode for SRSpeechMetricsSessionFlags {
3009 const ENCODING: Encoding = NSUInteger::ENCODING;
3010}
3011
3012unsafe impl RefEncode for SRSpeechMetricsSessionFlags {
3013 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3014}
3015
3016extern_class!(
3017 #[unsafe(super(NSObject))]
3019 #[derive(Debug, PartialEq, Eq, Hash)]
3020 pub struct SRSpeechMetrics;
3021);
3022
3023unsafe impl Send for SRSpeechMetrics {}
3024
3025unsafe impl Sync for SRSpeechMetrics {}
3026
3027extern_conformance!(
3028 unsafe impl NSCoding for SRSpeechMetrics {}
3029);
3030
3031extern_conformance!(
3032 unsafe impl NSCopying for SRSpeechMetrics {}
3033);
3034
3035unsafe impl CopyingHelper for SRSpeechMetrics {
3036 type Result = Self;
3037}
3038
3039extern_conformance!(
3040 unsafe impl NSObjectProtocol for SRSpeechMetrics {}
3041);
3042
3043extern_conformance!(
3044 unsafe impl NSSecureCoding for SRSpeechMetrics {}
3045);
3046
3047impl SRSpeechMetrics {
3048 extern_methods!(
3049 #[unsafe(method(init))]
3050 #[unsafe(method_family = init)]
3051 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3052
3053 #[unsafe(method(new))]
3054 #[unsafe(method_family = new)]
3055 pub unsafe fn new() -> Retained<Self>;
3056
3057 #[unsafe(method(sessionIdentifier))]
3059 #[unsafe(method_family = none)]
3060 pub unsafe fn sessionIdentifier(&self) -> Retained<NSString>;
3061
3062 #[unsafe(method(sessionFlags))]
3063 #[unsafe(method_family = none)]
3064 pub unsafe fn sessionFlags(&self) -> SRSpeechMetricsSessionFlags;
3065
3066 #[unsafe(method(timestamp))]
3068 #[unsafe(method_family = none)]
3069 pub unsafe fn timestamp(&self) -> Retained<NSDate>;
3070
3071 #[unsafe(method(timeSinceAudioStart))]
3078 #[unsafe(method_family = none)]
3079 pub unsafe fn timeSinceAudioStart(&self) -> NSTimeInterval;
3080
3081 #[unsafe(method(audioLevel))]
3082 #[unsafe(method_family = none)]
3083 pub unsafe fn audioLevel(&self) -> Option<Retained<SRAudioLevel>>;
3084
3085 #[cfg(feature = "objc2-speech")]
3086 #[unsafe(method(speechRecognition))]
3087 #[unsafe(method_family = none)]
3088 pub unsafe fn speechRecognition(&self) -> Option<Retained<SFSpeechRecognitionResult>>;
3089
3090 #[cfg(feature = "objc2-sound-analysis")]
3091 #[unsafe(method(soundClassification))]
3092 #[unsafe(method_family = none)]
3093 pub unsafe fn soundClassification(&self) -> Option<Retained<SNClassificationResult>>;
3094
3095 #[unsafe(method(speechExpression))]
3096 #[unsafe(method_family = none)]
3097 pub unsafe fn speechExpression(&self) -> Option<Retained<SRSpeechExpression>>;
3098 );
3099}
3100
3101#[repr(transparent)]
3104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3105pub struct SRFaceMetricsContext(pub NSUInteger);
3106bitflags::bitflags! {
3107 impl SRFaceMetricsContext: NSUInteger {
3108 #[doc(alias = "SRFaceMetricsContextDeviceUnlock")]
3109 const DeviceUnlock = 1<<0;
3110 #[doc(alias = "SRFaceMetricsContextMessagingAppUsage")]
3111 const MessagingAppUsage = 1<<1;
3112 }
3113}
3114
3115unsafe impl Encode for SRFaceMetricsContext {
3116 const ENCODING: Encoding = NSUInteger::ENCODING;
3117}
3118
3119unsafe impl RefEncode for SRFaceMetricsContext {
3120 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3121}
3122
3123extern_class!(
3124 #[unsafe(super(NSObject))]
3126 #[derive(Debug, PartialEq, Eq, Hash)]
3127 pub struct SRFaceMetricsExpression;
3128);
3129
3130unsafe impl Send for SRFaceMetricsExpression {}
3131
3132unsafe impl Sync for SRFaceMetricsExpression {}
3133
3134extern_conformance!(
3135 unsafe impl NSCoding for SRFaceMetricsExpression {}
3136);
3137
3138extern_conformance!(
3139 unsafe impl NSCopying for SRFaceMetricsExpression {}
3140);
3141
3142unsafe impl CopyingHelper for SRFaceMetricsExpression {
3143 type Result = Self;
3144}
3145
3146extern_conformance!(
3147 unsafe impl NSObjectProtocol for SRFaceMetricsExpression {}
3148);
3149
3150extern_conformance!(
3151 unsafe impl NSSecureCoding for SRFaceMetricsExpression {}
3152);
3153
3154impl SRFaceMetricsExpression {
3155 extern_methods!(
3156 #[unsafe(method(init))]
3157 #[unsafe(method_family = init)]
3158 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3159
3160 #[unsafe(method(new))]
3161 #[unsafe(method_family = new)]
3162 pub unsafe fn new() -> Retained<Self>;
3163
3164 #[unsafe(method(identifier))]
3168 #[unsafe(method_family = none)]
3169 pub unsafe fn identifier(&self) -> Retained<NSString>;
3170
3171 #[unsafe(method(value))]
3173 #[unsafe(method_family = none)]
3174 pub unsafe fn value(&self) -> c_double;
3175 );
3176}
3177
3178extern_class!(
3179 #[unsafe(super(NSObject))]
3181 #[derive(Debug, PartialEq, Eq, Hash)]
3182 pub struct SRFaceMetrics;
3183);
3184
3185unsafe impl Send for SRFaceMetrics {}
3186
3187unsafe impl Sync for SRFaceMetrics {}
3188
3189extern_conformance!(
3190 unsafe impl NSCoding for SRFaceMetrics {}
3191);
3192
3193extern_conformance!(
3194 unsafe impl NSCopying for SRFaceMetrics {}
3195);
3196
3197unsafe impl CopyingHelper for SRFaceMetrics {
3198 type Result = Self;
3199}
3200
3201extern_conformance!(
3202 unsafe impl NSObjectProtocol for SRFaceMetrics {}
3203);
3204
3205extern_conformance!(
3206 unsafe impl NSSecureCoding for SRFaceMetrics {}
3207);
3208
3209impl SRFaceMetrics {
3210 extern_methods!(
3211 #[unsafe(method(init))]
3212 #[unsafe(method_family = init)]
3213 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3214
3215 #[unsafe(method(new))]
3216 #[unsafe(method_family = new)]
3217 pub unsafe fn new() -> Retained<Self>;
3218
3219 #[unsafe(method(version))]
3221 #[unsafe(method_family = none)]
3222 pub unsafe fn version(&self) -> Retained<NSString>;
3223
3224 #[unsafe(method(sessionIdentifier))]
3226 #[unsafe(method_family = none)]
3227 pub unsafe fn sessionIdentifier(&self) -> Retained<NSString>;
3228
3229 #[unsafe(method(context))]
3231 #[unsafe(method_family = none)]
3232 pub unsafe fn context(&self) -> SRFaceMetricsContext;
3233
3234 #[cfg(feature = "objc2-ar-kit")]
3235 #[unsafe(method(faceAnchor))]
3236 #[unsafe(method_family = none)]
3237 pub unsafe fn faceAnchor(&self) -> Retained<ARFaceAnchor>;
3238
3239 #[unsafe(method(wholeFaceExpressions))]
3241 #[unsafe(method_family = none)]
3242 pub unsafe fn wholeFaceExpressions(&self) -> Retained<NSArray<SRFaceMetricsExpression>>;
3243
3244 #[unsafe(method(partialFaceExpressions))]
3246 #[unsafe(method_family = none)]
3247 pub unsafe fn partialFaceExpressions(&self) -> Retained<NSArray<SRFaceMetricsExpression>>;
3248 );
3249}
3250
3251#[repr(transparent)]
3256#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3257pub struct SRElectrocardiogramSessionState(pub NSInteger);
3258impl SRElectrocardiogramSessionState {
3259 #[doc(alias = "SRElectrocardiogramSessionStateBegin")]
3260 pub const Begin: Self = Self(1);
3261 #[doc(alias = "SRElectrocardiogramSessionStateActive")]
3262 pub const Active: Self = Self(2);
3263 #[doc(alias = "SRElectrocardiogramSessionStateEnd")]
3264 pub const End: Self = Self(3);
3265}
3266
3267unsafe impl Encode for SRElectrocardiogramSessionState {
3268 const ENCODING: Encoding = NSInteger::ENCODING;
3269}
3270
3271unsafe impl RefEncode for SRElectrocardiogramSessionState {
3272 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3273}
3274
3275#[repr(transparent)]
3288#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3289pub struct SRElectrocardiogramSessionGuidance(pub NSInteger);
3290impl SRElectrocardiogramSessionGuidance {
3291 #[doc(alias = "SRElectrocardiogramSessionGuidanceGuided")]
3292 pub const Guided: Self = Self(1);
3293 #[doc(alias = "SRElectrocardiogramSessionGuidanceUnguided")]
3294 pub const Unguided: Self = Self(2);
3295}
3296
3297unsafe impl Encode for SRElectrocardiogramSessionGuidance {
3298 const ENCODING: Encoding = NSInteger::ENCODING;
3299}
3300
3301unsafe impl RefEncode for SRElectrocardiogramSessionGuidance {
3302 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3303}
3304
3305extern_class!(
3306 #[unsafe(super(NSObject))]
3308 #[derive(Debug, PartialEq, Eq, Hash)]
3309 pub struct SRElectrocardiogramSession;
3310);
3311
3312unsafe impl Send for SRElectrocardiogramSession {}
3313
3314unsafe impl Sync for SRElectrocardiogramSession {}
3315
3316extern_conformance!(
3317 unsafe impl NSCoding for SRElectrocardiogramSession {}
3318);
3319
3320extern_conformance!(
3321 unsafe impl NSCopying for SRElectrocardiogramSession {}
3322);
3323
3324unsafe impl CopyingHelper for SRElectrocardiogramSession {
3325 type Result = Self;
3326}
3327
3328extern_conformance!(
3329 unsafe impl NSObjectProtocol for SRElectrocardiogramSession {}
3330);
3331
3332extern_conformance!(
3333 unsafe impl NSSecureCoding for SRElectrocardiogramSession {}
3334);
3335
3336impl SRElectrocardiogramSession {
3337 extern_methods!(
3338 #[unsafe(method(init))]
3339 #[unsafe(method_family = init)]
3340 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3341
3342 #[unsafe(method(new))]
3343 #[unsafe(method_family = new)]
3344 pub unsafe fn new() -> Retained<Self>;
3345
3346 #[unsafe(method(state))]
3348 #[unsafe(method_family = none)]
3349 pub unsafe fn state(&self) -> SRElectrocardiogramSessionState;
3350
3351 #[unsafe(method(sessionGuidance))]
3353 #[unsafe(method_family = none)]
3354 pub unsafe fn sessionGuidance(&self) -> SRElectrocardiogramSessionGuidance;
3355
3356 #[unsafe(method(identifier))]
3359 #[unsafe(method_family = none)]
3360 pub unsafe fn identifier(&self) -> Retained<NSString>;
3361 );
3362}
3363
3364#[repr(transparent)]
3374#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3375pub struct SRElectrocardiogramDataFlags(pub NSUInteger);
3376bitflags::bitflags! {
3377 impl SRElectrocardiogramDataFlags: NSUInteger {
3378 #[doc(alias = "SRElectrocardiogramDataFlagsNone")]
3379 const None = 0;
3380#[doc(alias = "SRElectrocardiogramDataFlagsSignalInvalid")]
3382 const SignalInvalid = 1<<0;
3383#[doc(alias = "SRElectrocardiogramDataFlagsCrownTouched")]
3385 const CrownTouched = 1<<1;
3386 }
3387}
3388
3389unsafe impl Encode for SRElectrocardiogramDataFlags {
3390 const ENCODING: Encoding = NSUInteger::ENCODING;
3391}
3392
3393unsafe impl RefEncode for SRElectrocardiogramDataFlags {
3394 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3395}
3396
3397extern_class!(
3398 #[unsafe(super(NSObject))]
3400 #[derive(Debug, PartialEq, Eq, Hash)]
3401 pub struct SRElectrocardiogramData;
3402);
3403
3404unsafe impl Send for SRElectrocardiogramData {}
3405
3406unsafe impl Sync for SRElectrocardiogramData {}
3407
3408extern_conformance!(
3409 unsafe impl NSCoding for SRElectrocardiogramData {}
3410);
3411
3412extern_conformance!(
3413 unsafe impl NSCopying for SRElectrocardiogramData {}
3414);
3415
3416unsafe impl CopyingHelper for SRElectrocardiogramData {
3417 type Result = Self;
3418}
3419
3420extern_conformance!(
3421 unsafe impl NSObjectProtocol for SRElectrocardiogramData {}
3422);
3423
3424extern_conformance!(
3425 unsafe impl NSSecureCoding for SRElectrocardiogramData {}
3426);
3427
3428impl SRElectrocardiogramData {
3429 extern_methods!(
3430 #[unsafe(method(init))]
3431 #[unsafe(method_family = init)]
3432 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3433
3434 #[unsafe(method(new))]
3435 #[unsafe(method_family = new)]
3436 pub unsafe fn new() -> Retained<Self>;
3437
3438 #[unsafe(method(flags))]
3439 #[unsafe(method_family = none)]
3440 pub unsafe fn flags(&self) -> SRElectrocardiogramDataFlags;
3441
3442 #[unsafe(method(value))]
3444 #[unsafe(method_family = none)]
3445 pub unsafe fn value(&self) -> Retained<NSMeasurement<NSUnitElectricPotentialDifference>>;
3446 );
3447}
3448
3449#[repr(transparent)]
3454#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
3455pub struct SRElectrocardiogramLead(pub NSInteger);
3456impl SRElectrocardiogramLead {
3457 #[doc(alias = "SRElectrocardiogramLeadRightArmMinusLeftArm")]
3458 pub const RightArmMinusLeftArm: Self = Self(1);
3459 #[doc(alias = "SRElectrocardiogramLeadLeftArmMinusRightArm")]
3460 pub const LeftArmMinusRightArm: Self = Self(2);
3461}
3462
3463unsafe impl Encode for SRElectrocardiogramLead {
3464 const ENCODING: Encoding = NSInteger::ENCODING;
3465}
3466
3467unsafe impl RefEncode for SRElectrocardiogramLead {
3468 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
3469}
3470
3471extern_class!(
3472 #[unsafe(super(NSObject))]
3474 #[derive(Debug, PartialEq, Eq, Hash)]
3475 pub struct SRElectrocardiogramSample;
3476);
3477
3478unsafe impl Send for SRElectrocardiogramSample {}
3479
3480unsafe impl Sync for SRElectrocardiogramSample {}
3481
3482extern_conformance!(
3483 unsafe impl NSCoding for SRElectrocardiogramSample {}
3484);
3485
3486extern_conformance!(
3487 unsafe impl NSCopying for SRElectrocardiogramSample {}
3488);
3489
3490unsafe impl CopyingHelper for SRElectrocardiogramSample {
3491 type Result = Self;
3492}
3493
3494extern_conformance!(
3495 unsafe impl NSObjectProtocol for SRElectrocardiogramSample {}
3496);
3497
3498extern_conformance!(
3499 unsafe impl NSSecureCoding for SRElectrocardiogramSample {}
3500);
3501
3502impl SRElectrocardiogramSample {
3503 extern_methods!(
3504 #[unsafe(method(init))]
3505 #[unsafe(method_family = init)]
3506 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3507
3508 #[unsafe(method(new))]
3509 #[unsafe(method_family = new)]
3510 pub unsafe fn new() -> Retained<Self>;
3511
3512 #[unsafe(method(date))]
3514 #[unsafe(method_family = none)]
3515 pub unsafe fn date(&self) -> Retained<NSDate>;
3516
3517 #[unsafe(method(frequency))]
3519 #[unsafe(method_family = none)]
3520 pub unsafe fn frequency(&self) -> Retained<NSMeasurement<NSUnitFrequency>>;
3521
3522 #[unsafe(method(session))]
3524 #[unsafe(method_family = none)]
3525 pub unsafe fn session(&self) -> Retained<SRElectrocardiogramSession>;
3526
3527 #[unsafe(method(lead))]
3528 #[unsafe(method_family = none)]
3529 pub unsafe fn lead(&self) -> SRElectrocardiogramLead;
3530
3531 #[unsafe(method(data))]
3532 #[unsafe(method_family = none)]
3533 pub unsafe fn data(&self) -> Retained<NSArray<SRElectrocardiogramData>>;
3534 );
3535}
3536
3537pub type SRPhotoplethysmogramOpticalSampleCondition = NSString;
3540
3541extern "C" {
3542 pub static SRPhotoplethysmogramOpticalSampleConditionSignalSaturation:
3544 &'static SRPhotoplethysmogramOpticalSampleCondition;
3545}
3546
3547extern "C" {
3548 pub static SRPhotoplethysmogramOpticalSampleConditionUnreliableNoise:
3550 &'static SRPhotoplethysmogramOpticalSampleCondition;
3551}
3552
3553extern_class!(
3554 #[unsafe(super(NSObject))]
3556 #[derive(Debug, PartialEq, Eq, Hash)]
3557 pub struct SRPhotoplethysmogramOpticalSample;
3558);
3559
3560unsafe impl Send for SRPhotoplethysmogramOpticalSample {}
3561
3562unsafe impl Sync for SRPhotoplethysmogramOpticalSample {}
3563
3564extern_conformance!(
3565 unsafe impl NSCoding for SRPhotoplethysmogramOpticalSample {}
3566);
3567
3568extern_conformance!(
3569 unsafe impl NSCopying for SRPhotoplethysmogramOpticalSample {}
3570);
3571
3572unsafe impl CopyingHelper for SRPhotoplethysmogramOpticalSample {
3573 type Result = Self;
3574}
3575
3576extern_conformance!(
3577 unsafe impl NSObjectProtocol for SRPhotoplethysmogramOpticalSample {}
3578);
3579
3580extern_conformance!(
3581 unsafe impl NSSecureCoding for SRPhotoplethysmogramOpticalSample {}
3582);
3583
3584impl SRPhotoplethysmogramOpticalSample {
3585 extern_methods!(
3586 #[unsafe(method(init))]
3587 #[unsafe(method_family = init)]
3588 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3589
3590 #[unsafe(method(new))]
3591 #[unsafe(method_family = new)]
3592 pub unsafe fn new() -> Retained<Self>;
3593
3594 #[unsafe(method(emitter))]
3596 #[unsafe(method_family = none)]
3597 pub unsafe fn emitter(&self) -> NSInteger;
3598
3599 #[unsafe(method(activePhotodiodeIndexes))]
3601 #[unsafe(method_family = none)]
3602 pub unsafe fn activePhotodiodeIndexes(&self) -> Retained<NSIndexSet>;
3603
3604 #[unsafe(method(signalIdentifier))]
3613 #[unsafe(method_family = none)]
3614 pub unsafe fn signalIdentifier(&self) -> NSInteger;
3615
3616 #[unsafe(method(nominalWavelength))]
3619 #[unsafe(method_family = none)]
3620 pub unsafe fn nominalWavelength(&self) -> Retained<NSMeasurement<NSUnitLength>>;
3621
3622 #[unsafe(method(effectiveWavelength))]
3624 #[unsafe(method_family = none)]
3625 pub unsafe fn effectiveWavelength(&self) -> Retained<NSMeasurement<NSUnitLength>>;
3626
3627 #[unsafe(method(samplingFrequency))]
3629 #[unsafe(method_family = none)]
3630 pub unsafe fn samplingFrequency(&self) -> Retained<NSMeasurement<NSUnitFrequency>>;
3631
3632 #[unsafe(method(nanosecondsSinceStart))]
3636 #[unsafe(method_family = none)]
3637 pub unsafe fn nanosecondsSinceStart(&self) -> i64;
3638
3639 #[unsafe(method(normalizedReflectance))]
3645 #[unsafe(method_family = none)]
3646 pub unsafe fn normalizedReflectance(&self) -> Option<Retained<NSNumber>>;
3647
3648 #[unsafe(method(whiteNoise))]
3654 #[unsafe(method_family = none)]
3655 pub unsafe fn whiteNoise(&self) -> Option<Retained<NSNumber>>;
3656
3657 #[unsafe(method(pinkNoise))]
3663 #[unsafe(method_family = none)]
3664 pub unsafe fn pinkNoise(&self) -> Option<Retained<NSNumber>>;
3665
3666 #[unsafe(method(backgroundNoise))]
3672 #[unsafe(method_family = none)]
3673 pub unsafe fn backgroundNoise(&self) -> Option<Retained<NSNumber>>;
3674
3675 #[unsafe(method(backgroundNoiseOffset))]
3684 #[unsafe(method_family = none)]
3685 pub unsafe fn backgroundNoiseOffset(&self) -> Option<Retained<NSNumber>>;
3686
3687 #[unsafe(method(conditions))]
3694 #[unsafe(method_family = none)]
3695 pub unsafe fn conditions(
3696 &self,
3697 ) -> Retained<NSArray<SRPhotoplethysmogramOpticalSampleCondition>>;
3698 );
3699}
3700
3701extern_class!(
3702 #[unsafe(super(NSObject))]
3704 #[derive(Debug, PartialEq, Eq, Hash)]
3705 pub struct SRPhotoplethysmogramAccelerometerSample;
3706);
3707
3708unsafe impl Send for SRPhotoplethysmogramAccelerometerSample {}
3709
3710unsafe impl Sync for SRPhotoplethysmogramAccelerometerSample {}
3711
3712extern_conformance!(
3713 unsafe impl NSCoding for SRPhotoplethysmogramAccelerometerSample {}
3714);
3715
3716extern_conformance!(
3717 unsafe impl NSCopying for SRPhotoplethysmogramAccelerometerSample {}
3718);
3719
3720unsafe impl CopyingHelper for SRPhotoplethysmogramAccelerometerSample {
3721 type Result = Self;
3722}
3723
3724extern_conformance!(
3725 unsafe impl NSObjectProtocol for SRPhotoplethysmogramAccelerometerSample {}
3726);
3727
3728extern_conformance!(
3729 unsafe impl NSSecureCoding for SRPhotoplethysmogramAccelerometerSample {}
3730);
3731
3732impl SRPhotoplethysmogramAccelerometerSample {
3733 extern_methods!(
3734 #[unsafe(method(init))]
3735 #[unsafe(method_family = init)]
3736 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3737
3738 #[unsafe(method(new))]
3739 #[unsafe(method_family = new)]
3740 pub unsafe fn new() -> Retained<Self>;
3741
3742 #[unsafe(method(nanosecondsSinceStart))]
3746 #[unsafe(method_family = none)]
3747 pub unsafe fn nanosecondsSinceStart(&self) -> i64;
3748
3749 #[unsafe(method(samplingFrequency))]
3751 #[unsafe(method_family = none)]
3752 pub unsafe fn samplingFrequency(&self) -> Retained<NSMeasurement<NSUnitFrequency>>;
3753
3754 #[unsafe(method(x))]
3756 #[unsafe(method_family = none)]
3757 pub unsafe fn x(&self) -> Retained<NSMeasurement<NSUnitAcceleration>>;
3758
3759 #[unsafe(method(y))]
3761 #[unsafe(method_family = none)]
3762 pub unsafe fn y(&self) -> Retained<NSMeasurement<NSUnitAcceleration>>;
3763
3764 #[unsafe(method(z))]
3766 #[unsafe(method_family = none)]
3767 pub unsafe fn z(&self) -> Retained<NSMeasurement<NSUnitAcceleration>>;
3768 );
3769}
3770
3771pub type SRPhotoplethysmogramSampleUsage = NSString;
3774
3775extern "C" {
3776 pub static SRPhotoplethysmogramSampleUsageForegroundHeartRate:
3783 &'static SRPhotoplethysmogramSampleUsage;
3784}
3785
3786extern "C" {
3787 pub static SRPhotoplethysmogramSampleUsageDeepBreathing:
3795 &'static SRPhotoplethysmogramSampleUsage;
3796}
3797
3798extern "C" {
3799 pub static SRPhotoplethysmogramSampleUsageForegroundBloodOxygen:
3806 &'static SRPhotoplethysmogramSampleUsage;
3807}
3808
3809extern "C" {
3810 pub static SRPhotoplethysmogramSampleUsageBackgroundSystem:
3818 &'static SRPhotoplethysmogramSampleUsage;
3819}
3820
3821extern_class!(
3822 #[unsafe(super(NSObject))]
3824 #[derive(Debug, PartialEq, Eq, Hash)]
3825 pub struct SRPhotoplethysmogramSample;
3826);
3827
3828unsafe impl Send for SRPhotoplethysmogramSample {}
3829
3830unsafe impl Sync for SRPhotoplethysmogramSample {}
3831
3832extern_conformance!(
3833 unsafe impl NSCoding for SRPhotoplethysmogramSample {}
3834);
3835
3836extern_conformance!(
3837 unsafe impl NSCopying for SRPhotoplethysmogramSample {}
3838);
3839
3840unsafe impl CopyingHelper for SRPhotoplethysmogramSample {
3841 type Result = Self;
3842}
3843
3844extern_conformance!(
3845 unsafe impl NSObjectProtocol for SRPhotoplethysmogramSample {}
3846);
3847
3848extern_conformance!(
3849 unsafe impl NSSecureCoding for SRPhotoplethysmogramSample {}
3850);
3851
3852impl SRPhotoplethysmogramSample {
3853 extern_methods!(
3854 #[unsafe(method(init))]
3855 #[unsafe(method_family = init)]
3856 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
3857
3858 #[unsafe(method(new))]
3859 #[unsafe(method_family = new)]
3860 pub unsafe fn new() -> Retained<Self>;
3861
3862 #[unsafe(method(startDate))]
3864 #[unsafe(method_family = none)]
3865 pub unsafe fn startDate(&self) -> Retained<NSDate>;
3866
3867 #[unsafe(method(nanosecondsSinceStart))]
3869 #[unsafe(method_family = none)]
3870 pub unsafe fn nanosecondsSinceStart(&self) -> i64;
3871
3872 #[unsafe(method(usage))]
3877 #[unsafe(method_family = none)]
3878 pub unsafe fn usage(&self) -> Retained<NSArray<SRPhotoplethysmogramSampleUsage>>;
3879
3880 #[unsafe(method(opticalSamples))]
3881 #[unsafe(method_family = none)]
3882 pub unsafe fn opticalSamples(&self)
3883 -> Retained<NSArray<SRPhotoplethysmogramOpticalSample>>;
3884
3885 #[unsafe(method(accelerometerSamples))]
3886 #[unsafe(method_family = none)]
3887 pub unsafe fn accelerometerSamples(
3888 &self,
3889 ) -> Retained<NSArray<SRPhotoplethysmogramAccelerometerSample>>;
3890
3891 #[unsafe(method(temperature))]
3897 #[unsafe(method_family = none)]
3898 pub unsafe fn temperature(&self) -> Option<Retained<NSMeasurement<NSUnitTemperature>>>;
3899 );
3900}