//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// Return a
/// `UIWindowSceneActivationConfiguration`
///
/// Parameter `interaction`: The
/// `UIWindowSceneActivationInteraction`requesting a configuration.
///
/// Parameter `location`: Location in the interaction's view for which a configuration is being requested.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationinteractionconfigurationprovider?language=objc)
#[cfg(all(
    feature = "UIWindowSceneActivationConfiguration",
    feature = "block2",
    feature = "objc2-core-foundation"
))]
pub type UIWindowSceneActivationInteractionConfigurationProvider = *mut block2::DynBlock<
    dyn Fn(
        NonNull<UIWindowSceneActivationInteraction>,
        CGPoint,
    ) -> *mut UIWindowSceneActivationConfiguration,
>;

extern_class!(
    /// An interaction that facilitates activating a
    /// `UIWindowScene`when the user pinches out on the interaction's view.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationinteraction?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIWindowSceneActivationInteraction;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for UIWindowSceneActivationInteraction {}
);

#[cfg(feature = "UIInteraction")]
extern_conformance!(
    unsafe impl UIInteraction for UIWindowSceneActivationInteraction {}
);

impl UIWindowSceneActivationInteraction {
    extern_methods!(
        #[cfg(all(
            feature = "UIWindowSceneActivationConfiguration",
            feature = "block2",
            feature = "objc2-core-foundation"
        ))]
        /// Returns a new
        /// `UIWindowSceneActivationInteraction`
        ///
        /// Parameter `configurationProvider`: Called when the interaction has been triggered. It should return a
        /// `UIWindowSceneActivationConfiguration`whose user activity will be used to request scene activation.
        ///
        /// Parameter `errorHandler`: Called when the activation request fails.
        ///
        /// # Safety
        ///
        /// `configuration_provider` must be a valid pointer.
        #[unsafe(method(initWithConfigurationProvider:errorHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithConfigurationProvider_errorHandler(
            this: Allocated<Self>,
            configuration_provider: UIWindowSceneActivationInteractionConfigurationProvider,
            error_handler: &block2::DynBlock<dyn Fn(NonNull<NSError>)>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
