objc2_core_motion/generated/
CMFallDetectionEvent.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// Fall Detection Event Resolution
10///
11/// See also: CMFallDetectionEvent
12///
13///
14/// This enumeration defines the different states in which a Fall Detection event can be resolved
15///
16/// See also [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmfalldetectioneventuserresolution?language=objc)
17// NS_ENUM
18#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct CMFallDetectionEventUserResolution(pub NSInteger);
21impl CMFallDetectionEventUserResolution {
22    /// the user confirmed the fall alert
23    #[doc(alias = "CMFallDetectionEventUserResolutionConfirmed")]
24    pub const Confirmed: Self = Self(0);
25    /// the user dismissed the fall alert either immediately or after a sequence of haptics and chimes
26    #[doc(alias = "CMFallDetectionEventUserResolutionDismissed")]
27    pub const Dismissed: Self = Self(1);
28    /// the user rejected the fall alert, indicating that they didn't fall
29    #[doc(alias = "CMFallDetectionEventUserResolutionRejected")]
30    pub const Rejected: Self = Self(2);
31    /// the user did not respond to the fall alert and no recovery motion was detected
32    #[doc(alias = "CMFallDetectionEventUserResolutionUnresponsive")]
33    pub const Unresponsive: Self = Self(3);
34}
35
36unsafe impl Encode for CMFallDetectionEventUserResolution {
37    const ENCODING: Encoding = NSInteger::ENCODING;
38}
39
40unsafe impl RefEncode for CMFallDetectionEventUserResolution {
41    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44extern_class!(
45    /// Fall Detection Event
46    ///
47    /// See also: CMFallDetectionEventResolution
48    ///
49    /// This object represents a Fall Detection event and how it was resolved
50    ///
51    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmfalldetectionevent?language=objc)
52    #[unsafe(super(NSObject))]
53    #[derive(Debug, PartialEq, Eq, Hash)]
54    pub struct CMFallDetectionEvent;
55);
56
57extern_conformance!(
58    unsafe impl NSObjectProtocol for CMFallDetectionEvent {}
59);
60
61impl CMFallDetectionEvent {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67        /// date
68        ///
69        /// The time a fall was detected
70        #[unsafe(method(date))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn date(&self) -> Retained<NSDate>;
73
74        /// resolution
75        ///
76        /// enum value representing how the Fall Detection event was resolved
77        ///
78        /// See also: CMFallDetectionEventResolution
79        #[unsafe(method(resolution))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn resolution(&self) -> CMFallDetectionEventUserResolution;
82    );
83}
84
85/// Methods declared on superclass `NSObject`.
86impl CMFallDetectionEvent {
87    extern_methods!(
88        #[unsafe(method(new))]
89        #[unsafe(method_family = new)]
90        pub unsafe fn new() -> Retained<Self>;
91    );
92}