objc2_ui_kit/generated/
UIWindowSceneActivationInteraction.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
12/// Return a
13/// `UIWindowSceneActivationConfiguration`
14///
15/// Parameter `interaction`: The
16/// `UIWindowSceneActivationInteraction`requesting a configuration.
17///
18/// Parameter `location`: Location in the interaction's view for which a configuration is being requested.
19///
20/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationinteractionconfigurationprovider?language=objc)
21#[cfg(all(
22    feature = "UIWindowSceneActivationConfiguration",
23    feature = "block2",
24    feature = "objc2-core-foundation"
25))]
26pub type UIWindowSceneActivationInteractionConfigurationProvider = *mut block2::DynBlock<
27    dyn Fn(
28        NonNull<UIWindowSceneActivationInteraction>,
29        CGPoint,
30    ) -> *mut UIWindowSceneActivationConfiguration,
31>;
32
33extern_class!(
34    /// An interaction that facilitates activating a
35    /// `UIWindowScene`when the user pinches out on the interaction's view.
36    ///
37    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationinteraction?language=objc)
38    #[unsafe(super(NSObject))]
39    #[thread_kind = MainThreadOnly]
40    #[derive(Debug, PartialEq, Eq, Hash)]
41    pub struct UIWindowSceneActivationInteraction;
42);
43
44extern_conformance!(
45    unsafe impl NSObjectProtocol for UIWindowSceneActivationInteraction {}
46);
47
48#[cfg(feature = "UIInteraction")]
49extern_conformance!(
50    unsafe impl UIInteraction for UIWindowSceneActivationInteraction {}
51);
52
53impl UIWindowSceneActivationInteraction {
54    extern_methods!(
55        #[cfg(all(
56            feature = "UIWindowSceneActivationConfiguration",
57            feature = "block2",
58            feature = "objc2-core-foundation"
59        ))]
60        /// Returns a new
61        /// `UIWindowSceneActivationInteraction`
62        ///
63        /// Parameter `configurationProvider`: Called when the interaction has been triggered. It should return a
64        /// `UIWindowSceneActivationConfiguration`whose user activity will be used to request scene activation.
65        ///
66        /// Parameter `errorHandler`: Called when the activation request fails.
67        ///
68        /// # Safety
69        ///
70        /// `configuration_provider` must be a valid pointer.
71        #[unsafe(method(initWithConfigurationProvider:errorHandler:))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn initWithConfigurationProvider_errorHandler(
74            this: Allocated<Self>,
75            configuration_provider: UIWindowSceneActivationInteractionConfigurationProvider,
76            error_handler: &block2::DynBlock<dyn Fn(NonNull<NSError>)>,
77        ) -> Retained<Self>;
78
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[unsafe(method(new))]
84        #[unsafe(method_family = new)]
85        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
86    );
87}