objc2_ui_kit/generated/
UIViewControllerTransitioning.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 "C" {
13 #[cfg(feature = "UIViewControllerTransitionCoordinator")]
15 pub static UITransitionContextFromViewControllerKey:
16 &'static UITransitionContextViewControllerKey;
17}
18
19extern "C" {
20 #[cfg(feature = "UIViewControllerTransitionCoordinator")]
22 pub static UITransitionContextToViewControllerKey:
23 &'static UITransitionContextViewControllerKey;
24}
25
26extern "C" {
27 #[cfg(feature = "UIViewControllerTransitionCoordinator")]
29 pub static UITransitionContextFromViewKey: &'static UITransitionContextViewKey;
30}
31
32extern "C" {
33 #[cfg(feature = "UIViewControllerTransitionCoordinator")]
35 pub static UITransitionContextToViewKey: &'static UITransitionContextViewKey;
36}
37
38extern_protocol!(
39 pub unsafe trait UIViewControllerContextTransitioning:
41 NSObjectProtocol + MainThreadOnly
42 {
43 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
44 #[unsafe(method(containerView))]
45 #[unsafe(method_family = none)]
46 fn containerView(&self) -> Retained<UIView>;
47
48 #[unsafe(method(isAnimated))]
49 #[unsafe(method_family = none)]
50 fn isAnimated(&self) -> bool;
51
52 #[unsafe(method(isInteractive))]
53 #[unsafe(method_family = none)]
54 fn isInteractive(&self) -> bool;
55
56 #[unsafe(method(transitionWasCancelled))]
57 #[unsafe(method_family = none)]
58 fn transitionWasCancelled(&self) -> bool;
59
60 #[cfg(feature = "UIViewController")]
61 #[unsafe(method(presentationStyle))]
62 #[unsafe(method_family = none)]
63 fn presentationStyle(&self) -> UIModalPresentationStyle;
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(updateInteractiveTransition:))]
67 #[unsafe(method_family = none)]
68 fn updateInteractiveTransition(&self, percent_complete: CGFloat);
69
70 #[unsafe(method(finishInteractiveTransition))]
71 #[unsafe(method_family = none)]
72 fn finishInteractiveTransition(&self);
73
74 #[unsafe(method(cancelInteractiveTransition))]
75 #[unsafe(method_family = none)]
76 fn cancelInteractiveTransition(&self);
77
78 #[unsafe(method(pauseInteractiveTransition))]
79 #[unsafe(method_family = none)]
80 fn pauseInteractiveTransition(&self);
81
82 #[unsafe(method(completeTransition:))]
83 #[unsafe(method_family = none)]
84 fn completeTransition(&self, did_complete: bool);
85
86 #[cfg(all(
87 feature = "UIResponder",
88 feature = "UIViewController",
89 feature = "UIViewControllerTransitionCoordinator"
90 ))]
91 #[unsafe(method(viewControllerForKey:))]
92 #[unsafe(method_family = none)]
93 fn viewControllerForKey(
94 &self,
95 key: &UITransitionContextViewControllerKey,
96 ) -> Option<Retained<UIViewController>>;
97
98 #[cfg(all(
99 feature = "UIResponder",
100 feature = "UIView",
101 feature = "UIViewControllerTransitionCoordinator"
102 ))]
103 #[unsafe(method(viewForKey:))]
104 #[unsafe(method_family = none)]
105 fn viewForKey(&self, key: &UITransitionContextViewKey) -> Option<Retained<UIView>>;
106
107 #[cfg(feature = "objc2-core-foundation")]
108 #[unsafe(method(targetTransform))]
109 #[unsafe(method_family = none)]
110 fn targetTransform(&self) -> CGAffineTransform;
111
112 #[cfg(all(
113 feature = "UIResponder",
114 feature = "UIViewController",
115 feature = "objc2-core-foundation"
116 ))]
117 #[unsafe(method(initialFrameForViewController:))]
118 #[unsafe(method_family = none)]
119 fn initialFrameForViewController(&self, vc: &UIViewController) -> CGRect;
120
121 #[cfg(all(
122 feature = "UIResponder",
123 feature = "UIViewController",
124 feature = "objc2-core-foundation"
125 ))]
126 #[unsafe(method(finalFrameForViewController:))]
127 #[unsafe(method_family = none)]
128 fn finalFrameForViewController(&self, vc: &UIViewController) -> CGRect;
129 }
130);
131
132extern_protocol!(
133 pub unsafe trait UIViewControllerAnimatedTransitioning:
135 NSObjectProtocol + MainThreadOnly
136 {
137 #[unsafe(method(transitionDuration:))]
138 #[unsafe(method_family = none)]
139 fn transitionDuration(
140 &self,
141 transition_context: Option<&ProtocolObject<dyn UIViewControllerContextTransitioning>>,
142 ) -> NSTimeInterval;
143
144 #[unsafe(method(animateTransition:))]
145 #[unsafe(method_family = none)]
146 fn animateTransition(
147 &self,
148 transition_context: &ProtocolObject<dyn UIViewControllerContextTransitioning>,
149 );
150
151 #[cfg(feature = "UIViewAnimating")]
152 #[optional]
157 #[unsafe(method(interruptibleAnimatorForTransition:))]
158 #[unsafe(method_family = none)]
159 fn interruptibleAnimatorForTransition(
160 &self,
161 transition_context: &ProtocolObject<dyn UIViewControllerContextTransitioning>,
162 ) -> Retained<ProtocolObject<dyn UIViewImplicitlyAnimating>>;
163
164 #[optional]
165 #[unsafe(method(animationEnded:))]
166 #[unsafe(method_family = none)]
167 fn animationEnded(&self, transition_completed: bool);
168 }
169);
170
171extern_protocol!(
172 pub unsafe trait UIViewControllerInteractiveTransitioning:
174 NSObjectProtocol + MainThreadOnly
175 {
176 #[unsafe(method(startInteractiveTransition:))]
177 #[unsafe(method_family = none)]
178 fn startInteractiveTransition(
179 &self,
180 transition_context: &ProtocolObject<dyn UIViewControllerContextTransitioning>,
181 );
182
183 #[cfg(feature = "objc2-core-foundation")]
184 #[optional]
185 #[unsafe(method(completionSpeed))]
186 #[unsafe(method_family = none)]
187 fn completionSpeed(&self) -> CGFloat;
188
189 #[cfg(feature = "UIView")]
190 #[optional]
191 #[unsafe(method(completionCurve))]
192 #[unsafe(method_family = none)]
193 fn completionCurve(&self) -> UIViewAnimationCurve;
194
195 #[optional]
201 #[unsafe(method(wantsInteractiveStart))]
202 #[unsafe(method_family = none)]
203 fn wantsInteractiveStart(&self) -> bool;
204 }
205);
206
207extern_protocol!(
208 pub unsafe trait UIViewControllerTransitioningDelegate:
210 NSObjectProtocol + MainThreadOnly
211 {
212 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
213 #[optional]
214 #[unsafe(method(animationControllerForPresentedController:presentingController:sourceController:))]
215 #[unsafe(method_family = none)]
216 fn animationControllerForPresentedController_presentingController_sourceController(
217 &self,
218 presented: &UIViewController,
219 presenting: &UIViewController,
220 source: &UIViewController,
221 ) -> Option<Retained<ProtocolObject<dyn UIViewControllerAnimatedTransitioning>>>;
222
223 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
224 #[optional]
225 #[unsafe(method(animationControllerForDismissedController:))]
226 #[unsafe(method_family = none)]
227 fn animationControllerForDismissedController(
228 &self,
229 dismissed: &UIViewController,
230 ) -> Option<Retained<ProtocolObject<dyn UIViewControllerAnimatedTransitioning>>>;
231
232 #[optional]
233 #[unsafe(method(interactionControllerForPresentation:))]
234 #[unsafe(method_family = none)]
235 fn interactionControllerForPresentation(
236 &self,
237 animator: &ProtocolObject<dyn UIViewControllerAnimatedTransitioning>,
238 ) -> Option<Retained<ProtocolObject<dyn UIViewControllerInteractiveTransitioning>>>;
239
240 #[optional]
241 #[unsafe(method(interactionControllerForDismissal:))]
242 #[unsafe(method_family = none)]
243 fn interactionControllerForDismissal(
244 &self,
245 animator: &ProtocolObject<dyn UIViewControllerAnimatedTransitioning>,
246 ) -> Option<Retained<ProtocolObject<dyn UIViewControllerInteractiveTransitioning>>>;
247
248 #[cfg(all(
249 feature = "UIPresentationController",
250 feature = "UIResponder",
251 feature = "UIViewController"
252 ))]
253 #[optional]
254 #[unsafe(method(presentationControllerForPresentedViewController:presentingViewController:sourceViewController:))]
255 #[unsafe(method_family = none)]
256 fn presentationControllerForPresentedViewController_presentingViewController_sourceViewController(
257 &self,
258 presented: &UIViewController,
259 presenting: Option<&UIViewController>,
260 source: &UIViewController,
261 ) -> Option<Retained<UIPresentationController>>;
262 }
263);
264
265extern_class!(
266 #[unsafe(super(NSObject))]
268 #[thread_kind = MainThreadOnly]
269 #[derive(Debug, PartialEq, Eq, Hash)]
270 pub struct UIPercentDrivenInteractiveTransition;
271);
272
273extern_conformance!(
274 unsafe impl NSObjectProtocol for UIPercentDrivenInteractiveTransition {}
275);
276
277extern_conformance!(
278 unsafe impl UIViewControllerInteractiveTransitioning for UIPercentDrivenInteractiveTransition {}
279);
280
281impl UIPercentDrivenInteractiveTransition {
282 extern_methods!(
283 #[cfg(feature = "objc2-core-foundation")]
284 #[unsafe(method(duration))]
287 #[unsafe(method_family = none)]
288 pub fn duration(&self) -> CGFloat;
289
290 #[cfg(feature = "objc2-core-foundation")]
291 #[unsafe(method(percentComplete))]
293 #[unsafe(method_family = none)]
294 pub fn percentComplete(&self) -> CGFloat;
295
296 #[cfg(feature = "objc2-core-foundation")]
297 #[unsafe(method(completionSpeed))]
304 #[unsafe(method_family = none)]
305 pub fn completionSpeed(&self) -> CGFloat;
306
307 #[cfg(feature = "objc2-core-foundation")]
308 #[unsafe(method(setCompletionSpeed:))]
310 #[unsafe(method_family = none)]
311 pub fn setCompletionSpeed(&self, completion_speed: CGFloat);
312
313 #[cfg(feature = "UIView")]
314 #[unsafe(method(completionCurve))]
318 #[unsafe(method_family = none)]
319 pub fn completionCurve(&self) -> UIViewAnimationCurve;
320
321 #[cfg(feature = "UIView")]
322 #[unsafe(method(setCompletionCurve:))]
324 #[unsafe(method_family = none)]
325 pub fn setCompletionCurve(&self, completion_curve: UIViewAnimationCurve);
326
327 #[cfg(feature = "UITimingCurveProvider")]
328 #[unsafe(method(timingCurve))]
332 #[unsafe(method_family = none)]
333 pub fn timingCurve(&self) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>;
334
335 #[cfg(feature = "UITimingCurveProvider")]
336 #[unsafe(method(setTimingCurve:))]
338 #[unsafe(method_family = none)]
339 pub fn setTimingCurve(
340 &self,
341 timing_curve: Option<&ProtocolObject<dyn UITimingCurveProvider>>,
342 );
343
344 #[unsafe(method(wantsInteractiveStart))]
348 #[unsafe(method_family = none)]
349 pub fn wantsInteractiveStart(&self) -> bool;
350
351 #[unsafe(method(setWantsInteractiveStart:))]
353 #[unsafe(method_family = none)]
354 pub fn setWantsInteractiveStart(&self, wants_interactive_start: bool);
355
356 #[unsafe(method(pauseInteractiveTransition))]
360 #[unsafe(method_family = none)]
361 pub fn pauseInteractiveTransition(&self);
362
363 #[cfg(feature = "objc2-core-foundation")]
364 #[unsafe(method(updateInteractiveTransition:))]
365 #[unsafe(method_family = none)]
366 pub fn updateInteractiveTransition(&self, percent_complete: CGFloat);
367
368 #[unsafe(method(cancelInteractiveTransition))]
369 #[unsafe(method_family = none)]
370 pub fn cancelInteractiveTransition(&self);
371
372 #[unsafe(method(finishInteractiveTransition))]
373 #[unsafe(method_family = none)]
374 pub fn finishInteractiveTransition(&self);
375 );
376}
377
378impl UIPercentDrivenInteractiveTransition {
380 extern_methods!(
381 #[unsafe(method(init))]
382 #[unsafe(method_family = init)]
383 pub fn init(this: Allocated<Self>) -> Retained<Self>;
384
385 #[unsafe(method(new))]
386 #[unsafe(method_family = new)]
387 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
388 );
389}