//! 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesession?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UISceneSession;
);

extern_conformance!(
    unsafe impl NSCoding for UISceneSession {}
);

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

extern_conformance!(
    unsafe impl NSSecureCoding for UISceneSession {}
);

impl UISceneSession {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

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

        #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
        #[unsafe(method(scene))]
        #[unsafe(method_family = none)]
        pub fn scene(&self) -> Option<Retained<UIScene>>;

        #[cfg(feature = "UISceneDefinitions")]
        #[unsafe(method(role))]
        #[unsafe(method_family = none)]
        pub fn role(&self) -> Retained<UISceneSessionRole>;

        #[cfg(feature = "UISceneConfiguration")]
        #[unsafe(method(configuration))]
        #[unsafe(method_family = none)]
        pub fn configuration(&self) -> Retained<UISceneConfiguration>;

        #[unsafe(method(persistentIdentifier))]
        #[unsafe(method_family = none)]
        pub fn persistentIdentifier(&self) -> Retained<NSString>;

        #[unsafe(method(stateRestorationActivity))]
        #[unsafe(method_family = none)]
        pub fn stateRestorationActivity(&self) -> Option<Retained<NSUserActivity>>;

        /// Setter for [`stateRestorationActivity`][Self::stateRestorationActivity].
        #[unsafe(method(setStateRestorationActivity:))]
        #[unsafe(method_family = none)]
        pub fn setStateRestorationActivity(
            &self,
            state_restoration_activity: Option<&NSUserActivity>,
        );

        #[unsafe(method(userInfo))]
        #[unsafe(method_family = none)]
        pub fn userInfo(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        /// Setter for [`userInfo`][Self::userInfo].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `user_info` generic should be of the correct type.
        #[unsafe(method(setUserInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary<NSString, AnyObject>>);
    );
}
