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
24unsafe impl NSCoding for UIMotionEffect {}
25
26unsafe impl NSCopying for UIMotionEffect {}
27
28unsafe impl CopyingHelper for UIMotionEffect {
29 type Result = Self;
30}
31
32unsafe impl NSObjectProtocol for UIMotionEffect {}
33
34impl UIMotionEffect {
35 extern_methods!(
36 #[unsafe(method(init))]
37 #[unsafe(method_family = init)]
38 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40 #[unsafe(method(initWithCoder:))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn initWithCoder(
43 this: Allocated<Self>,
44 coder: &NSCoder,
45 ) -> Option<Retained<Self>>;
46
47 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
48 #[unsafe(method(keyPathsAndRelativeValuesForViewerOffset:))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn keyPathsAndRelativeValuesForViewerOffset(
74 &self,
75 viewer_offset: UIOffset,
76 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
77 );
78}
79
80impl UIMotionEffect {
82 extern_methods!(
83 #[unsafe(method(new))]
84 #[unsafe(method_family = new)]
85 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
86 );
87}
88
89#[repr(transparent)]
92#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
93pub struct UIInterpolatingMotionEffectType(pub NSInteger);
94impl UIInterpolatingMotionEffectType {
95 #[doc(alias = "UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis")]
99 pub const TiltAlongHorizontalAxis: Self = Self(0);
100 #[doc(alias = "UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis")]
104 pub const TiltAlongVerticalAxis: Self = Self(1);
105}
106
107unsafe impl Encode for UIInterpolatingMotionEffectType {
108 const ENCODING: Encoding = NSInteger::ENCODING;
109}
110
111unsafe impl RefEncode for UIInterpolatingMotionEffectType {
112 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
113}
114
115extern_class!(
116 #[unsafe(super(UIMotionEffect, NSObject))]
124 #[thread_kind = MainThreadOnly]
125 #[derive(Debug, PartialEq, Eq, Hash)]
126 pub struct UIInterpolatingMotionEffect;
127);
128
129unsafe impl NSCoding for UIInterpolatingMotionEffect {}
130
131unsafe impl NSCopying for UIInterpolatingMotionEffect {}
132
133unsafe impl CopyingHelper for UIInterpolatingMotionEffect {
134 type Result = Self;
135}
136
137unsafe impl NSObjectProtocol for UIInterpolatingMotionEffect {}
138
139impl UIInterpolatingMotionEffect {
140 extern_methods!(
141 #[unsafe(method(initWithKeyPath:type:))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn initWithKeyPath_type(
144 this: Allocated<Self>,
145 key_path: &NSString,
146 r#type: UIInterpolatingMotionEffectType,
147 ) -> Retained<Self>;
148
149 #[unsafe(method(initWithCoder:))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn initWithCoder(
152 this: Allocated<Self>,
153 coder: &NSCoder,
154 ) -> Option<Retained<Self>>;
155
156 #[unsafe(method(keyPath))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn keyPath(&self) -> Retained<NSString>;
159
160 #[unsafe(method(type))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn r#type(&self) -> UIInterpolatingMotionEffectType;
163
164 #[unsafe(method(minimumRelativeValue))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn minimumRelativeValue(&self) -> Option<Retained<AnyObject>>;
167
168 #[unsafe(method(setMinimumRelativeValue:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn setMinimumRelativeValue(&self, minimum_relative_value: Option<&AnyObject>);
172
173 #[unsafe(method(maximumRelativeValue))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn maximumRelativeValue(&self) -> Option<Retained<AnyObject>>;
176
177 #[unsafe(method(setMaximumRelativeValue:))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn setMaximumRelativeValue(&self, maximum_relative_value: Option<&AnyObject>);
181 );
182}
183
184impl UIInterpolatingMotionEffect {
186 extern_methods!(
187 #[unsafe(method(init))]
188 #[unsafe(method_family = init)]
189 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
190 );
191}
192
193impl UIInterpolatingMotionEffect {
195 extern_methods!(
196 #[unsafe(method(new))]
197 #[unsafe(method_family = new)]
198 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
199 );
200}
201
202extern_class!(
203 #[unsafe(super(UIMotionEffect, NSObject))]
208 #[thread_kind = MainThreadOnly]
209 #[derive(Debug, PartialEq, Eq, Hash)]
210 pub struct UIMotionEffectGroup;
211);
212
213unsafe impl NSCoding for UIMotionEffectGroup {}
214
215unsafe impl NSCopying for UIMotionEffectGroup {}
216
217unsafe impl CopyingHelper for UIMotionEffectGroup {
218 type Result = Self;
219}
220
221unsafe impl NSObjectProtocol for UIMotionEffectGroup {}
222
223impl UIMotionEffectGroup {
224 extern_methods!(
225 #[unsafe(method(motionEffects))]
226 #[unsafe(method_family = none)]
227 pub unsafe fn motionEffects(&self) -> Option<Retained<NSArray<UIMotionEffect>>>;
228
229 #[unsafe(method(setMotionEffects:))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn setMotionEffects(&self, motion_effects: Option<&NSArray<UIMotionEffect>>);
233 );
234}
235
236impl UIMotionEffectGroup {
238 extern_methods!(
239 #[unsafe(method(init))]
240 #[unsafe(method_family = init)]
241 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
242
243 #[unsafe(method(initWithCoder:))]
244 #[unsafe(method_family = init)]
245 pub unsafe fn initWithCoder(
246 this: Allocated<Self>,
247 coder: &NSCoder,
248 ) -> Option<Retained<Self>>;
249 );
250}
251
252impl UIMotionEffectGroup {
254 extern_methods!(
255 #[unsafe(method(new))]
256 #[unsafe(method_family = new)]
257 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
258 );
259}