objc2_ui_kit/generated/
UIWindowScene.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::*;
6#[cfg(feature = "objc2-cloud-kit")]
7use objc2_cloud_kit::*;
8#[cfg(feature = "objc2-core-foundation")]
9use objc2_core_foundation::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscene?language=objc)
16    #[unsafe(super(UIScene, UIResponder, NSObject))]
17    #[thread_kind = MainThreadOnly]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
20    pub struct UIWindowScene;
21);
22
23#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for UIWindowScene {}
26);
27
28#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
29extern_conformance!(
30    unsafe impl UIResponderStandardEditActions for UIWindowScene {}
31);
32
33#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
34impl UIWindowScene {
35    extern_methods!(
36        #[cfg(feature = "UIScreen")]
37        #[unsafe(method(screen))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn screen(&self) -> Retained<UIScreen>;
40
41        #[cfg(feature = "UIOrientation")]
42        #[unsafe(method(interfaceOrientation))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn interfaceOrientation(&self) -> UIInterfaceOrientation;
45
46        #[cfg(feature = "UIView")]
47        #[unsafe(method(coordinateSpace))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>;
50
51        #[cfg(feature = "UITraitCollection")]
52        #[unsafe(method(traitCollection))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn traitCollection(&self) -> Retained<UITraitCollection>;
55
56        #[cfg(all(feature = "UIWindowSceneGeometryPreferences", feature = "block2"))]
57        #[unsafe(method(requestGeometryUpdateWithPreferences:errorHandler:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn requestGeometryUpdateWithPreferences_errorHandler(
60            &self,
61            geometry_preferences: &UIWindowSceneGeometryPreferences,
62            error_handler: Option<&block2::DynBlock<dyn Fn(NonNull<NSError>)>>,
63        );
64
65        #[cfg(feature = "UIWindowSceneGeometry")]
66        #[unsafe(method(effectiveGeometry))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn effectiveGeometry(&self) -> Retained<UIWindowSceneGeometry>;
69
70        #[unsafe(method(sizeRestrictions))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn sizeRestrictions(&self) -> Option<Retained<UISceneSizeRestrictions>>;
73
74        #[cfg(all(feature = "UIView", feature = "UIWindow"))]
75        #[unsafe(method(windows))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn windows(&self) -> Retained<NSArray<UIWindow>>;
78
79        #[cfg(all(feature = "UIView", feature = "UIWindow"))]
80        #[unsafe(method(keyWindow))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn keyWindow(&self) -> Option<Retained<UIWindow>>;
83
84        #[cfg(feature = "UIActivityItemsConfigurationReading")]
85        /// An optional object used as a source of scene-level activity items configuration
86        ///
87        /// If this property returns
88        /// `nil,`the
89        /// `activityItemsConfiguration`property of the most-presented view controller
90        /// of the scene's key window will be used for scene-level sharing and activities.
91        #[unsafe(method(activityItemsConfigurationSource))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn activityItemsConfigurationSource(
94            &self,
95        ) -> Option<Retained<ProtocolObject<dyn UIActivityItemsConfigurationProviding>>>;
96
97        #[cfg(feature = "UIActivityItemsConfigurationReading")]
98        /// This is a [weak property][objc2::topics::weak_property].
99        /// Setter for [`activityItemsConfigurationSource`][Self::activityItemsConfigurationSource].
100        #[unsafe(method(setActivityItemsConfigurationSource:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setActivityItemsConfigurationSource(
103            &self,
104            activity_items_configuration_source: Option<
105                &ProtocolObject<dyn UIActivityItemsConfigurationProviding>,
106            >,
107        );
108
109        #[cfg(feature = "UISceneWindowingBehaviors")]
110        /// Additional window behaviors which may be platform specific. This property will be nil on unsupported platforms, otherwise will provide a mutable object for window behavior customization.
111        #[unsafe(method(windowingBehaviors))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn windowingBehaviors(&self) -> Option<Retained<UISceneWindowingBehaviors>>;
114
115        #[unsafe(method(isFullScreen))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn isFullScreen(&self) -> bool;
118    );
119}
120
121/// Methods declared on superclass `UIScene`.
122#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
123impl UIWindowScene {
124    extern_methods!(
125        #[unsafe(method(new))]
126        #[unsafe(method_family = new)]
127        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
128
129        #[unsafe(method(init))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132
133        #[cfg(all(feature = "UISceneOptions", feature = "UISceneSession"))]
134        #[unsafe(method(initWithSession:connectionOptions:))]
135        #[unsafe(method_family = init)]
136        pub unsafe fn initWithSession_connectionOptions(
137            this: Allocated<Self>,
138            session: &UISceneSession,
139            connection_options: &UISceneConnectionOptions,
140        ) -> Retained<Self>;
141    );
142}
143
144#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
145impl UIWindowScene {
146    extern_methods!(
147        #[cfg(feature = "UITraitCollection")]
148        #[unsafe(method(traitOverrides))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>;
151    );
152}
153
154#[cfg(all(
155    feature = "UIResponder",
156    feature = "UIScene",
157    feature = "UITraitCollection"
158))]
159extern_conformance!(
160    unsafe impl UITraitChangeObservable for UIWindowScene {}
161);
162
163#[cfg(all(
164    feature = "UIResponder",
165    feature = "UIScene",
166    feature = "UITraitCollection"
167))]
168extern_conformance!(
169    unsafe impl UITraitEnvironment for UIWindowScene {}
170);
171
172extern_protocol!(
173    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenedelegate?language=objc)
174    #[cfg(feature = "UIScene")]
175    pub unsafe trait UIWindowSceneDelegate: UISceneDelegate + MainThreadOnly {
176        #[cfg(all(feature = "UIResponder", feature = "UIView", feature = "UIWindow"))]
177        #[optional]
178        #[unsafe(method(window))]
179        #[unsafe(method_family = none)]
180        unsafe fn window(&self) -> Option<Retained<UIWindow>>;
181
182        #[cfg(all(feature = "UIResponder", feature = "UIView", feature = "UIWindow"))]
183        /// Setter for [`window`][Self::window].
184        #[optional]
185        #[unsafe(method(setWindow:))]
186        #[unsafe(method_family = none)]
187        unsafe fn setWindow(&self, window: Option<&UIWindow>);
188
189        #[cfg(all(
190            feature = "UIOrientation",
191            feature = "UIResponder",
192            feature = "UITraitCollection",
193            feature = "UIView"
194        ))]
195        #[optional]
196        #[unsafe(method(windowScene:didUpdateCoordinateSpace:interfaceOrientation:traitCollection:))]
197        #[unsafe(method_family = none)]
198        unsafe fn windowScene_didUpdateCoordinateSpace_interfaceOrientation_traitCollection(
199            &self,
200            window_scene: &UIWindowScene,
201            previous_coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
202            previous_interface_orientation: UIInterfaceOrientation,
203            previous_trait_collection: &UITraitCollection,
204        );
205
206        #[cfg(all(
207            feature = "UIApplicationShortcutItem",
208            feature = "UIResponder",
209            feature = "block2"
210        ))]
211        #[optional]
212        #[unsafe(method(windowScene:performActionForShortcutItem:completionHandler:))]
213        #[unsafe(method_family = none)]
214        unsafe fn windowScene_performActionForShortcutItem_completionHandler(
215            &self,
216            window_scene: &UIWindowScene,
217            shortcut_item: &UIApplicationShortcutItem,
218            completion_handler: &block2::DynBlock<dyn Fn(Bool)>,
219        );
220
221        #[cfg(all(feature = "UIResponder", feature = "objc2-cloud-kit"))]
222        #[optional]
223        #[unsafe(method(windowScene:userDidAcceptCloudKitShareWithMetadata:))]
224        #[unsafe(method_family = none)]
225        unsafe fn windowScene_userDidAcceptCloudKitShareWithMetadata(
226            &self,
227            window_scene: &UIWindowScene,
228            cloud_kit_share_metadata: &CKShareMetadata,
229        );
230    }
231);
232
233extern "C" {
234    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenesessionroleapplication?language=objc)
235    #[cfg(feature = "UISceneDefinitions")]
236    pub static UIWindowSceneSessionRoleApplication: &'static UISceneSessionRole;
237}
238
239extern "C" {
240    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenesessionroleexternaldisplaynoninteractive?language=objc)
241    #[cfg(feature = "UISceneDefinitions")]
242    pub static UIWindowSceneSessionRoleExternalDisplayNonInteractive: &'static UISceneSessionRole;
243}
244
245extern "C" {
246    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenesessionroleexternaldisplay?language=objc)
247    #[cfg(feature = "UISceneDefinitions")]
248    pub static UIWindowSceneSessionRoleExternalDisplay: &'static UISceneSessionRole;
249}
250
251extern "C" {
252    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenesessionrolevolumetricapplication?language=objc)
253    #[cfg(feature = "UISceneDefinitions")]
254    pub static UIWindowSceneSessionRoleVolumetricApplication: &'static UISceneSessionRole;
255}
256
257/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenedismissalanimation?language=objc)
258// NS_ENUM
259#[repr(transparent)]
260#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
261pub struct UIWindowSceneDismissalAnimation(pub NSInteger);
262impl UIWindowSceneDismissalAnimation {
263    #[doc(alias = "UIWindowSceneDismissalAnimationStandard")]
264    pub const Standard: Self = Self(1);
265    #[doc(alias = "UIWindowSceneDismissalAnimationCommit")]
266    pub const Commit: Self = Self(2);
267    #[doc(alias = "UIWindowSceneDismissalAnimationDecline")]
268    pub const Decline: Self = Self(3);
269}
270
271unsafe impl Encode for UIWindowSceneDismissalAnimation {
272    const ENCODING: Encoding = NSInteger::ENCODING;
273}
274
275unsafe impl RefEncode for UIWindowSceneDismissalAnimation {
276    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
277}
278
279extern_class!(
280    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenedestructionrequestoptions?language=objc)
281    #[unsafe(super(UISceneDestructionRequestOptions, NSObject))]
282    #[thread_kind = MainThreadOnly]
283    #[derive(Debug, PartialEq, Eq, Hash)]
284    #[cfg(feature = "UISceneOptions")]
285    pub struct UIWindowSceneDestructionRequestOptions;
286);
287
288#[cfg(feature = "UISceneOptions")]
289extern_conformance!(
290    unsafe impl NSObjectProtocol for UIWindowSceneDestructionRequestOptions {}
291);
292
293#[cfg(feature = "UISceneOptions")]
294impl UIWindowSceneDestructionRequestOptions {
295    extern_methods!(
296        #[unsafe(method(windowDismissalAnimation))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn windowDismissalAnimation(&self) -> UIWindowSceneDismissalAnimation;
299
300        /// Setter for [`windowDismissalAnimation`][Self::windowDismissalAnimation].
301        #[unsafe(method(setWindowDismissalAnimation:))]
302        #[unsafe(method_family = none)]
303        pub unsafe fn setWindowDismissalAnimation(
304            &self,
305            window_dismissal_animation: UIWindowSceneDismissalAnimation,
306        );
307    );
308}
309
310/// Methods declared on superclass `NSObject`.
311#[cfg(feature = "UISceneOptions")]
312impl UIWindowSceneDestructionRequestOptions {
313    extern_methods!(
314        #[unsafe(method(init))]
315        #[unsafe(method_family = init)]
316        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
317
318        #[unsafe(method(new))]
319        #[unsafe(method_family = new)]
320        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
321    );
322}
323
324extern_class!(
325    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesizerestrictions?language=objc)
326    #[unsafe(super(NSObject))]
327    #[thread_kind = MainThreadOnly]
328    #[derive(Debug, PartialEq, Eq, Hash)]
329    pub struct UISceneSizeRestrictions;
330);
331
332extern_conformance!(
333    unsafe impl NSObjectProtocol for UISceneSizeRestrictions {}
334);
335
336impl UISceneSizeRestrictions {
337    extern_methods!(
338        #[unsafe(method(init))]
339        #[unsafe(method_family = init)]
340        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
341
342        #[unsafe(method(new))]
343        #[unsafe(method_family = new)]
344        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
345
346        #[cfg(feature = "objc2-core-foundation")]
347        #[unsafe(method(minimumSize))]
348        #[unsafe(method_family = none)]
349        pub unsafe fn minimumSize(&self) -> CGSize;
350
351        #[cfg(feature = "objc2-core-foundation")]
352        /// Setter for [`minimumSize`][Self::minimumSize].
353        #[unsafe(method(setMinimumSize:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn setMinimumSize(&self, minimum_size: CGSize);
356
357        #[cfg(feature = "objc2-core-foundation")]
358        #[unsafe(method(maximumSize))]
359        #[unsafe(method_family = none)]
360        pub unsafe fn maximumSize(&self) -> CGSize;
361
362        #[cfg(feature = "objc2-core-foundation")]
363        /// Setter for [`maximumSize`][Self::maximumSize].
364        #[unsafe(method(setMaximumSize:))]
365        #[unsafe(method_family = none)]
366        pub unsafe fn setMaximumSize(&self, maximum_size: CGSize);
367
368        #[unsafe(method(allowsFullScreen))]
369        #[unsafe(method_family = none)]
370        pub unsafe fn allowsFullScreen(&self) -> bool;
371
372        /// Setter for [`allowsFullScreen`][Self::allowsFullScreen].
373        #[unsafe(method(setAllowsFullScreen:))]
374        #[unsafe(method_family = none)]
375        pub unsafe fn setAllowsFullScreen(&self, allows_full_screen: bool);
376    );
377}