objc2_ui_kit/generated/
UIViewPropertyAnimator.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct UIViewPropertyAnimator;
18);
19
20extern_conformance!(
21 unsafe impl NSCopying for UIViewPropertyAnimator {}
22);
23
24unsafe impl CopyingHelper for UIViewPropertyAnimator {
25 type Result = Self;
26}
27
28extern_conformance!(
29 unsafe impl NSObjectProtocol for UIViewPropertyAnimator {}
30);
31
32#[cfg(feature = "UIViewAnimating")]
33extern_conformance!(
34 unsafe impl UIViewAnimating for UIViewPropertyAnimator {}
35);
36
37#[cfg(feature = "UIViewAnimating")]
38extern_conformance!(
39 unsafe impl UIViewImplicitlyAnimating for UIViewPropertyAnimator {}
40);
41
42impl UIViewPropertyAnimator {
43 extern_methods!(
44 #[cfg(feature = "UITimingCurveProvider")]
45 #[unsafe(method(timingParameters))]
46 #[unsafe(method_family = none)]
47 pub fn timingParameters(
48 &self,
49 ) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>;
50
51 #[unsafe(method(duration))]
52 #[unsafe(method_family = none)]
53 pub fn duration(&self) -> NSTimeInterval;
54
55 #[unsafe(method(delay))]
57 #[unsafe(method_family = none)]
58 pub fn delay(&self) -> NSTimeInterval;
59
60 #[unsafe(method(isUserInteractionEnabled))]
62 #[unsafe(method_family = none)]
63 pub fn isUserInteractionEnabled(&self) -> bool;
64
65 #[unsafe(method(setUserInteractionEnabled:))]
67 #[unsafe(method_family = none)]
68 pub fn setUserInteractionEnabled(&self, user_interaction_enabled: bool);
69
70 #[unsafe(method(isManualHitTestingEnabled))]
72 #[unsafe(method_family = none)]
73 pub fn isManualHitTestingEnabled(&self) -> bool;
74
75 #[unsafe(method(setManualHitTestingEnabled:))]
77 #[unsafe(method_family = none)]
78 pub fn setManualHitTestingEnabled(&self, manual_hit_testing_enabled: bool);
79
80 #[unsafe(method(isInterruptible))]
82 #[unsafe(method_family = none)]
83 pub fn isInterruptible(&self) -> bool;
84
85 #[unsafe(method(setInterruptible:))]
87 #[unsafe(method_family = none)]
88 pub fn setInterruptible(&self, interruptible: bool);
89
90 #[unsafe(method(scrubsLinearly))]
92 #[unsafe(method_family = none)]
93 pub fn scrubsLinearly(&self) -> bool;
94
95 #[unsafe(method(setScrubsLinearly:))]
97 #[unsafe(method_family = none)]
98 pub fn setScrubsLinearly(&self, scrubs_linearly: bool);
99
100 #[unsafe(method(pausesOnCompletion))]
102 #[unsafe(method_family = none)]
103 pub fn pausesOnCompletion(&self) -> bool;
104
105 #[unsafe(method(setPausesOnCompletion:))]
107 #[unsafe(method_family = none)]
108 pub fn setPausesOnCompletion(&self, pauses_on_completion: bool);
109
110 #[unsafe(method(flushUpdates))]
119 #[unsafe(method_family = none)]
120 pub fn flushUpdates(&self) -> bool;
121
122 #[unsafe(method(setFlushUpdates:))]
124 #[unsafe(method_family = none)]
125 pub fn setFlushUpdates(&self, flush_updates: bool);
126
127 #[cfg(feature = "UITimingCurveProvider")]
128 #[unsafe(method(initWithDuration:timingParameters:))]
129 #[unsafe(method_family = init)]
130 pub fn initWithDuration_timingParameters(
131 this: Allocated<Self>,
132 duration: NSTimeInterval,
133 parameters: &ProtocolObject<dyn UITimingCurveProvider>,
134 ) -> Retained<Self>;
135
136 #[cfg(all(feature = "UIView", feature = "block2"))]
137 #[unsafe(method(initWithDuration:curve:animations:))]
139 #[unsafe(method_family = init)]
140 pub fn initWithDuration_curve_animations(
141 this: Allocated<Self>,
142 duration: NSTimeInterval,
143 curve: UIViewAnimationCurve,
144 animations: Option<&block2::DynBlock<dyn Fn()>>,
145 ) -> Retained<Self>;
146
147 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
148 #[unsafe(method(initWithDuration:controlPoint1:controlPoint2:animations:))]
149 #[unsafe(method_family = init)]
150 pub fn initWithDuration_controlPoint1_controlPoint2_animations(
151 this: Allocated<Self>,
152 duration: NSTimeInterval,
153 point1: CGPoint,
154 point2: CGPoint,
155 animations: Option<&block2::DynBlock<dyn Fn()>>,
156 ) -> Retained<Self>;
157
158 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
159 #[unsafe(method(initWithDuration:dampingRatio:animations:))]
160 #[unsafe(method_family = init)]
161 pub fn initWithDuration_dampingRatio_animations(
162 this: Allocated<Self>,
163 duration: NSTimeInterval,
164 ratio: CGFloat,
165 animations: Option<&block2::DynBlock<dyn Fn()>>,
166 ) -> Retained<Self>;
167
168 #[cfg(all(feature = "UIView", feature = "UIViewAnimating", feature = "block2"))]
169 #[unsafe(method(runningPropertyAnimatorWithDuration:delay:options:animations:completion:))]
184 #[unsafe(method_family = none)]
185 pub fn runningPropertyAnimatorWithDuration_delay_options_animations_completion(
186 duration: NSTimeInterval,
187 delay: NSTimeInterval,
188 options: UIViewAnimationOptions,
189 animations: &block2::DynBlock<dyn Fn()>,
190 completion: Option<&block2::DynBlock<dyn Fn(UIViewAnimatingPosition)>>,
191 mtm: MainThreadMarker,
192 ) -> Retained<Self>;
193
194 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
195 #[unsafe(method(addAnimations:delayFactor:))]
200 #[unsafe(method_family = none)]
201 pub fn addAnimations_delayFactor(
202 &self,
203 animation: &block2::DynBlock<dyn Fn()>,
204 delay_factor: CGFloat,
205 );
206
207 #[cfg(feature = "block2")]
208 #[unsafe(method(addAnimations:))]
216 #[unsafe(method_family = none)]
217 pub fn addAnimations(&self, animation: &block2::DynBlock<dyn Fn()>);
218
219 #[cfg(all(feature = "UIViewAnimating", feature = "block2"))]
220 #[unsafe(method(addCompletion:))]
221 #[unsafe(method_family = none)]
222 pub fn addCompletion(&self, completion: &block2::DynBlock<dyn Fn(UIViewAnimatingPosition)>);
223
224 #[cfg(all(feature = "UITimingCurveProvider", feature = "objc2-core-foundation"))]
225 #[unsafe(method(continueAnimationWithTimingParameters:durationFactor:))]
232 #[unsafe(method_family = none)]
233 pub fn continueAnimationWithTimingParameters_durationFactor(
234 &self,
235 parameters: Option<&ProtocolObject<dyn UITimingCurveProvider>>,
236 duration_factor: CGFloat,
237 );
238 );
239}
240
241impl UIViewPropertyAnimator {
243 extern_methods!(
244 #[unsafe(method(init))]
245 #[unsafe(method_family = init)]
246 pub fn init(this: Allocated<Self>) -> Retained<Self>;
247
248 #[unsafe(method(new))]
249 #[unsafe(method_family = new)]
250 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
251 );
252}