objc2_ui_kit/generated/
UIScene.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscene?language=objc)
12    #[unsafe(super(UIResponder, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UIResponder")]
16    pub struct UIScene;
17);
18
19#[cfg(feature = "UIResponder")]
20extern_conformance!(
21    unsafe impl NSObjectProtocol for UIScene {}
22);
23
24#[cfg(feature = "UIResponder")]
25extern_conformance!(
26    unsafe impl UIResponderStandardEditActions for UIScene {}
27);
28
29#[cfg(feature = "UIResponder")]
30impl UIScene {
31    extern_methods!(
32        #[unsafe(method(new))]
33        #[unsafe(method_family = new)]
34        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
35
36        #[unsafe(method(init))]
37        #[unsafe(method_family = init)]
38        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40        #[cfg(all(feature = "UISceneOptions", feature = "UISceneSession"))]
41        #[unsafe(method(initWithSession:connectionOptions:))]
42        #[unsafe(method_family = init)]
43        pub fn initWithSession_connectionOptions(
44            this: Allocated<Self>,
45            session: &UISceneSession,
46            connection_options: &UISceneConnectionOptions,
47        ) -> Retained<Self>;
48
49        #[cfg(feature = "UISceneSession")]
50        #[unsafe(method(session))]
51        #[unsafe(method_family = none)]
52        pub fn session(&self) -> Retained<UISceneSession>;
53
54        #[unsafe(method(delegate))]
55        #[unsafe(method_family = none)]
56        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UISceneDelegate>>>;
57
58        /// Setter for [`delegate`][Self::delegate].
59        #[unsafe(method(setDelegate:))]
60        #[unsafe(method_family = none)]
61        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UISceneDelegate>>);
62
63        #[cfg(feature = "UISceneDefinitions")]
64        #[unsafe(method(activationState))]
65        #[unsafe(method_family = none)]
66        pub fn activationState(&self) -> UISceneActivationState;
67
68        #[cfg(all(feature = "UISceneOptions", feature = "block2"))]
69        #[unsafe(method(openURL:options:completionHandler:))]
70        #[unsafe(method_family = none)]
71        pub fn openURL_options_completionHandler(
72            &self,
73            url: &NSURL,
74            options: Option<&UISceneOpenExternalURLOptions>,
75            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
76        );
77
78        #[unsafe(method(title))]
79        #[unsafe(method_family = none)]
80        pub fn title(&self) -> Retained<NSString>;
81
82        /// Setter for [`title`][Self::title].
83        ///
84        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
85        #[unsafe(method(setTitle:))]
86        #[unsafe(method_family = none)]
87        pub fn setTitle(&self, title: Option<&NSString>);
88
89        #[unsafe(method(subtitle))]
90        #[unsafe(method_family = none)]
91        pub fn subtitle(&self) -> Retained<NSString>;
92
93        /// Setter for [`subtitle`][Self::subtitle].
94        ///
95        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
96        #[unsafe(method(setSubtitle:))]
97        #[unsafe(method_family = none)]
98        pub fn setSubtitle(&self, subtitle: &NSString);
99
100        #[cfg(feature = "UISceneActivationConditions")]
101        #[unsafe(method(activationConditions))]
102        #[unsafe(method_family = none)]
103        pub fn activationConditions(&self) -> Retained<UISceneActivationConditions>;
104
105        #[cfg(feature = "UISceneActivationConditions")]
106        /// Setter for [`activationConditions`][Self::activationConditions].
107        #[unsafe(method(setActivationConditions:))]
108        #[unsafe(method_family = none)]
109        pub fn setActivationConditions(&self, activation_conditions: &UISceneActivationConditions);
110
111        #[cfg(feature = "UISceneDestructionCondition")]
112        #[unsafe(method(destructionConditions))]
113        #[unsafe(method_family = none)]
114        pub fn destructionConditions(&self) -> Retained<NSSet<UISceneDestructionCondition>>;
115
116        #[cfg(feature = "UISceneDestructionCondition")]
117        /// Setter for [`destructionConditions`][Self::destructionConditions].
118        ///
119        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
120        #[unsafe(method(setDestructionConditions:))]
121        #[unsafe(method_family = none)]
122        pub fn setDestructionConditions(
123            &self,
124            destruction_conditions: &NSSet<UISceneDestructionCondition>,
125        );
126    );
127}
128
129extern_protocol!(
130    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedelegate?language=objc)
131    pub unsafe trait UISceneDelegate: NSObjectProtocol + MainThreadOnly {
132        #[cfg(all(
133            feature = "UIResponder",
134            feature = "UISceneOptions",
135            feature = "UISceneSession"
136        ))]
137        #[optional]
138        #[unsafe(method(scene:willConnectToSession:options:))]
139        #[unsafe(method_family = none)]
140        fn scene_willConnectToSession_options(
141            &self,
142            scene: &UIScene,
143            session: &UISceneSession,
144            connection_options: &UISceneConnectionOptions,
145        );
146
147        #[cfg(feature = "UIResponder")]
148        #[optional]
149        #[unsafe(method(sceneDidDisconnect:))]
150        #[unsafe(method_family = none)]
151        fn sceneDidDisconnect(&self, scene: &UIScene);
152
153        #[cfg(feature = "UIResponder")]
154        #[optional]
155        #[unsafe(method(sceneDidBecomeActive:))]
156        #[unsafe(method_family = none)]
157        fn sceneDidBecomeActive(&self, scene: &UIScene);
158
159        #[cfg(feature = "UIResponder")]
160        #[optional]
161        #[unsafe(method(sceneWillResignActive:))]
162        #[unsafe(method_family = none)]
163        fn sceneWillResignActive(&self, scene: &UIScene);
164
165        #[cfg(feature = "UIResponder")]
166        #[optional]
167        #[unsafe(method(sceneWillEnterForeground:))]
168        #[unsafe(method_family = none)]
169        fn sceneWillEnterForeground(&self, scene: &UIScene);
170
171        #[cfg(feature = "UIResponder")]
172        #[optional]
173        #[unsafe(method(sceneDidEnterBackground:))]
174        #[unsafe(method_family = none)]
175        fn sceneDidEnterBackground(&self, scene: &UIScene);
176
177        #[cfg(all(feature = "UIOpenURLContext", feature = "UIResponder"))]
178        #[optional]
179        #[unsafe(method(scene:openURLContexts:))]
180        #[unsafe(method_family = none)]
181        fn scene_openURLContexts(&self, scene: &UIScene, url_contexts: &NSSet<UIOpenURLContext>);
182
183        #[cfg(feature = "UIResponder")]
184        #[optional]
185        #[unsafe(method(stateRestorationActivityForScene:))]
186        #[unsafe(method_family = none)]
187        fn stateRestorationActivityForScene(
188            &self,
189            scene: &UIScene,
190        ) -> Option<Retained<NSUserActivity>>;
191
192        #[cfg(feature = "UIResponder")]
193        #[optional]
194        #[unsafe(method(scene:restoreInteractionStateWithUserActivity:))]
195        #[unsafe(method_family = none)]
196        fn scene_restoreInteractionStateWithUserActivity(
197            &self,
198            scene: &UIScene,
199            state_restoration_activity: &NSUserActivity,
200        );
201
202        #[cfg(feature = "UIResponder")]
203        #[optional]
204        #[unsafe(method(scene:willContinueUserActivityWithType:))]
205        #[unsafe(method_family = none)]
206        fn scene_willContinueUserActivityWithType(
207            &self,
208            scene: &UIScene,
209            user_activity_type: &NSString,
210        );
211
212        #[cfg(feature = "UIResponder")]
213        #[optional]
214        #[unsafe(method(scene:continueUserActivity:))]
215        #[unsafe(method_family = none)]
216        fn scene_continueUserActivity(&self, scene: &UIScene, user_activity: &NSUserActivity);
217
218        #[cfg(feature = "UIResponder")]
219        #[optional]
220        #[unsafe(method(scene:didFailToContinueUserActivityWithType:error:))]
221        #[unsafe(method_family = none)]
222        fn scene_didFailToContinueUserActivityWithType_error(
223            &self,
224            scene: &UIScene,
225            user_activity_type: &NSString,
226            error: &NSError,
227        );
228
229        #[cfg(feature = "UIResponder")]
230        #[optional]
231        #[unsafe(method(scene:didUpdateUserActivity:))]
232        #[unsafe(method_family = none)]
233        fn scene_didUpdateUserActivity(&self, scene: &UIScene, user_activity: &NSUserActivity);
234    }
235);
236
237extern "C" {
238    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenewillconnectnotification?language=objc)
239    pub static UISceneWillConnectNotification: &'static NSNotificationName;
240}
241
242extern "C" {
243    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenediddisconnectnotification?language=objc)
244    pub static UISceneDidDisconnectNotification: &'static NSNotificationName;
245}
246
247extern "C" {
248    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedidactivatenotification?language=objc)
249    pub static UISceneDidActivateNotification: &'static NSNotificationName;
250}
251
252extern "C" {
253    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenewilldeactivatenotification?language=objc)
254    pub static UISceneWillDeactivateNotification: &'static NSNotificationName;
255}
256
257extern "C" {
258    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenewillenterforegroundnotification?language=objc)
259    pub static UISceneWillEnterForegroundNotification: &'static NSNotificationName;
260}
261
262extern "C" {
263    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedidenterbackgroundnotification?language=objc)
264    pub static UISceneDidEnterBackgroundNotification: &'static NSNotificationName;
265}
266
267extern "C" {
268    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesessionroleimmersivespaceapplication?language=objc)
269    #[cfg(feature = "UISceneDefinitions")]
270    pub static UISceneSessionRoleImmersiveSpaceApplication: &'static UISceneSessionRole;
271}