objc2_ui_kit/generated/
UISceneOptions.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#[cfg(feature = "objc2-cloud-kit")]
7use objc2_cloud_kit::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-user-notifications")]
10use objc2_user_notifications::*;
11
12use crate::*;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisceneconnectionoptions?language=objc)
16    #[unsafe(super(NSObject))]
17    #[thread_kind = MainThreadOnly]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct UISceneConnectionOptions;
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for UISceneConnectionOptions {}
24);
25
26impl UISceneConnectionOptions {
27    extern_methods!(
28        #[unsafe(method(new))]
29        #[unsafe(method_family = new)]
30        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
31
32        #[unsafe(method(init))]
33        #[unsafe(method_family = init)]
34        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
35
36        #[cfg(feature = "UIOpenURLContext")]
37        #[unsafe(method(URLContexts))]
38        #[unsafe(method_family = none)]
39        pub fn URLContexts(&self) -> Retained<NSSet<UIOpenURLContext>>;
40
41        #[unsafe(method(sourceApplication))]
42        #[unsafe(method_family = none)]
43        pub fn sourceApplication(&self) -> Option<Retained<NSString>>;
44
45        #[unsafe(method(handoffUserActivityType))]
46        #[unsafe(method_family = none)]
47        pub fn handoffUserActivityType(&self) -> Option<Retained<NSString>>;
48
49        #[unsafe(method(userActivities))]
50        #[unsafe(method_family = none)]
51        pub fn userActivities(&self) -> Retained<NSSet<NSUserActivity>>;
52
53        #[cfg(feature = "objc2-user-notifications")]
54        #[unsafe(method(notificationResponse))]
55        #[unsafe(method_family = none)]
56        pub fn notificationResponse(&self) -> Option<Retained<UNNotificationResponse>>;
57
58        #[cfg(feature = "UIApplicationShortcutItem")]
59        #[unsafe(method(shortcutItem))]
60        #[unsafe(method_family = none)]
61        pub fn shortcutItem(&self) -> Option<Retained<UIApplicationShortcutItem>>;
62
63        #[cfg(feature = "objc2-cloud-kit")]
64        #[unsafe(method(cloudKitShareMetadata))]
65        #[unsafe(method_family = none)]
66        pub fn cloudKitShareMetadata(&self) -> Option<Retained<CKShareMetadata>>;
67    );
68}
69
70extern_class!(
71    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisceneopenurloptions?language=objc)
72    #[unsafe(super(NSObject))]
73    #[thread_kind = MainThreadOnly]
74    #[derive(Debug, PartialEq, Eq, Hash)]
75    pub struct UISceneOpenURLOptions;
76);
77
78extern_conformance!(
79    unsafe impl NSObjectProtocol for UISceneOpenURLOptions {}
80);
81
82impl UISceneOpenURLOptions {
83    extern_methods!(
84        #[unsafe(method(new))]
85        #[unsafe(method_family = new)]
86        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
87
88        #[unsafe(method(init))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92        #[unsafe(method(sourceApplication))]
93        #[unsafe(method_family = none)]
94        pub fn sourceApplication(&self) -> Option<Retained<NSString>>;
95
96        #[unsafe(method(annotation))]
97        #[unsafe(method_family = none)]
98        pub fn annotation(&self) -> Option<Retained<AnyObject>>;
99
100        #[unsafe(method(openInPlace))]
101        #[unsafe(method_family = none)]
102        pub fn openInPlace(&self) -> bool;
103
104        #[cfg(feature = "UIEventAttribution")]
105        #[unsafe(method(eventAttribution))]
106        #[unsafe(method_family = none)]
107        pub fn eventAttribution(&self) -> Option<Retained<UIEventAttribution>>;
108    );
109}
110
111extern_class!(
112    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisceneopenexternalurloptions?language=objc)
113    #[unsafe(super(NSObject))]
114    #[thread_kind = MainThreadOnly]
115    #[derive(Debug, PartialEq, Eq, Hash)]
116    pub struct UISceneOpenExternalURLOptions;
117);
118
119extern_conformance!(
120    unsafe impl NSObjectProtocol for UISceneOpenExternalURLOptions {}
121);
122
123impl UISceneOpenExternalURLOptions {
124    extern_methods!(
125        #[unsafe(method(universalLinksOnly))]
126        #[unsafe(method_family = none)]
127        pub fn universalLinksOnly(&self) -> bool;
128
129        /// Setter for [`universalLinksOnly`][Self::universalLinksOnly].
130        #[unsafe(method(setUniversalLinksOnly:))]
131        #[unsafe(method_family = none)]
132        pub fn setUniversalLinksOnly(&self, universal_links_only: bool);
133
134        #[cfg(feature = "UIEventAttribution")]
135        #[unsafe(method(eventAttribution))]
136        #[unsafe(method_family = none)]
137        pub fn eventAttribution(&self) -> Option<Retained<UIEventAttribution>>;
138
139        #[cfg(feature = "UIEventAttribution")]
140        /// Setter for [`eventAttribution`][Self::eventAttribution].
141        ///
142        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
143        #[unsafe(method(setEventAttribution:))]
144        #[unsafe(method_family = none)]
145        pub fn setEventAttribution(&self, event_attribution: Option<&UIEventAttribution>);
146    );
147}
148
149/// Methods declared on superclass `NSObject`.
150impl UISceneOpenExternalURLOptions {
151    extern_methods!(
152        #[unsafe(method(init))]
153        #[unsafe(method_family = init)]
154        pub fn init(this: Allocated<Self>) -> Retained<Self>;
155
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
159    );
160}
161
162/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenecollectionjoinbehavior?language=objc)
163// NS_ENUM
164#[repr(transparent)]
165#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
166pub struct UISceneCollectionJoinBehavior(pub NSInteger);
167impl UISceneCollectionJoinBehavior {
168    #[doc(alias = "UISceneCollectionJoinBehaviorAutomatic")]
169    pub const Automatic: Self = Self(0);
170    #[doc(alias = "UISceneCollectionJoinBehaviorPreferred")]
171    pub const Preferred: Self = Self(1);
172    #[doc(alias = "UISceneCollectionJoinBehaviorDisallowed")]
173    pub const Disallowed: Self = Self(2);
174    #[doc(alias = "UISceneCollectionJoinBehaviorPreferredWithoutActivating")]
175    pub const PreferredWithoutActivating: Self = Self(3);
176}
177
178unsafe impl Encode for UISceneCollectionJoinBehavior {
179    const ENCODING: Encoding = NSInteger::ENCODING;
180}
181
182unsafe impl RefEncode for UISceneCollectionJoinBehavior {
183    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
184}
185
186extern_class!(
187    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisceneactivationrequestoptions?language=objc)
188    #[unsafe(super(NSObject))]
189    #[thread_kind = MainThreadOnly]
190    #[derive(Debug, PartialEq, Eq, Hash)]
191    pub struct UISceneActivationRequestOptions;
192);
193
194extern_conformance!(
195    unsafe impl NSObjectProtocol for UISceneActivationRequestOptions {}
196);
197
198impl UISceneActivationRequestOptions {
199    extern_methods!(
200        #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
201        #[unsafe(method(requestingScene))]
202        #[unsafe(method_family = none)]
203        pub fn requestingScene(&self) -> Option<Retained<UIScene>>;
204
205        #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
206        /// Setter for [`requestingScene`][Self::requestingScene].
207        #[unsafe(method(setRequestingScene:))]
208        #[unsafe(method_family = none)]
209        pub fn setRequestingScene(&self, requesting_scene: Option<&UIScene>);
210
211        #[unsafe(method(collectionJoinBehavior))]
212        #[unsafe(method_family = none)]
213        pub fn collectionJoinBehavior(&self) -> UISceneCollectionJoinBehavior;
214
215        /// Setter for [`collectionJoinBehavior`][Self::collectionJoinBehavior].
216        #[unsafe(method(setCollectionJoinBehavior:))]
217        #[unsafe(method_family = none)]
218        pub fn setCollectionJoinBehavior(
219            &self,
220            collection_join_behavior: UISceneCollectionJoinBehavior,
221        );
222    );
223}
224
225/// Methods declared on superclass `NSObject`.
226impl UISceneActivationRequestOptions {
227    extern_methods!(
228        #[unsafe(method(init))]
229        #[unsafe(method_family = init)]
230        pub fn init(this: Allocated<Self>) -> Retained<Self>;
231
232        #[unsafe(method(new))]
233        #[unsafe(method_family = new)]
234        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
235    );
236}
237
238extern_class!(
239    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenedestructionrequestoptions?language=objc)
240    #[unsafe(super(NSObject))]
241    #[thread_kind = MainThreadOnly]
242    #[derive(Debug, PartialEq, Eq, Hash)]
243    pub struct UISceneDestructionRequestOptions;
244);
245
246extern_conformance!(
247    unsafe impl NSObjectProtocol for UISceneDestructionRequestOptions {}
248);
249
250impl UISceneDestructionRequestOptions {
251    extern_methods!();
252}
253
254/// Methods declared on superclass `NSObject`.
255impl UISceneDestructionRequestOptions {
256    extern_methods!(
257        #[unsafe(method(init))]
258        #[unsafe(method_family = init)]
259        pub fn init(this: Allocated<Self>) -> Retained<Self>;
260
261        #[unsafe(method(new))]
262        #[unsafe(method_family = new)]
263        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
264    );
265}