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
46extern_conformance!(
47    unsafe impl NSCopying for UIWindowSceneGeometry {}
48);
49
50unsafe impl CopyingHelper for UIWindowSceneGeometry {
51    type Result = Self;
52}
53
54extern_conformance!(
55    unsafe impl NSObjectProtocol for UIWindowSceneGeometry {}
56);
57
58impl UIWindowSceneGeometry {
59    extern_methods!(
60        /// Geometry objects are readonly and should only be created by the framework. To set a window scene's geometry, see UIWindowSceneGeometryPreferences and -[UIWindowScene requestGeometryUpdateWithPreferences:].
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        #[unsafe(method(new))]
66        #[unsafe(method_family = new)]
67        pub unsafe fn new() -> Retained<Self>;
68
69        #[cfg(feature = "objc2-core-foundation")]
70        #[unsafe(method(systemFrame))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn systemFrame(&self) -> CGRect;
73
74        #[cfg(feature = "UIOrientation")]
75        #[unsafe(method(interfaceOrientation))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn interfaceOrientation(&self) -> UIInterfaceOrientation;
78
79        #[cfg(feature = "objc2-core-foundation")]
80        /// The current app specified minimumSize. A value of 0,0 is returned if a minimum is not set by the application
81        #[unsafe(method(minimumSize))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn minimumSize(&self) -> CGSize;
84
85        #[cfg(feature = "objc2-core-foundation")]
86        /// The current app specified maximumSize. A value of CGFLOAT_MAX,CGFLOAT_MAX is returned if a maximum is not set by the application
87        #[unsafe(method(maximumSize))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn maximumSize(&self) -> CGSize;
90
91        /// The current app specified resizingRestriction. Default value UIWindowSceneResizingRestrictionsUnspecified
92        #[unsafe(method(resizingRestrictions))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn resizingRestrictions(&self) -> UIWindowSceneResizingRestrictions;
95    );
96}