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