1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
/// UIFocusAnimationContext is used to provide UIKit-determined context about animations that are related to a focus update.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uifocusanimationcontext?language=objc)
pub unsafe trait UIFocusAnimationContext: NSObjectProtocol + MainThreadOnly {
/// The duration of the main animations in seconds.
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
fn duration(&self) -> NSTimeInterval;
}
);
extern_class!(
/// UIFocusAnimationCoordinator is used to coordinate disparate animations that are related to a focus update.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uifocusanimationcoordinator?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIFocusAnimationCoordinator;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UIFocusAnimationCoordinator {}
);
impl UIFocusAnimationCoordinator {
extern_methods!(
#[cfg(feature = "block2")]
/// Specifies focus-related animations that should be coordinated with the animations of the focusing or un-focusing view.
///
/// Any animations specified will be run in the same animation context as the main animation. The completion block is invoked after the main animation completes.
/// (Note that this may not be after all the coordinated animations specified by the call complete if the duration is not inherited.)
///
/// It is perfectly legitimate to only specify a completion block.
#[unsafe(method(addCoordinatedAnimations:completion:))]
#[unsafe(method_family = none)]
pub fn addCoordinatedAnimations_completion(
&self,
animations: Option<&block2::DynBlock<dyn Fn()>>,
completion: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
/// Specifies focus-related animations that should be coordinated with the animations of the focusing item.
///
/// Any animations specified will be run in the same animation context as the main animation. The completion block is invoked after the UIKit-defined animations complete.
///
/// It is perfectly legitimate to only specify a completion block.
///
/// A context object is provided in the animation block with details of the UIKit-defined animations being run for the focusing item.
#[unsafe(method(addCoordinatedFocusingAnimations:completion:))]
#[unsafe(method_family = none)]
pub fn addCoordinatedFocusingAnimations_completion(
&self,
animations: Option<
&block2::DynBlock<dyn Fn(NonNull<ProtocolObject<dyn UIFocusAnimationContext>>)>,
>,
completion: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
/// Specifies focus-related animations that should be coordinated with the animations of the un-focusing item.
///
/// Any animations specified will be run in the same animation context as the main animation. The completion block is invoked after the UIKit-defined animations complete.
///
/// It is perfectly legitimate to only specify a completion block.
///
/// A context object is provided in the animation block with details of the UIKit-defined animations being run for the un-focusing item.
#[unsafe(method(addCoordinatedUnfocusingAnimations:completion:))]
#[unsafe(method_family = none)]
pub fn addCoordinatedUnfocusingAnimations_completion(
&self,
animations: Option<
&block2::DynBlock<dyn Fn(NonNull<ProtocolObject<dyn UIFocusAnimationContext>>)>,
>,
completion: Option<&block2::DynBlock<dyn Fn()>>,
);
);
}
/// Methods declared on superclass `NSObject`.
impl UIFocusAnimationCoordinator {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}