objc2_ui_kit/generated/
UIWindowSceneActivationAction.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
10/// Return a
11/// `UIWindowSceneActivationConfiguration`
12///
13/// Parameter `action`: The
14/// `UIWindowSceneActivationAction`requesting a configuration.
15///
16/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationactionconfigurationprovider?language=objc)
17#[cfg(all(
18    feature = "UIAction",
19    feature = "UIMenuElement",
20    feature = "UIWindowSceneActivationConfiguration",
21    feature = "block2"
22))]
23pub type UIWindowSceneActivationActionConfigurationProvider = *mut block2::DynBlock<
24    dyn Fn(NonNull<UIWindowSceneActivationAction>) -> *mut UIWindowSceneActivationConfiguration,
25>;
26
27extern_class!(
28    /// An action that facilitates activating a
29    /// `UIWindowScene`when performed.
30    ///
31    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowsceneactivationaction?language=objc)
32    #[unsafe(super(UIAction, UIMenuElement, NSObject))]
33    #[derive(Debug, PartialEq, Eq, Hash)]
34    #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
35    pub struct UIWindowSceneActivationAction;
36);
37
38#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
39extern_conformance!(
40    unsafe impl NSCoding for UIWindowSceneActivationAction {}
41);
42
43#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
44extern_conformance!(
45    unsafe impl NSCopying for UIWindowSceneActivationAction {}
46);
47
48#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
49unsafe impl CopyingHelper for UIWindowSceneActivationAction {
50    type Result = Self;
51}
52
53#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
54extern_conformance!(
55    unsafe impl NSObjectProtocol for UIWindowSceneActivationAction {}
56);
57
58#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
59extern_conformance!(
60    unsafe impl NSSecureCoding for UIWindowSceneActivationAction {}
61);
62
63#[cfg(all(
64    feature = "UIAction",
65    feature = "UIMenuElement",
66    feature = "UIMenuLeaf"
67))]
68extern_conformance!(
69    unsafe impl UIMenuLeaf for UIWindowSceneActivationAction {}
70);
71
72#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
73impl UIWindowSceneActivationAction {
74    extern_methods!(
75        /// The actions title. Set to nil to use the default title.
76        #[unsafe(method(title))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn title(&self) -> Retained<NSString>;
79
80        /// Setter for [`title`][Self::title].
81        #[unsafe(method(setTitle:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setTitle(&self, title: Option<&NSString>);
84
85        #[cfg(all(feature = "UIWindowSceneActivationConfiguration", feature = "block2"))]
86        /// Returns a new
87        /// `UIWindowSceneActivationAction`
88        ///
89        /// Parameter `identifier`: The action's identifier. Pass nil to use an auto-generated identifier.
90        ///
91        /// Parameter `alternateAction`: If running on a platform that doesn't support multiple windows, the alternate action is used. Otherwise, the alternates handler is called if the scene activation request fails.
92        ///
93        /// Parameter `configurationProvider`: Called when the action has been triggered. It should return a
94        /// `UIWindowSceneActivationConfiguration`whose user activity will be used to request scene activation.
95        #[unsafe(method(actionWithIdentifier:alternateAction:configurationProvider:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn actionWithIdentifier_alternateAction_configurationProvider(
98            identifier: Option<&UIActionIdentifier>,
99            alternate_action: Option<&UIAction>,
100            configuration_provider: UIWindowSceneActivationActionConfigurationProvider,
101            mtm: MainThreadMarker,
102        ) -> Retained<Self>;
103
104        #[cfg(feature = "block2")]
105        #[unsafe(method(actionWithHandler:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn actionWithHandler(
108            handler: UIActionHandler,
109            mtm: MainThreadMarker,
110        ) -> Retained<Self>;
111
112        #[cfg(all(feature = "UIImage", feature = "block2"))]
113        #[unsafe(method(actionWithTitle:image:identifier:handler:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn actionWithTitle_image_identifier_handler(
116            title: &NSString,
117            image: Option<&UIImage>,
118            identifier: Option<&UIActionIdentifier>,
119            handler: UIActionHandler,
120            mtm: MainThreadMarker,
121        ) -> Retained<Self>;
122    );
123}
124
125/// Methods declared on superclass `UIAction`.
126#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
127impl UIWindowSceneActivationAction {
128    extern_methods!(
129        #[unsafe(method(init))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132
133        #[unsafe(method(new))]
134        #[unsafe(method_family = new)]
135        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
136    );
137}
138
139/// Methods declared on superclass `UIMenuElement`.
140#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
141impl UIWindowSceneActivationAction {
142    extern_methods!(
143        #[unsafe(method(initWithCoder:))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn initWithCoder(
146            this: Allocated<Self>,
147            coder: &NSCoder,
148        ) -> Option<Retained<Self>>;
149    );
150}