use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIResponder")]
pub struct UIScene;
);
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl NSObjectProtocol for UIScene {}
);
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIScene {}
);
#[cfg(feature = "UIResponder")]
impl UIScene {
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 = "UISceneOptions", feature = "UISceneSession"))]
#[unsafe(method(initWithSession:connectionOptions:))]
#[unsafe(method_family = init)]
pub fn initWithSession_connectionOptions(
this: Allocated<Self>,
session: &UISceneSession,
connection_options: &UISceneConnectionOptions,
) -> Retained<Self>;
#[cfg(feature = "UISceneSession")]
#[unsafe(method(session))]
#[unsafe(method_family = none)]
pub fn session(&self) -> Retained<UISceneSession>;
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UISceneDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UISceneDelegate>>);
#[cfg(feature = "UISceneDefinitions")]
#[unsafe(method(activationState))]
#[unsafe(method_family = none)]
pub fn activationState(&self) -> UISceneActivationState;
#[cfg(all(feature = "UISceneOptions", feature = "block2"))]
#[unsafe(method(openURL:options:completionHandler:))]
#[unsafe(method_family = none)]
pub fn openURL_options_completionHandler(
&self,
url: &NSURL,
options: Option<&UISceneOpenExternalURLOptions>,
completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
);
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub fn title(&self) -> Retained<NSString>;
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub fn setTitle(&self, title: Option<&NSString>);
#[unsafe(method(subtitle))]
#[unsafe(method_family = none)]
pub fn subtitle(&self) -> Retained<NSString>;
#[unsafe(method(setSubtitle:))]
#[unsafe(method_family = none)]
pub fn setSubtitle(&self, subtitle: &NSString);
#[cfg(feature = "UISceneActivationConditions")]
#[unsafe(method(activationConditions))]
#[unsafe(method_family = none)]
pub fn activationConditions(&self) -> Retained<UISceneActivationConditions>;
#[cfg(feature = "UISceneActivationConditions")]
#[unsafe(method(setActivationConditions:))]
#[unsafe(method_family = none)]
pub fn setActivationConditions(&self, activation_conditions: &UISceneActivationConditions);
#[cfg(feature = "UISceneDestructionCondition")]
#[unsafe(method(destructionConditions))]
#[unsafe(method_family = none)]
pub fn destructionConditions(&self) -> Retained<NSSet<UISceneDestructionCondition>>;
#[cfg(feature = "UISceneDestructionCondition")]
#[unsafe(method(setDestructionConditions:))]
#[unsafe(method_family = none)]
pub fn setDestructionConditions(
&self,
destruction_conditions: &NSSet<UISceneDestructionCondition>,
);
);
}
extern_protocol!(
pub unsafe trait UISceneDelegate: NSObjectProtocol + MainThreadOnly {
#[cfg(all(
feature = "UIResponder",
feature = "UISceneOptions",
feature = "UISceneSession"
))]
#[optional]
#[unsafe(method(scene:willConnectToSession:options:))]
#[unsafe(method_family = none)]
fn scene_willConnectToSession_options(
&self,
scene: &UIScene,
session: &UISceneSession,
connection_options: &UISceneConnectionOptions,
);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(sceneDidDisconnect:))]
#[unsafe(method_family = none)]
fn sceneDidDisconnect(&self, scene: &UIScene);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(sceneDidBecomeActive:))]
#[unsafe(method_family = none)]
fn sceneDidBecomeActive(&self, scene: &UIScene);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(sceneWillResignActive:))]
#[unsafe(method_family = none)]
fn sceneWillResignActive(&self, scene: &UIScene);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(sceneWillEnterForeground:))]
#[unsafe(method_family = none)]
fn sceneWillEnterForeground(&self, scene: &UIScene);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(sceneDidEnterBackground:))]
#[unsafe(method_family = none)]
fn sceneDidEnterBackground(&self, scene: &UIScene);
#[cfg(all(feature = "UIOpenURLContext", feature = "UIResponder"))]
#[optional]
#[unsafe(method(scene:openURLContexts:))]
#[unsafe(method_family = none)]
fn scene_openURLContexts(&self, scene: &UIScene, url_contexts: &NSSet<UIOpenURLContext>);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(stateRestorationActivityForScene:))]
#[unsafe(method_family = none)]
fn stateRestorationActivityForScene(
&self,
scene: &UIScene,
) -> Option<Retained<NSUserActivity>>;
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(scene:restoreInteractionStateWithUserActivity:))]
#[unsafe(method_family = none)]
fn scene_restoreInteractionStateWithUserActivity(
&self,
scene: &UIScene,
state_restoration_activity: &NSUserActivity,
);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(scene:willContinueUserActivityWithType:))]
#[unsafe(method_family = none)]
fn scene_willContinueUserActivityWithType(
&self,
scene: &UIScene,
user_activity_type: &NSString,
);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(scene:continueUserActivity:))]
#[unsafe(method_family = none)]
fn scene_continueUserActivity(&self, scene: &UIScene, user_activity: &NSUserActivity);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(scene:didFailToContinueUserActivityWithType:error:))]
#[unsafe(method_family = none)]
fn scene_didFailToContinueUserActivityWithType_error(
&self,
scene: &UIScene,
user_activity_type: &NSString,
error: &NSError,
);
#[cfg(feature = "UIResponder")]
#[optional]
#[unsafe(method(scene:didUpdateUserActivity:))]
#[unsafe(method_family = none)]
fn scene_didUpdateUserActivity(&self, scene: &UIScene, user_activity: &NSUserActivity);
}
);
extern "C" {
pub static UISceneWillConnectNotification: &'static NSNotificationName;
}
extern "C" {
pub static UISceneDidDisconnectNotification: &'static NSNotificationName;
}
extern "C" {
pub static UISceneDidActivateNotification: &'static NSNotificationName;
}
extern "C" {
pub static UISceneWillDeactivateNotification: &'static NSNotificationName;
}
extern "C" {
pub static UISceneWillEnterForegroundNotification: &'static NSNotificationName;
}
extern "C" {
pub static UISceneDidEnterBackgroundNotification: &'static NSNotificationName;
}
extern "C" {
#[cfg(feature = "UISceneDefinitions")]
pub static UISceneSessionRoleImmersiveSpaceApplication: &'static UISceneSessionRole;
}