objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesessionactivationrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UISceneSessionActivationRequest;
);

extern_conformance!(
    unsafe impl NSCopying for UISceneSessionActivationRequest {}
);

unsafe impl CopyingHelper for UISceneSessionActivationRequest {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for UISceneSessionActivationRequest {}
);

impl UISceneSessionActivationRequest {
    extern_methods!(
        #[cfg(feature = "UISceneDefinitions")]
        /// The role to request. If the request was created using `requestWithSession:`, this reflects
        /// the role of the `session`.
        #[unsafe(method(role))]
        #[unsafe(method_family = none)]
        pub fn role(&self) -> Retained<UISceneSessionRole>;

        #[cfg(feature = "UISceneSession")]
        /// The specific scene session that should be activated, if provided when creating the request.
        #[unsafe(method(session))]
        #[unsafe(method_family = none)]
        pub fn session(&self, mtm: MainThreadMarker) -> Option<Retained<UISceneSession>>;

        /// An optional user activity to send to the newly activated scene.
        ///
        /// Only sessions with a matching `role` will have their `activationConditions` evaluated
        /// against the user activity's `targetContentIdentifier`.
        #[unsafe(method(userActivity))]
        #[unsafe(method_family = none)]
        pub fn userActivity(&self) -> Option<Retained<NSUserActivity>>;

        /// Setter for [`userActivity`][Self::userActivity].
        #[unsafe(method(setUserActivity:))]
        #[unsafe(method_family = none)]
        pub fn setUserActivity(&self, user_activity: Option<&NSUserActivity>);

        #[cfg(feature = "UISceneOptions")]
        /// Optional parameters used for further customizing the request.
        #[unsafe(method(options))]
        #[unsafe(method_family = none)]
        pub fn options(
            &self,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UISceneActivationRequestOptions>>;

        #[cfg(feature = "UISceneOptions")]
        /// Setter for [`options`][Self::options].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setOptions:))]
        #[unsafe(method_family = none)]
        pub fn setOptions(&self, options: Option<&UISceneActivationRequestOptions>);

        /// Creates a request for activating a session with the role of `UIWindowSceneSessionRoleApplication`.
        #[unsafe(method(request))]
        #[unsafe(method_family = none)]
        pub fn request() -> Retained<Self>;

        #[cfg(feature = "UISceneDefinitions")]
        /// Creates a request for activating a session with the specified `role`.
        /// - Parameter role: The requested scene session role.
        #[unsafe(method(requestWithRole:))]
        #[unsafe(method_family = none)]
        pub fn requestWithRole(role: &UISceneSessionRole) -> Retained<Self>;

        #[cfg(feature = "UISceneSession")]
        /// Creates a request for activating an existing scene session.
        /// - Parameter session: The existing session to activate.
        #[unsafe(method(requestWithSession:))]
        #[unsafe(method_family = none)]
        pub fn requestWithSession(session: &UISceneSession) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}