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 fn init(this: Allocated<Self>) -> Retained<Self>;
45
46 #[unsafe(method(initWithCoder:))]
50 #[unsafe(method_family = init)]
51 pub unsafe fn initWithCoder(
52 this: Allocated<Self>,
53 coder: &NSCoder,
54 ) -> Option<Retained<Self>>;
55
56 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
57 #[unsafe(method(keyPathsAndRelativeValuesForViewerOffset:))]
81 #[unsafe(method_family = none)]
82 pub fn keyPathsAndRelativeValuesForViewerOffset(
83 &self,
84 viewer_offset: UIOffset,
85 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
86 );
87}
88
89impl UIMotionEffect {
91 extern_methods!(
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
95 );
96}
97
98#[repr(transparent)]
101#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
102pub struct UIInterpolatingMotionEffectType(pub NSInteger);
103impl UIInterpolatingMotionEffectType {
104 #[doc(alias = "UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis")]
108 pub const TiltAlongHorizontalAxis: Self = Self(0);
109 #[doc(alias = "UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis")]
113 pub const TiltAlongVerticalAxis: Self = Self(1);
114}
115
116unsafe impl Encode for UIInterpolatingMotionEffectType {
117 const ENCODING: Encoding = NSInteger::ENCODING;
118}
119
120unsafe impl RefEncode for UIInterpolatingMotionEffectType {
121 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
122}
123
124extern_class!(
125 #[unsafe(super(UIMotionEffect, NSObject))]
133 #[thread_kind = MainThreadOnly]
134 #[derive(Debug, PartialEq, Eq, Hash)]
135 pub struct UIInterpolatingMotionEffect;
136);
137
138extern_conformance!(
139 unsafe impl NSCoding for UIInterpolatingMotionEffect {}
140);
141
142extern_conformance!(
143 unsafe impl NSCopying for UIInterpolatingMotionEffect {}
144);
145
146unsafe impl CopyingHelper for UIInterpolatingMotionEffect {
147 type Result = Self;
148}
149
150extern_conformance!(
151 unsafe impl NSObjectProtocol for UIInterpolatingMotionEffect {}
152);
153
154impl UIInterpolatingMotionEffect {
155 extern_methods!(
156 #[unsafe(method(initWithKeyPath:type:))]
157 #[unsafe(method_family = init)]
158 pub fn initWithKeyPath_type(
159 this: Allocated<Self>,
160 key_path: &NSString,
161 r#type: UIInterpolatingMotionEffectType,
162 ) -> Retained<Self>;
163
164 #[unsafe(method(initWithCoder:))]
168 #[unsafe(method_family = init)]
169 pub unsafe fn initWithCoder(
170 this: Allocated<Self>,
171 coder: &NSCoder,
172 ) -> Option<Retained<Self>>;
173
174 #[unsafe(method(keyPath))]
175 #[unsafe(method_family = none)]
176 pub fn keyPath(&self) -> Retained<NSString>;
177
178 #[unsafe(method(type))]
179 #[unsafe(method_family = none)]
180 pub fn r#type(&self) -> UIInterpolatingMotionEffectType;
181
182 #[unsafe(method(minimumRelativeValue))]
183 #[unsafe(method_family = none)]
184 pub fn minimumRelativeValue(&self) -> Option<Retained<AnyObject>>;
185
186 #[unsafe(method(setMinimumRelativeValue:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn setMinimumRelativeValue(&self, minimum_relative_value: Option<&AnyObject>);
194
195 #[unsafe(method(maximumRelativeValue))]
196 #[unsafe(method_family = none)]
197 pub fn maximumRelativeValue(&self) -> Option<Retained<AnyObject>>;
198
199 #[unsafe(method(setMaximumRelativeValue:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn setMaximumRelativeValue(&self, maximum_relative_value: Option<&AnyObject>);
207 );
208}
209
210impl UIInterpolatingMotionEffect {
212 extern_methods!(
213 #[unsafe(method(init))]
214 #[unsafe(method_family = init)]
215 pub fn init(this: Allocated<Self>) -> Retained<Self>;
216 );
217}
218
219impl UIInterpolatingMotionEffect {
221 extern_methods!(
222 #[unsafe(method(new))]
223 #[unsafe(method_family = new)]
224 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
225 );
226}
227
228extern_class!(
229 #[unsafe(super(UIMotionEffect, NSObject))]
234 #[thread_kind = MainThreadOnly]
235 #[derive(Debug, PartialEq, Eq, Hash)]
236 pub struct UIMotionEffectGroup;
237);
238
239extern_conformance!(
240 unsafe impl NSCoding for UIMotionEffectGroup {}
241);
242
243extern_conformance!(
244 unsafe impl NSCopying for UIMotionEffectGroup {}
245);
246
247unsafe impl CopyingHelper for UIMotionEffectGroup {
248 type Result = Self;
249}
250
251extern_conformance!(
252 unsafe impl NSObjectProtocol for UIMotionEffectGroup {}
253);
254
255impl UIMotionEffectGroup {
256 extern_methods!(
257 #[unsafe(method(motionEffects))]
258 #[unsafe(method_family = none)]
259 pub fn motionEffects(&self) -> Option<Retained<NSArray<UIMotionEffect>>>;
260
261 #[unsafe(method(setMotionEffects:))]
265 #[unsafe(method_family = none)]
266 pub fn setMotionEffects(&self, motion_effects: Option<&NSArray<UIMotionEffect>>);
267 );
268}
269
270impl UIMotionEffectGroup {
272 extern_methods!(
273 #[unsafe(method(init))]
274 #[unsafe(method_family = init)]
275 pub fn init(this: Allocated<Self>) -> Retained<Self>;
276
277 #[unsafe(method(initWithCoder:))]
281 #[unsafe(method_family = init)]
282 pub unsafe fn initWithCoder(
283 this: Allocated<Self>,
284 coder: &NSCoder,
285 ) -> Option<Retained<Self>>;
286 );
287}
288
289impl UIMotionEffectGroup {
291 extern_methods!(
292 #[unsafe(method(new))]
293 #[unsafe(method_family = new)]
294 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
295 );
296}