objc2_ui_kit/generated/
UIWindowSceneActivationRequestOptions.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
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenepresentationstyle?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct UIWindowScenePresentationStyle(pub NSUInteger);
14impl UIWindowScenePresentationStyle {
15    #[doc(alias = "UIWindowScenePresentationStyleAutomatic")]
16    pub const Automatic: Self = Self(0);
17    #[doc(alias = "UIWindowScenePresentationStyleStandard")]
18    pub const Standard: Self = Self(1);
19    #[doc(alias = "UIWindowScenePresentationStyleProminent")]
20    pub const Prominent: Self = Self(2);
21}
22
23unsafe impl Encode for UIWindowScenePresentationStyle {
24    const ENCODING: Encoding = NSUInteger::ENCODING;
25}
26
27unsafe impl RefEncode for UIWindowScenePresentationStyle {
28    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationrequestoptions?language=objc)
33    #[unsafe(super(UISceneActivationRequestOptions, NSObject))]
34    #[derive(Debug, PartialEq, Eq, Hash)]
35    #[cfg(feature = "UISceneOptions")]
36    pub struct UIWindowSceneActivationRequestOptions;
37);
38
39#[cfg(feature = "UISceneOptions")]
40unsafe impl NSObjectProtocol for UIWindowSceneActivationRequestOptions {}
41
42#[cfg(feature = "UISceneOptions")]
43impl UIWindowSceneActivationRequestOptions {
44    extern_methods!(
45        #[deprecated = "Place use .placement with an appropriate UIWindowScenePlacement."]
46        #[unsafe(method(preferredPresentationStyle))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn preferredPresentationStyle(&self) -> UIWindowScenePresentationStyle;
49
50        /// Setter for [`preferredPresentationStyle`][Self::preferredPresentationStyle].
51        #[deprecated = "Place use .placement with an appropriate UIWindowScenePlacement."]
52        #[unsafe(method(setPreferredPresentationStyle:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setPreferredPresentationStyle(
55            &self,
56            preferred_presentation_style: UIWindowScenePresentationStyle,
57        );
58
59        #[cfg(feature = "UIWindowScenePlacement")]
60        /// The preferred placement of the window scene to be activated. Scene placements influence how the
61        /// system positions the activated scene. A `nil` value indicates that the system should determine
62        /// the most appropriate placement to use.
63        #[unsafe(method(placement))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn placement(&self) -> Option<Retained<UIWindowScenePlacement>>;
66
67        #[cfg(feature = "UIWindowScenePlacement")]
68        /// Setter for [`placement`][Self::placement].
69        #[unsafe(method(setPlacement:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setPlacement(&self, placement: Option<&UIWindowScenePlacement>);
72    );
73}
74
75/// Methods declared on superclass `NSObject`.
76#[cfg(feature = "UISceneOptions")]
77impl UIWindowSceneActivationRequestOptions {
78    extern_methods!(
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[unsafe(method(new))]
84        #[unsafe(method_family = new)]
85        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
86    );
87}