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 unsafe fn containerView(&self) -> Retained<UIView>;
47
48 #[unsafe(method(isAnimated))]
49 #[unsafe(method_family = none)]
50 unsafe fn isAnimated(&self) -> bool;
51
52 #[unsafe(method(isInteractive))]
53 #[unsafe(method_family = none)]
54 unsafe fn isInteractive(&self) -> bool;
55
56 #[unsafe(method(transitionWasCancelled))]
57 #[unsafe(method_family = none)]
58 unsafe fn transitionWasCancelled(&self) -> bool;
59
60 #[cfg(feature = "UIViewController")]
61 #[unsafe(method(presentationStyle))]
62 #[unsafe(method_family = none)]
63 unsafe fn presentationStyle(&self) -> UIModalPresentationStyle;
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(updateInteractiveTransition:))]
67 #[unsafe(method_family = none)]
68 unsafe fn updateInteractiveTransition(&self, percent_complete: CGFloat);
69
70 #[unsafe(method(finishInteractiveTransition))]
71 #[unsafe(method_family = none)]
72 unsafe fn finishInteractiveTransition(&self);
73
74 #[unsafe(method(cancelInteractiveTransition))]
75 #[unsafe(method_family = none)]
76 unsafe fn cancelInteractiveTransition(&self);
77
78 #[unsafe(method(pauseInteractiveTransition))]
79 #[unsafe(method_family = none)]
80 unsafe fn pauseInteractiveTransition(&self);
81
82 #[unsafe(method(completeTransition:))]
83 #[unsafe(method_family = none)]
84 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe fn transitionDuration(
140 &self,
141 transition_context: Option<&ProtocolObject<dyn UIViewControllerContextTransitioning>>,
142 ) -> NSTimeInterval;
143
144 #[unsafe(method(animateTransition:))]
145 #[unsafe(method_family = none)]
146 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe fn completionSpeed(&self) -> CGFloat;
188
189 #[cfg(feature = "UIView")]
190 #[optional]
191 #[unsafe(method(completionCurve))]
192 #[unsafe(method_family = none)]
193 unsafe fn completionCurve(&self) -> UIViewAnimationCurve;
194
195 #[optional]
201 #[unsafe(method(wantsInteractiveStart))]
202 #[unsafe(method_family = none)]
203 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe fn duration(&self) -> CGFloat;
289
290 #[cfg(feature = "objc2-core-foundation")]
291 #[unsafe(method(percentComplete))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn percentComplete(&self) -> CGFloat;
295
296 #[cfg(feature = "objc2-core-foundation")]
297 #[unsafe(method(completionSpeed))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn completionSpeed(&self) -> CGFloat;
306
307 #[cfg(feature = "objc2-core-foundation")]
308 #[unsafe(method(setCompletionSpeed:))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn setCompletionSpeed(&self, completion_speed: CGFloat);
312
313 #[cfg(feature = "UIView")]
314 #[unsafe(method(completionCurve))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn completionCurve(&self) -> UIViewAnimationCurve;
320
321 #[cfg(feature = "UIView")]
322 #[unsafe(method(setCompletionCurve:))]
324 #[unsafe(method_family = none)]
325 pub unsafe fn setCompletionCurve(&self, completion_curve: UIViewAnimationCurve);
326
327 #[cfg(feature = "UITimingCurveProvider")]
328 #[unsafe(method(timingCurve))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn timingCurve(
334 &self,
335 ) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>;
336
337 #[cfg(feature = "UITimingCurveProvider")]
338 #[unsafe(method(setTimingCurve:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setTimingCurve(
342 &self,
343 timing_curve: Option<&ProtocolObject<dyn UITimingCurveProvider>>,
344 );
345
346 #[unsafe(method(wantsInteractiveStart))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn wantsInteractiveStart(&self) -> bool;
352
353 #[unsafe(method(setWantsInteractiveStart:))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn setWantsInteractiveStart(&self, wants_interactive_start: bool);
357
358 #[unsafe(method(pauseInteractiveTransition))]
362 #[unsafe(method_family = none)]
363 pub unsafe fn pauseInteractiveTransition(&self);
364
365 #[cfg(feature = "objc2-core-foundation")]
366 #[unsafe(method(updateInteractiveTransition:))]
367 #[unsafe(method_family = none)]
368 pub unsafe fn updateInteractiveTransition(&self, percent_complete: CGFloat);
369
370 #[unsafe(method(cancelInteractiveTransition))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn cancelInteractiveTransition(&self);
373
374 #[unsafe(method(finishInteractiveTransition))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn finishInteractiveTransition(&self);
377 );
378}
379
380impl UIPercentDrivenInteractiveTransition {
382 extern_methods!(
383 #[unsafe(method(init))]
384 #[unsafe(method_family = init)]
385 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
386
387 #[unsafe(method(new))]
388 #[unsafe(method_family = new)]
389 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
390 );
391}