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
20unsafe impl NSCopying for UIViewPropertyAnimator {}
21
22unsafe impl CopyingHelper for UIViewPropertyAnimator {
23 type Result = Self;
24}
25
26unsafe impl NSObjectProtocol for UIViewPropertyAnimator {}
27
28#[cfg(feature = "UIViewAnimating")]
29unsafe impl UIViewAnimating for UIViewPropertyAnimator {}
30
31#[cfg(feature = "UIViewAnimating")]
32unsafe impl UIViewImplicitlyAnimating for UIViewPropertyAnimator {}
33
34impl UIViewPropertyAnimator {
35 extern_methods!(
36 #[cfg(feature = "UITimingCurveProvider")]
37 #[unsafe(method(timingParameters))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn timingParameters(
40 &self,
41 ) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>;
42
43 #[unsafe(method(duration))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn duration(&self) -> NSTimeInterval;
46
47 #[unsafe(method(delay))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn delay(&self) -> NSTimeInterval;
51
52 #[unsafe(method(isUserInteractionEnabled))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn isUserInteractionEnabled(&self) -> bool;
56
57 #[unsafe(method(setUserInteractionEnabled:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setUserInteractionEnabled(&self, user_interaction_enabled: bool);
61
62 #[unsafe(method(isManualHitTestingEnabled))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn isManualHitTestingEnabled(&self) -> bool;
66
67 #[unsafe(method(setManualHitTestingEnabled:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn setManualHitTestingEnabled(&self, manual_hit_testing_enabled: bool);
71
72 #[unsafe(method(isInterruptible))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn isInterruptible(&self) -> bool;
76
77 #[unsafe(method(setInterruptible:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setInterruptible(&self, interruptible: bool);
81
82 #[unsafe(method(scrubsLinearly))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn scrubsLinearly(&self) -> bool;
86
87 #[unsafe(method(setScrubsLinearly:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setScrubsLinearly(&self, scrubs_linearly: bool);
91
92 #[unsafe(method(pausesOnCompletion))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn pausesOnCompletion(&self) -> bool;
96
97 #[unsafe(method(setPausesOnCompletion:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setPausesOnCompletion(&self, pauses_on_completion: bool);
101
102 #[cfg(feature = "UITimingCurveProvider")]
103 #[unsafe(method(initWithDuration:timingParameters:))]
104 #[unsafe(method_family = init)]
105 pub unsafe fn initWithDuration_timingParameters(
106 this: Allocated<Self>,
107 duration: NSTimeInterval,
108 parameters: &ProtocolObject<dyn UITimingCurveProvider>,
109 ) -> Retained<Self>;
110
111 #[cfg(all(feature = "UIView", feature = "block2"))]
112 #[unsafe(method(initWithDuration:curve:animations:))]
114 #[unsafe(method_family = init)]
115 pub unsafe fn initWithDuration_curve_animations(
116 this: Allocated<Self>,
117 duration: NSTimeInterval,
118 curve: UIViewAnimationCurve,
119 animations: Option<&block2::Block<dyn Fn()>>,
120 ) -> Retained<Self>;
121
122 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
123 #[unsafe(method(initWithDuration:controlPoint1:controlPoint2:animations:))]
124 #[unsafe(method_family = init)]
125 pub unsafe fn initWithDuration_controlPoint1_controlPoint2_animations(
126 this: Allocated<Self>,
127 duration: NSTimeInterval,
128 point1: CGPoint,
129 point2: CGPoint,
130 animations: Option<&block2::Block<dyn Fn()>>,
131 ) -> Retained<Self>;
132
133 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
134 #[unsafe(method(initWithDuration:dampingRatio:animations:))]
135 #[unsafe(method_family = init)]
136 pub unsafe fn initWithDuration_dampingRatio_animations(
137 this: Allocated<Self>,
138 duration: NSTimeInterval,
139 ratio: CGFloat,
140 animations: Option<&block2::Block<dyn Fn()>>,
141 ) -> Retained<Self>;
142
143 #[cfg(all(feature = "UIView", feature = "UIViewAnimating", feature = "block2"))]
144 #[unsafe(method(runningPropertyAnimatorWithDuration:delay:options:animations:completion:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn runningPropertyAnimatorWithDuration_delay_options_animations_completion(
161 duration: NSTimeInterval,
162 delay: NSTimeInterval,
163 options: UIViewAnimationOptions,
164 animations: &block2::Block<dyn Fn()>,
165 completion: Option<&block2::Block<dyn Fn(UIViewAnimatingPosition)>>,
166 mtm: MainThreadMarker,
167 ) -> Retained<Self>;
168
169 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
170 #[unsafe(method(addAnimations:delayFactor:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn addAnimations_delayFactor(
177 &self,
178 animation: &block2::Block<dyn Fn()>,
179 delay_factor: CGFloat,
180 );
181
182 #[cfg(feature = "block2")]
183 #[unsafe(method(addAnimations:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn addAnimations(&self, animation: &block2::Block<dyn Fn()>);
193
194 #[cfg(all(feature = "UIViewAnimating", feature = "block2"))]
195 #[unsafe(method(addCompletion:))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn addCompletion(
198 &self,
199 completion: &block2::Block<dyn Fn(UIViewAnimatingPosition)>,
200 );
201
202 #[cfg(all(feature = "UITimingCurveProvider", feature = "objc2-core-foundation"))]
203 #[unsafe(method(continueAnimationWithTimingParameters:durationFactor:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn continueAnimationWithTimingParameters_durationFactor(
212 &self,
213 parameters: Option<&ProtocolObject<dyn UITimingCurveProvider>>,
214 duration_factor: CGFloat,
215 );
216 );
217}
218
219impl UIViewPropertyAnimator {
221 extern_methods!(
222 #[unsafe(method(init))]
223 #[unsafe(method_family = init)]
224 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
225
226 #[unsafe(method(new))]
227 #[unsafe(method_family = new)]
228 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
229 );
230}