objc2_ui_kit/generated/
UIZoomTransitionOptions.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uizoomtransitionoptions?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct UIZoomTransitionOptions;
17);
18
19unsafe impl NSCopying for UIZoomTransitionOptions {}
20
21unsafe impl CopyingHelper for UIZoomTransitionOptions {
22    type Result = Self;
23}
24
25unsafe impl NSObjectProtocol for UIZoomTransitionOptions {}
26
27impl UIZoomTransitionOptions {
28    extern_methods!(
29        #[cfg(feature = "block2")]
30        /// Called when an interactive dismissal of this transition begins.
31        /// Return value indicates whether the interaction should begin for the given context.
32        #[unsafe(method(interactiveDismissShouldBegin))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn interactiveDismissShouldBegin(
35            &self,
36        ) -> *mut block2::Block<dyn Fn(NonNull<UIZoomTransitionInteractionContext>) -> Bool>;
37
38        #[cfg(feature = "block2")]
39        /// Setter for [`interactiveDismissShouldBegin`][Self::interactiveDismissShouldBegin].
40        #[unsafe(method(setInteractiveDismissShouldBegin:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn setInteractiveDismissShouldBegin(
43            &self,
44            interactive_dismiss_should_begin: Option<
45                &block2::Block<dyn Fn(NonNull<UIZoomTransitionInteractionContext>) -> Bool>,
46            >,
47        );
48
49        #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
50        /// Return a frame in the zoomed view controller's view to which to align the source view.
51        /// Return `CGRectNull` to indicate no preference.
52        #[unsafe(method(alignmentRectProvider))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn alignmentRectProvider(
55            &self,
56        ) -> *mut block2::Block<dyn Fn(NonNull<UIZoomTransitionAlignmentRectContext>) -> CGRect>;
57
58        #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
59        /// Setter for [`alignmentRectProvider`][Self::alignmentRectProvider].
60        #[unsafe(method(setAlignmentRectProvider:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn setAlignmentRectProvider(
63            &self,
64            alignment_rect_provider: Option<
65                &block2::Block<dyn Fn(NonNull<UIZoomTransitionAlignmentRectContext>) -> CGRect>,
66            >,
67        );
68
69        #[cfg(feature = "UIColor")]
70        /// Dimming color to apply to the content behind the zoomed in view. Set to nil to use the default.
71        #[unsafe(method(dimmingColor))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn dimmingColor(&self) -> Option<Retained<UIColor>>;
74
75        #[cfg(feature = "UIColor")]
76        /// Setter for [`dimmingColor`][Self::dimmingColor].
77        #[unsafe(method(setDimmingColor:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setDimmingColor(&self, dimming_color: Option<&UIColor>);
80
81        #[cfg(all(feature = "UIBlurEffect", feature = "UIVisualEffect"))]
82        /// Visual effect to apply to the content behind the zoomed in view. Defaults to nil.
83        #[unsafe(method(dimmingVisualEffect))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn dimmingVisualEffect(
86            &self,
87            mtm: MainThreadMarker,
88        ) -> Option<Retained<UIBlurEffect>>;
89
90        #[cfg(all(feature = "UIBlurEffect", feature = "UIVisualEffect"))]
91        /// Setter for [`dimmingVisualEffect`][Self::dimmingVisualEffect].
92        #[unsafe(method(setDimmingVisualEffect:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setDimmingVisualEffect(&self, dimming_visual_effect: Option<&UIBlurEffect>);
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl UIZoomTransitionOptions {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}
110
111extern_class!(
112    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uizoomtransitioninteractioncontext?language=objc)
113    #[unsafe(super(NSObject))]
114    #[derive(Debug, PartialEq, Eq, Hash)]
115    pub struct UIZoomTransitionInteractionContext;
116);
117
118unsafe impl NSObjectProtocol for UIZoomTransitionInteractionContext {}
119
120impl UIZoomTransitionInteractionContext {
121    extern_methods!(
122        #[cfg(feature = "objc2-core-foundation")]
123        /// Location of the interaction in the displayed view controller's view's coordinate space.
124        #[unsafe(method(location))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn location(&self) -> CGPoint;
127
128        #[cfg(feature = "objc2-core-foundation")]
129        /// The interaction's velocity.
130        #[unsafe(method(velocity))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn velocity(&self) -> CGVector;
133
134        /// Whether the interaction would begin under the current conditions by default.
135        #[unsafe(method(willBegin))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn willBegin(&self) -> bool;
138    );
139}
140
141/// Methods declared on superclass `NSObject`.
142impl UIZoomTransitionInteractionContext {
143    extern_methods!(
144        #[unsafe(method(init))]
145        #[unsafe(method_family = init)]
146        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
147
148        #[unsafe(method(new))]
149        #[unsafe(method_family = new)]
150        pub unsafe fn new() -> Retained<Self>;
151    );
152}
153
154extern_class!(
155    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uizoomtransitionalignmentrectcontext?language=objc)
156    #[unsafe(super(NSObject))]
157    #[derive(Debug, PartialEq, Eq, Hash)]
158    pub struct UIZoomTransitionAlignmentRectContext;
159);
160
161unsafe impl NSObjectProtocol for UIZoomTransitionAlignmentRectContext {}
162
163impl UIZoomTransitionAlignmentRectContext {
164    extern_methods!(
165        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
166        /// The transition's source view.
167        #[unsafe(method(sourceView))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn sourceView(&self, mtm: MainThreadMarker) -> Retained<UIView>;
170
171        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
172        /// The zoomed view controller.
173        #[unsafe(method(zoomedViewController))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn zoomedViewController(
176            &self,
177            mtm: MainThreadMarker,
178        ) -> Retained<UIViewController>;
179    );
180}
181
182/// Methods declared on superclass `NSObject`.
183impl UIZoomTransitionAlignmentRectContext {
184    extern_methods!(
185        #[unsafe(method(init))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189        #[unsafe(method(new))]
190        #[unsafe(method_family = new)]
191        pub unsafe fn new() -> Retained<Self>;
192    );
193}