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