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")]
40extern_conformance!(
41    unsafe impl NSObjectProtocol for UIWindowSceneActivationRequestOptions {}
42);
43
44#[cfg(feature = "UISceneOptions")]
45impl UIWindowSceneActivationRequestOptions {
46    extern_methods!(
47        #[deprecated = "Place use .placement with an appropriate UIWindowScenePlacement."]
48        #[unsafe(method(preferredPresentationStyle))]
49        #[unsafe(method_family = none)]
50        pub fn preferredPresentationStyle(&self) -> UIWindowScenePresentationStyle;
51
52        /// Setter for [`preferredPresentationStyle`][Self::preferredPresentationStyle].
53        #[deprecated = "Place use .placement with an appropriate UIWindowScenePlacement."]
54        #[unsafe(method(setPreferredPresentationStyle:))]
55        #[unsafe(method_family = none)]
56        pub fn setPreferredPresentationStyle(
57            &self,
58            preferred_presentation_style: UIWindowScenePresentationStyle,
59        );
60
61        #[cfg(feature = "UIWindowScenePlacement")]
62        /// The preferred placement of the window scene to be activated. Scene placements influence how the
63        /// system positions the activated scene. A `nil` value indicates that the system should determine
64        /// the most appropriate placement to use.
65        #[unsafe(method(placement))]
66        #[unsafe(method_family = none)]
67        pub fn placement(&self) -> Option<Retained<UIWindowScenePlacement>>;
68
69        #[cfg(feature = "UIWindowScenePlacement")]
70        /// Setter for [`placement`][Self::placement].
71        ///
72        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
73        #[unsafe(method(setPlacement:))]
74        #[unsafe(method_family = none)]
75        pub fn setPlacement(&self, placement: Option<&UIWindowScenePlacement>);
76    );
77}
78
79/// Methods declared on superclass `NSObject`.
80#[cfg(feature = "UISceneOptions")]
81impl UIWindowSceneActivationRequestOptions {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
90    );
91}