objc2_ui_kit/generated/
UIAccelerometer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10pub type UIAccelerationValue = c_double;
12
13extern_class!(
14 #[unsafe(super(NSObject))]
16 #[thread_kind = MainThreadOnly]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
19 pub struct UIAcceleration;
20);
21
22extern_conformance!(
23 unsafe impl NSObjectProtocol for UIAcceleration {}
24);
25
26impl UIAcceleration {
27 extern_methods!(
28 #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
29 #[unsafe(method(timestamp))]
30 #[unsafe(method_family = none)]
31 pub unsafe fn timestamp(&self) -> NSTimeInterval;
32
33 #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
34 #[unsafe(method(x))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn x(&self) -> UIAccelerationValue;
37
38 #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
39 #[unsafe(method(y))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn y(&self) -> UIAccelerationValue;
42
43 #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
44 #[unsafe(method(z))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn z(&self) -> UIAccelerationValue;
47 );
48}
49
50impl UIAcceleration {
52 extern_methods!(
53 #[unsafe(method(init))]
54 #[unsafe(method_family = init)]
55 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
56
57 #[unsafe(method(new))]
58 #[unsafe(method_family = new)]
59 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
60 );
61}
62
63extern_class!(
64 #[unsafe(super(NSObject))]
66 #[thread_kind = MainThreadOnly]
67 #[derive(Debug, PartialEq, Eq, Hash)]
68 #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
69 pub struct UIAccelerometer;
70);
71
72extern_conformance!(
73 unsafe impl NSObjectProtocol for UIAccelerometer {}
74);
75
76impl UIAccelerometer {
77 extern_methods!(
78 #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
79 #[unsafe(method(sharedAccelerometer))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn sharedAccelerometer(mtm: MainThreadMarker) -> Retained<UIAccelerometer>;
82
83 #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
84 #[unsafe(method(updateInterval))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn updateInterval(&self) -> NSTimeInterval;
87
88 #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
90 #[unsafe(method(setUpdateInterval:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn setUpdateInterval(&self, update_interval: NSTimeInterval);
93
94 #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
95 #[unsafe(method(delegate))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn delegate(
98 &self,
99 ) -> Option<Retained<ProtocolObject<dyn UIAccelerometerDelegate>>>;
100
101 #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
104 #[unsafe(method(setDelegate:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setDelegate(
107 &self,
108 delegate: Option<&ProtocolObject<dyn UIAccelerometerDelegate>>,
109 );
110 );
111}
112
113impl UIAccelerometer {
115 extern_methods!(
116 #[unsafe(method(init))]
117 #[unsafe(method_family = init)]
118 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120 #[unsafe(method(new))]
121 #[unsafe(method_family = new)]
122 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
123 );
124}
125
126extern_protocol!(
127 #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
129 pub unsafe trait UIAccelerometerDelegate: NSObjectProtocol + MainThreadOnly {
130 #[deprecated]
131 #[optional]
132 #[unsafe(method(accelerometer:didAccelerate:))]
133 #[unsafe(method_family = none)]
134 unsafe fn accelerometer_didAccelerate(
135 &self,
136 accelerometer: &UIAccelerometer,
137 acceleration: &UIAcceleration,
138 );
139 }
140);