objc2_ui_kit/generated/
UIWindowSceneGeometry.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneresizingrestrictions?language=objc)
12// NS_ENUM
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct UIWindowSceneResizingRestrictions(pub NSInteger);
16impl UIWindowSceneResizingRestrictions {
17    /// App has no preference on user resize
18    #[doc(alias = "UIWindowSceneResizingRestrictionsUnspecified")]
19    pub const Unspecified: Self = Self(0);
20    /// The user cannot resize the scene
21    #[doc(alias = "UIWindowSceneResizingRestrictionsNone")]
22    pub const None: Self = Self(1);
23    /// User resizes are restricted to the current aspect ratio
24    #[doc(alias = "UIWindowSceneResizingRestrictionsUniform")]
25    pub const Uniform: Self = Self(2);
26    /// User resizes are only restricted by the system and other restrictions put in place
27    #[doc(alias = "UIWindowSceneResizingRestrictionsFreeform")]
28    pub const Freeform: Self = Self(3);
29}
30
31unsafe impl Encode for UIWindowSceneResizingRestrictions {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for UIWindowSceneResizingRestrictions {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenegeometry?language=objc)
41    #[unsafe(super(NSObject))]
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    pub struct UIWindowSceneGeometry;
44);
45
46unsafe impl NSCopying for UIWindowSceneGeometry {}
47
48unsafe impl CopyingHelper for UIWindowSceneGeometry {
49    type Result = Self;
50}
51
52unsafe impl NSObjectProtocol for UIWindowSceneGeometry {}
53
54impl UIWindowSceneGeometry {
55    extern_methods!(
56        /// Geometry objects are readonly and should only be created by the framework. To set a window scene's geometry, see UIWindowSceneGeometryPreferences and -[UIWindowScene requestGeometryUpdateWithPreferences:].
57        #[unsafe(method(init))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
60
61        #[unsafe(method(new))]
62        #[unsafe(method_family = new)]
63        pub unsafe fn new() -> Retained<Self>;
64
65        #[cfg(feature = "objc2-core-foundation")]
66        #[unsafe(method(systemFrame))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn systemFrame(&self) -> CGRect;
69
70        #[cfg(feature = "UIOrientation")]
71        #[unsafe(method(interfaceOrientation))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn interfaceOrientation(&self) -> UIInterfaceOrientation;
74
75        #[cfg(feature = "objc2-core-foundation")]
76        /// The current app specified minimumSize. A value of 0,0 is returned if a minimum is not set by the application
77        #[unsafe(method(minimumSize))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn minimumSize(&self) -> CGSize;
80
81        #[cfg(feature = "objc2-core-foundation")]
82        /// The current app specified maximumSize. A value of CGFLOAT_MAX,CGFLOAT_MAX is returned if a maximum is not set by the application
83        #[unsafe(method(maximumSize))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn maximumSize(&self) -> CGSize;
86
87        /// The current app specified resizingRestriction. Default value UIWindowSceneResizingRestrictionsUnspecified
88        #[unsafe(method(resizingRestrictions))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn resizingRestrictions(&self) -> UIWindowSceneResizingRestrictions;
91    );
92}