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 unsafe 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 unsafe fn session(&self) -> Retained<UISceneSession>;
53
54        #[unsafe(method(delegate))]
55        #[unsafe(method_family = none)]
56        pub unsafe 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 unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UISceneDelegate>>);
62
63        #[cfg(feature = "UISceneDefinitions")]
64        #[unsafe(method(activationState))]
65        #[unsafe(method_family = none)]
66        pub unsafe 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 unsafe 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 unsafe fn title(&self) -> Retained<NSString>;
81
82        /// Setter for [`title`][Self::title].
83        #[unsafe(method(setTitle:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setTitle(&self, title: Option<&NSString>);
86
87        #[unsafe(method(subtitle))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn subtitle(&self) -> Retained<NSString>;
90
91        /// Setter for [`subtitle`][Self::subtitle].
92        #[unsafe(method(setSubtitle:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setSubtitle(&self, subtitle: &NSString);
95
96        #[cfg(feature = "UISceneActivationConditions")]
97        #[unsafe(method(activationConditions))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn activationConditions(&self) -> Retained<UISceneActivationConditions>;
100
101        #[cfg(feature = "UISceneActivationConditions")]
102        /// Setter for [`activationConditions`][Self::activationConditions].
103        #[unsafe(method(setActivationConditions:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn setActivationConditions(
106            &self,
107            activation_conditions: &UISceneActivationConditions,
108        );
109    );
110}
111
112extern_protocol!(
113    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedelegate?language=objc)
114    pub unsafe trait UISceneDelegate: NSObjectProtocol + MainThreadOnly {
115        #[cfg(all(
116            feature = "UIResponder",
117            feature = "UISceneOptions",
118            feature = "UISceneSession"
119        ))]
120        #[optional]
121        #[unsafe(method(scene:willConnectToSession:options:))]
122        #[unsafe(method_family = none)]
123        unsafe fn scene_willConnectToSession_options(
124            &self,
125            scene: &UIScene,
126            session: &UISceneSession,
127            connection_options: &UISceneConnectionOptions,
128        );
129
130        #[cfg(feature = "UIResponder")]
131        #[optional]
132        #[unsafe(method(sceneDidDisconnect:))]
133        #[unsafe(method_family = none)]
134        unsafe fn sceneDidDisconnect(&self, scene: &UIScene);
135
136        #[cfg(feature = "UIResponder")]
137        #[optional]
138        #[unsafe(method(sceneDidBecomeActive:))]
139        #[unsafe(method_family = none)]
140        unsafe fn sceneDidBecomeActive(&self, scene: &UIScene);
141
142        #[cfg(feature = "UIResponder")]
143        #[optional]
144        #[unsafe(method(sceneWillResignActive:))]
145        #[unsafe(method_family = none)]
146        unsafe fn sceneWillResignActive(&self, scene: &UIScene);
147
148        #[cfg(feature = "UIResponder")]
149        #[optional]
150        #[unsafe(method(sceneWillEnterForeground:))]
151        #[unsafe(method_family = none)]
152        unsafe fn sceneWillEnterForeground(&self, scene: &UIScene);
153
154        #[cfg(feature = "UIResponder")]
155        #[optional]
156        #[unsafe(method(sceneDidEnterBackground:))]
157        #[unsafe(method_family = none)]
158        unsafe fn sceneDidEnterBackground(&self, scene: &UIScene);
159
160        #[cfg(all(feature = "UIOpenURLContext", feature = "UIResponder"))]
161        #[optional]
162        #[unsafe(method(scene:openURLContexts:))]
163        #[unsafe(method_family = none)]
164        unsafe fn scene_openURLContexts(
165            &self,
166            scene: &UIScene,
167            url_contexts: &NSSet<UIOpenURLContext>,
168        );
169
170        #[cfg(feature = "UIResponder")]
171        #[optional]
172        #[unsafe(method(stateRestorationActivityForScene:))]
173        #[unsafe(method_family = none)]
174        unsafe fn stateRestorationActivityForScene(
175            &self,
176            scene: &UIScene,
177        ) -> Option<Retained<NSUserActivity>>;
178
179        #[cfg(feature = "UIResponder")]
180        #[optional]
181        #[unsafe(method(scene:restoreInteractionStateWithUserActivity:))]
182        #[unsafe(method_family = none)]
183        unsafe fn scene_restoreInteractionStateWithUserActivity(
184            &self,
185            scene: &UIScene,
186            state_restoration_activity: &NSUserActivity,
187        );
188
189        #[cfg(feature = "UIResponder")]
190        #[optional]
191        #[unsafe(method(scene:willContinueUserActivityWithType:))]
192        #[unsafe(method_family = none)]
193        unsafe fn scene_willContinueUserActivityWithType(
194            &self,
195            scene: &UIScene,
196            user_activity_type: &NSString,
197        );
198
199        #[cfg(feature = "UIResponder")]
200        #[optional]
201        #[unsafe(method(scene:continueUserActivity:))]
202        #[unsafe(method_family = none)]
203        unsafe fn scene_continueUserActivity(
204            &self,
205            scene: &UIScene,
206            user_activity: &NSUserActivity,
207        );
208
209        #[cfg(feature = "UIResponder")]
210        #[optional]
211        #[unsafe(method(scene:didFailToContinueUserActivityWithType:error:))]
212        #[unsafe(method_family = none)]
213        unsafe fn scene_didFailToContinueUserActivityWithType_error(
214            &self,
215            scene: &UIScene,
216            user_activity_type: &NSString,
217            error: &NSError,
218        );
219
220        #[cfg(feature = "UIResponder")]
221        #[optional]
222        #[unsafe(method(scene:didUpdateUserActivity:))]
223        #[unsafe(method_family = none)]
224        unsafe fn scene_didUpdateUserActivity(
225            &self,
226            scene: &UIScene,
227            user_activity: &NSUserActivity,
228        );
229    }
230);
231
232extern "C" {
233    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenewillconnectnotification?language=objc)
234    pub static UISceneWillConnectNotification: &'static NSNotificationName;
235}
236
237extern "C" {
238    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenediddisconnectnotification?language=objc)
239    pub static UISceneDidDisconnectNotification: &'static NSNotificationName;
240}
241
242extern "C" {
243    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedidactivatenotification?language=objc)
244    pub static UISceneDidActivateNotification: &'static NSNotificationName;
245}
246
247extern "C" {
248    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenewilldeactivatenotification?language=objc)
249    pub static UISceneWillDeactivateNotification: &'static NSNotificationName;
250}
251
252extern "C" {
253    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenewillenterforegroundnotification?language=objc)
254    pub static UISceneWillEnterForegroundNotification: &'static NSNotificationName;
255}
256
257extern "C" {
258    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedidenterbackgroundnotification?language=objc)
259    pub static UISceneDidEnterBackgroundNotification: &'static NSNotificationName;
260}
261
262extern "C" {
263    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesessionroleimmersivespaceapplication?language=objc)
264    #[cfg(feature = "UISceneDefinitions")]
265    pub static UISceneSessionRoleImmersiveSpaceApplication: &'static UISceneSessionRole;
266}