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