objc2_ui_kit/generated/
UIFocusAnimationCoordinator.rs

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