objc2_core_motion/generated/
CMOdometer.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::*;
5#[cfg(feature = "objc2-core-location")]
6use objc2_core_location::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmodometerorigindevice?language=objc)
12// NS_ENUM
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct CMOdometerOriginDevice(pub NSInteger);
16impl CMOdometerOriginDevice {
17    #[doc(alias = "CMOdometerOriginDeviceUnknown")]
18    pub const Unknown: Self = Self(0);
19    #[doc(alias = "CMOdometerOriginDeviceLocal")]
20    pub const Local: Self = Self(1);
21    #[doc(alias = "CMOdometerOriginDeviceRemote")]
22    pub const Remote: Self = Self(2);
23}
24
25unsafe impl Encode for CMOdometerOriginDevice {
26    const ENCODING: Encoding = NSInteger::ENCODING;
27}
28
29unsafe impl RefEncode for CMOdometerOriginDevice {
30    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
31}
32
33extern_class!(
34    /// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmodometerdata?language=objc)
35    #[unsafe(super(NSObject))]
36    #[derive(Debug, PartialEq, Eq, Hash)]
37    pub struct CMOdometerData;
38);
39
40unsafe impl Send for CMOdometerData {}
41
42unsafe impl Sync for CMOdometerData {}
43
44extern_conformance!(
45    unsafe impl NSCoding for CMOdometerData {}
46);
47
48extern_conformance!(
49    unsafe impl NSCopying for CMOdometerData {}
50);
51
52unsafe impl CopyingHelper for CMOdometerData {
53    type Result = Self;
54}
55
56extern_conformance!(
57    unsafe impl NSObjectProtocol for CMOdometerData {}
58);
59
60extern_conformance!(
61    unsafe impl NSSecureCoding for CMOdometerData {}
62);
63
64impl CMOdometerData {
65    extern_methods!(
66        /// This property is not atomic.
67        ///
68        /// # Safety
69        ///
70        /// This might not be thread-safe.
71        #[unsafe(method(startDate))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn startDate(&self) -> Retained<NSDate>;
74
75        /// This property is not atomic.
76        ///
77        /// # Safety
78        ///
79        /// This might not be thread-safe.
80        #[unsafe(method(endDate))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn endDate(&self) -> Retained<NSDate>;
83
84        #[cfg(feature = "objc2-core-location")]
85        /// This property is not atomic.
86        ///
87        /// # Safety
88        ///
89        /// This might not be thread-safe.
90        #[unsafe(method(deltaDistance))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn deltaDistance(&self) -> CLLocationDistance;
93
94        #[cfg(feature = "objc2-core-location")]
95        /// This property is not atomic.
96        ///
97        /// # Safety
98        ///
99        /// This might not be thread-safe.
100        #[unsafe(method(deltaDistanceAccuracy))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn deltaDistanceAccuracy(&self) -> CLLocationAccuracy;
103
104        #[cfg(feature = "objc2-core-location")]
105        /// This property is not atomic.
106        ///
107        /// # Safety
108        ///
109        /// This might not be thread-safe.
110        #[unsafe(method(speed))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn speed(&self) -> CLLocationSpeed;
113
114        #[cfg(feature = "objc2-core-location")]
115        /// This property is not atomic.
116        ///
117        /// # Safety
118        ///
119        /// This might not be thread-safe.
120        #[unsafe(method(speedAccuracy))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn speedAccuracy(&self) -> CLLocationSpeedAccuracy;
123
124        /// This property is not atomic.
125        ///
126        /// # Safety
127        ///
128        /// This might not be thread-safe.
129        #[unsafe(method(gpsDate))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn gpsDate(&self) -> Retained<NSDate>;
132
133        #[cfg(feature = "objc2-core-location")]
134        /// This property is not atomic.
135        ///
136        /// # Safety
137        ///
138        /// This might not be thread-safe.
139        #[unsafe(method(deltaAltitude))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn deltaAltitude(&self) -> CLLocationDistance;
142
143        #[cfg(feature = "objc2-core-location")]
144        /// This property is not atomic.
145        ///
146        /// # Safety
147        ///
148        /// This might not be thread-safe.
149        #[unsafe(method(verticalAccuracy))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn verticalAccuracy(&self) -> CLLocationAccuracy;
152
153        /// This property is not atomic.
154        ///
155        /// # Safety
156        ///
157        /// This might not be thread-safe.
158        #[unsafe(method(originDevice))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn originDevice(&self) -> CMOdometerOriginDevice;
161
162        /// This property is not atomic.
163        ///
164        /// # Safety
165        ///
166        /// This might not be thread-safe.
167        #[unsafe(method(slope))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn slope(&self) -> Option<Retained<NSNumber>>;
170
171        /// This property is not atomic.
172        ///
173        /// # Safety
174        ///
175        /// This might not be thread-safe.
176        #[unsafe(method(maxAbsSlope))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn maxAbsSlope(&self) -> Option<Retained<NSNumber>>;
179    );
180}
181
182/// Methods declared on superclass `NSObject`.
183impl CMOdometerData {
184    extern_methods!(
185        #[unsafe(method(init))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189        #[unsafe(method(new))]
190        #[unsafe(method_family = new)]
191        pub unsafe fn new() -> Retained<Self>;
192    );
193}