objc2_ui_kit/generated/
UIMotionEffect.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
19 #[thread_kind = MainThreadOnly]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 pub struct UIMotionEffect;
22);
23
24extern_conformance!(
25 unsafe impl NSCoding for UIMotionEffect {}
26);
27
28extern_conformance!(
29 unsafe impl NSCopying for UIMotionEffect {}
30);
31
32unsafe impl CopyingHelper for UIMotionEffect {
33 type Result = Self;
34}
35
36extern_conformance!(
37 unsafe impl NSObjectProtocol for UIMotionEffect {}
38);
39
40impl UIMotionEffect {
41 extern_methods!(
42 #[unsafe(method(init))]
43 #[unsafe(method_family = init)]
44 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
45
46 #[unsafe(method(initWithCoder:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithCoder(
49 this: Allocated<Self>,
50 coder: &NSCoder,
51 ) -> Option<Retained<Self>>;
52
53 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
54 #[unsafe(method(keyPathsAndRelativeValuesForViewerOffset:))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn keyPathsAndRelativeValuesForViewerOffset(
80 &self,
81 viewer_offset: UIOffset,
82 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
83 );
84}
85
86impl UIMotionEffect {
88 extern_methods!(
89 #[unsafe(method(new))]
90 #[unsafe(method_family = new)]
91 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
92 );
93}
94
95#[repr(transparent)]
98#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
99pub struct UIInterpolatingMotionEffectType(pub NSInteger);
100impl UIInterpolatingMotionEffectType {
101 #[doc(alias = "UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis")]
105 pub const TiltAlongHorizontalAxis: Self = Self(0);
106 #[doc(alias = "UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis")]
110 pub const TiltAlongVerticalAxis: Self = Self(1);
111}
112
113unsafe impl Encode for UIInterpolatingMotionEffectType {
114 const ENCODING: Encoding = NSInteger::ENCODING;
115}
116
117unsafe impl RefEncode for UIInterpolatingMotionEffectType {
118 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
119}
120
121extern_class!(
122 #[unsafe(super(UIMotionEffect, NSObject))]
130 #[thread_kind = MainThreadOnly]
131 #[derive(Debug, PartialEq, Eq, Hash)]
132 pub struct UIInterpolatingMotionEffect;
133);
134
135extern_conformance!(
136 unsafe impl NSCoding for UIInterpolatingMotionEffect {}
137);
138
139extern_conformance!(
140 unsafe impl NSCopying for UIInterpolatingMotionEffect {}
141);
142
143unsafe impl CopyingHelper for UIInterpolatingMotionEffect {
144 type Result = Self;
145}
146
147extern_conformance!(
148 unsafe impl NSObjectProtocol for UIInterpolatingMotionEffect {}
149);
150
151impl UIInterpolatingMotionEffect {
152 extern_methods!(
153 #[unsafe(method(initWithKeyPath:type:))]
154 #[unsafe(method_family = init)]
155 pub unsafe fn initWithKeyPath_type(
156 this: Allocated<Self>,
157 key_path: &NSString,
158 r#type: UIInterpolatingMotionEffectType,
159 ) -> Retained<Self>;
160
161 #[unsafe(method(initWithCoder:))]
162 #[unsafe(method_family = init)]
163 pub unsafe fn initWithCoder(
164 this: Allocated<Self>,
165 coder: &NSCoder,
166 ) -> Option<Retained<Self>>;
167
168 #[unsafe(method(keyPath))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn keyPath(&self) -> Retained<NSString>;
171
172 #[unsafe(method(type))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn r#type(&self) -> UIInterpolatingMotionEffectType;
175
176 #[unsafe(method(minimumRelativeValue))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn minimumRelativeValue(&self) -> Option<Retained<AnyObject>>;
179
180 #[unsafe(method(setMinimumRelativeValue:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setMinimumRelativeValue(&self, minimum_relative_value: Option<&AnyObject>);
184
185 #[unsafe(method(maximumRelativeValue))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn maximumRelativeValue(&self) -> Option<Retained<AnyObject>>;
188
189 #[unsafe(method(setMaximumRelativeValue:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn setMaximumRelativeValue(&self, maximum_relative_value: Option<&AnyObject>);
193 );
194}
195
196impl UIInterpolatingMotionEffect {
198 extern_methods!(
199 #[unsafe(method(init))]
200 #[unsafe(method_family = init)]
201 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
202 );
203}
204
205impl UIInterpolatingMotionEffect {
207 extern_methods!(
208 #[unsafe(method(new))]
209 #[unsafe(method_family = new)]
210 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
211 );
212}
213
214extern_class!(
215 #[unsafe(super(UIMotionEffect, NSObject))]
220 #[thread_kind = MainThreadOnly]
221 #[derive(Debug, PartialEq, Eq, Hash)]
222 pub struct UIMotionEffectGroup;
223);
224
225extern_conformance!(
226 unsafe impl NSCoding for UIMotionEffectGroup {}
227);
228
229extern_conformance!(
230 unsafe impl NSCopying for UIMotionEffectGroup {}
231);
232
233unsafe impl CopyingHelper for UIMotionEffectGroup {
234 type Result = Self;
235}
236
237extern_conformance!(
238 unsafe impl NSObjectProtocol for UIMotionEffectGroup {}
239);
240
241impl UIMotionEffectGroup {
242 extern_methods!(
243 #[unsafe(method(motionEffects))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn motionEffects(&self) -> Option<Retained<NSArray<UIMotionEffect>>>;
246
247 #[unsafe(method(setMotionEffects:))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn setMotionEffects(&self, motion_effects: Option<&NSArray<UIMotionEffect>>);
251 );
252}
253
254impl UIMotionEffectGroup {
256 extern_methods!(
257 #[unsafe(method(init))]
258 #[unsafe(method_family = init)]
259 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
260
261 #[unsafe(method(initWithCoder:))]
262 #[unsafe(method_family = init)]
263 pub unsafe fn initWithCoder(
264 this: Allocated<Self>,
265 coder: &NSCoder,
266 ) -> Option<Retained<Self>>;
267 );
268}
269
270impl UIMotionEffectGroup {
272 extern_methods!(
273 #[unsafe(method(new))]
274 #[unsafe(method_family = new)]
275 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
276 );
277}