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 unsafe fn timingParameters(
48 &self,
49 ) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>;
50
51 #[unsafe(method(duration))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn duration(&self) -> NSTimeInterval;
54
55 #[unsafe(method(delay))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn delay(&self) -> NSTimeInterval;
59
60 #[unsafe(method(isUserInteractionEnabled))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn isUserInteractionEnabled(&self) -> bool;
64
65 #[unsafe(method(setUserInteractionEnabled:))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn setUserInteractionEnabled(&self, user_interaction_enabled: bool);
69
70 #[unsafe(method(isManualHitTestingEnabled))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn isManualHitTestingEnabled(&self) -> bool;
74
75 #[unsafe(method(setManualHitTestingEnabled:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn setManualHitTestingEnabled(&self, manual_hit_testing_enabled: bool);
79
80 #[unsafe(method(isInterruptible))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn isInterruptible(&self) -> bool;
84
85 #[unsafe(method(setInterruptible:))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn setInterruptible(&self, interruptible: bool);
89
90 #[unsafe(method(scrubsLinearly))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn scrubsLinearly(&self) -> bool;
94
95 #[unsafe(method(setScrubsLinearly:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn setScrubsLinearly(&self, scrubs_linearly: bool);
99
100 #[unsafe(method(pausesOnCompletion))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn pausesOnCompletion(&self) -> bool;
104
105 #[unsafe(method(setPausesOnCompletion:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn setPausesOnCompletion(&self, pauses_on_completion: bool);
109
110 #[cfg(feature = "UITimingCurveProvider")]
111 #[unsafe(method(initWithDuration:timingParameters:))]
112 #[unsafe(method_family = init)]
113 pub unsafe fn initWithDuration_timingParameters(
114 this: Allocated<Self>,
115 duration: NSTimeInterval,
116 parameters: &ProtocolObject<dyn UITimingCurveProvider>,
117 ) -> Retained<Self>;
118
119 #[cfg(all(feature = "UIView", feature = "block2"))]
120 #[unsafe(method(initWithDuration:curve:animations:))]
122 #[unsafe(method_family = init)]
123 pub unsafe fn initWithDuration_curve_animations(
124 this: Allocated<Self>,
125 duration: NSTimeInterval,
126 curve: UIViewAnimationCurve,
127 animations: Option<&block2::DynBlock<dyn Fn()>>,
128 ) -> Retained<Self>;
129
130 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
131 #[unsafe(method(initWithDuration:controlPoint1:controlPoint2:animations:))]
132 #[unsafe(method_family = init)]
133 pub unsafe fn initWithDuration_controlPoint1_controlPoint2_animations(
134 this: Allocated<Self>,
135 duration: NSTimeInterval,
136 point1: CGPoint,
137 point2: CGPoint,
138 animations: Option<&block2::DynBlock<dyn Fn()>>,
139 ) -> Retained<Self>;
140
141 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
142 #[unsafe(method(initWithDuration:dampingRatio:animations:))]
143 #[unsafe(method_family = init)]
144 pub unsafe fn initWithDuration_dampingRatio_animations(
145 this: Allocated<Self>,
146 duration: NSTimeInterval,
147 ratio: CGFloat,
148 animations: Option<&block2::DynBlock<dyn Fn()>>,
149 ) -> Retained<Self>;
150
151 #[cfg(all(feature = "UIView", feature = "UIViewAnimating", feature = "block2"))]
152 #[unsafe(method(runningPropertyAnimatorWithDuration:delay:options:animations:completion:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn runningPropertyAnimatorWithDuration_delay_options_animations_completion(
169 duration: NSTimeInterval,
170 delay: NSTimeInterval,
171 options: UIViewAnimationOptions,
172 animations: &block2::DynBlock<dyn Fn()>,
173 completion: Option<&block2::DynBlock<dyn Fn(UIViewAnimatingPosition)>>,
174 mtm: MainThreadMarker,
175 ) -> Retained<Self>;
176
177 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
178 #[unsafe(method(addAnimations:delayFactor:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn addAnimations_delayFactor(
185 &self,
186 animation: &block2::DynBlock<dyn Fn()>,
187 delay_factor: CGFloat,
188 );
189
190 #[cfg(feature = "block2")]
191 #[unsafe(method(addAnimations:))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn addAnimations(&self, animation: &block2::DynBlock<dyn Fn()>);
201
202 #[cfg(all(feature = "UIViewAnimating", feature = "block2"))]
203 #[unsafe(method(addCompletion:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn addCompletion(
206 &self,
207 completion: &block2::DynBlock<dyn Fn(UIViewAnimatingPosition)>,
208 );
209
210 #[cfg(all(feature = "UITimingCurveProvider", feature = "objc2-core-foundation"))]
211 #[unsafe(method(continueAnimationWithTimingParameters:durationFactor:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn continueAnimationWithTimingParameters_durationFactor(
220 &self,
221 parameters: Option<&ProtocolObject<dyn UITimingCurveProvider>>,
222 duration_factor: CGFloat,
223 );
224 );
225}
226
227impl UIViewPropertyAnimator {
229 extern_methods!(
230 #[unsafe(method(init))]
231 #[unsafe(method_family = init)]
232 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
233
234 #[unsafe(method(new))]
235 #[unsafe(method_family = new)]
236 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
237 );
238}