objc2_ui_kit/generated/
UISceneSessionActivationRequest.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesessionactivationrequest?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct UISceneSessionActivationRequest;
15);
16
17extern_conformance!(
18    unsafe impl NSCopying for UISceneSessionActivationRequest {}
19);
20
21unsafe impl CopyingHelper for UISceneSessionActivationRequest {
22    type Result = Self;
23}
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for UISceneSessionActivationRequest {}
27);
28
29impl UISceneSessionActivationRequest {
30    extern_methods!(
31        #[cfg(feature = "UISceneDefinitions")]
32        /// The role to request. If the request was created using `requestWithSession:`, this reflects
33        /// the role of the `session`.
34        #[unsafe(method(role))]
35        #[unsafe(method_family = none)]
36        pub fn role(&self) -> Retained<UISceneSessionRole>;
37
38        #[cfg(feature = "UISceneSession")]
39        /// The specific scene session that should be activated, if provided when creating the request.
40        #[unsafe(method(session))]
41        #[unsafe(method_family = none)]
42        pub fn session(&self, mtm: MainThreadMarker) -> Option<Retained<UISceneSession>>;
43
44        /// An optional user activity to send to the newly activated scene.
45        ///
46        /// Only sessions with a matching `role` will have their `activationConditions` evaluated
47        /// against the user activity's `targetContentIdentifier`.
48        #[unsafe(method(userActivity))]
49        #[unsafe(method_family = none)]
50        pub fn userActivity(&self) -> Option<Retained<NSUserActivity>>;
51
52        /// Setter for [`userActivity`][Self::userActivity].
53        #[unsafe(method(setUserActivity:))]
54        #[unsafe(method_family = none)]
55        pub fn setUserActivity(&self, user_activity: Option<&NSUserActivity>);
56
57        #[cfg(feature = "UISceneOptions")]
58        /// Optional parameters used for further customizing the request.
59        #[unsafe(method(options))]
60        #[unsafe(method_family = none)]
61        pub fn options(
62            &self,
63            mtm: MainThreadMarker,
64        ) -> Option<Retained<UISceneActivationRequestOptions>>;
65
66        #[cfg(feature = "UISceneOptions")]
67        /// Setter for [`options`][Self::options].
68        ///
69        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
70        #[unsafe(method(setOptions:))]
71        #[unsafe(method_family = none)]
72        pub fn setOptions(&self, options: Option<&UISceneActivationRequestOptions>);
73
74        /// Creates a request for activating a session with the role of `UIWindowSceneSessionRoleApplication`.
75        #[unsafe(method(request))]
76        #[unsafe(method_family = none)]
77        pub fn request() -> Retained<Self>;
78
79        #[cfg(feature = "UISceneDefinitions")]
80        /// Creates a request for activating a session with the specified `role`.
81        /// - Parameter role: The requested scene session role.
82        #[unsafe(method(requestWithRole:))]
83        #[unsafe(method_family = none)]
84        pub fn requestWithRole(role: &UISceneSessionRole) -> Retained<Self>;
85
86        #[cfg(feature = "UISceneSession")]
87        /// Creates a request for activating an existing scene session.
88        /// - Parameter session: The existing session to activate.
89        #[unsafe(method(requestWithSession:))]
90        #[unsafe(method_family = none)]
91        pub fn requestWithSession(session: &UISceneSession) -> Retained<Self>;
92
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96
97        #[unsafe(method(new))]
98        #[unsafe(method_family = new)]
99        pub unsafe fn new() -> Retained<Self>;
100    );
101}