objc2_ui_kit/generated/
UISceneSizeRestrictions.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-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// Sizing preferences for the scene. Clients do not create `UISceneSizeRestrictions` directly. An instance is returned from `UIWindowScene.sizeRestrictions`
13    /// if the platform supports scene resizing.
14    /// - Note: The system imposes limits on each preference that may result in it not being honored.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesizerestrictions?language=objc)
17    #[unsafe(super(NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct UISceneSizeRestrictions;
21);
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for UISceneSizeRestrictions {}
25);
26
27impl UISceneSizeRestrictions {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        #[unsafe(method(new))]
34        #[unsafe(method_family = new)]
35        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
36
37        #[cfg(feature = "objc2-core-foundation")]
38        /// The preferred minimum size of the scene
39        #[unsafe(method(minimumSize))]
40        #[unsafe(method_family = none)]
41        pub fn minimumSize(&self) -> CGSize;
42
43        #[cfg(feature = "objc2-core-foundation")]
44        /// Setter for [`minimumSize`][Self::minimumSize].
45        #[unsafe(method(setMinimumSize:))]
46        #[unsafe(method_family = none)]
47        pub fn setMinimumSize(&self, minimum_size: CGSize);
48
49        #[cfg(feature = "objc2-core-foundation")]
50        /// The preferred maximum size of the scene
51        #[unsafe(method(maximumSize))]
52        #[unsafe(method_family = none)]
53        pub fn maximumSize(&self) -> CGSize;
54
55        #[cfg(feature = "objc2-core-foundation")]
56        /// Setter for [`maximumSize`][Self::maximumSize].
57        #[unsafe(method(setMaximumSize:))]
58        #[unsafe(method_family = none)]
59        pub fn setMaximumSize(&self, maximum_size: CGSize);
60
61        /// Whether the scene supports full screen or not
62        /// - Note: Currently only honored on Mac Catalyst
63        #[unsafe(method(allowsFullScreen))]
64        #[unsafe(method_family = none)]
65        pub fn allowsFullScreen(&self) -> bool;
66
67        /// Setter for [`allowsFullScreen`][Self::allowsFullScreen].
68        #[unsafe(method(setAllowsFullScreen:))]
69        #[unsafe(method_family = none)]
70        pub fn setAllowsFullScreen(&self, allows_full_screen: bool);
71    );
72}