1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-cloud-kit")]
use objc2_cloud_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
    pub struct UIWindowScene;

    #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
    unsafe impl ClassType for UIWindowScene {
        #[inherits(UIResponder, NSObject)]
        type Super = UIScene;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
unsafe impl NSObjectProtocol for UIWindowScene {}

#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
unsafe impl UIResponderStandardEditActions for UIWindowScene {}

extern_methods!(
    #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
    unsafe impl UIWindowScene {
        #[cfg(feature = "UIScreen")]
        #[method_id(@__retain_semantics Other screen)]
        pub unsafe fn screen(&self) -> Retained<UIScreen>;

        #[cfg(feature = "UIOrientation")]
        #[method(interfaceOrientation)]
        pub unsafe fn interfaceOrientation(&self) -> UIInterfaceOrientation;

        #[cfg(feature = "UIView")]
        #[method_id(@__retain_semantics Other coordinateSpace)]
        pub unsafe fn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>;

        #[cfg(feature = "UITraitCollection")]
        #[method_id(@__retain_semantics Other traitCollection)]
        pub unsafe fn traitCollection(&self) -> Retained<UITraitCollection>;

        #[cfg(all(feature = "UIWindowSceneGeometryPreferences", feature = "block2"))]
        #[method(requestGeometryUpdateWithPreferences:errorHandler:)]
        pub unsafe fn requestGeometryUpdateWithPreferences_errorHandler(
            &self,
            geometry_preferences: &UIWindowSceneGeometryPreferences,
            error_handler: Option<&block2::Block<dyn Fn(NonNull<NSError>)>>,
        );

        #[cfg(feature = "UIWindowSceneGeometry")]
        #[method_id(@__retain_semantics Other effectiveGeometry)]
        pub unsafe fn effectiveGeometry(&self) -> Retained<UIWindowSceneGeometry>;

        #[method_id(@__retain_semantics Other sizeRestrictions)]
        pub unsafe fn sizeRestrictions(&self) -> Option<Retained<UISceneSizeRestrictions>>;

        #[cfg(all(feature = "UIView", feature = "UIWindow"))]
        #[method_id(@__retain_semantics Other windows)]
        pub unsafe fn windows(&self) -> Retained<NSArray<UIWindow>>;

        #[cfg(all(feature = "UIView", feature = "UIWindow"))]
        #[method_id(@__retain_semantics Other keyWindow)]
        pub unsafe fn keyWindow(&self) -> Option<Retained<UIWindow>>;

        #[cfg(feature = "UIActivityItemsConfigurationReading")]
        #[method_id(@__retain_semantics Other activityItemsConfigurationSource)]
        pub unsafe fn activityItemsConfigurationSource(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIActivityItemsConfigurationProviding>>>;

        #[cfg(feature = "UIActivityItemsConfigurationReading")]
        #[method(setActivityItemsConfigurationSource:)]
        pub unsafe fn setActivityItemsConfigurationSource(
            &self,
            activity_items_configuration_source: Option<
                &ProtocolObject<dyn UIActivityItemsConfigurationProviding>,
            >,
        );

        #[cfg(feature = "UISceneWindowingBehaviors")]
        #[method_id(@__retain_semantics Other windowingBehaviors)]
        pub unsafe fn windowingBehaviors(&self) -> Option<Retained<UISceneWindowingBehaviors>>;

        #[method(isFullScreen)]
        pub unsafe fn isFullScreen(&self) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `UIScene`
    #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
    unsafe impl UIWindowScene {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(feature = "UISceneOptions", feature = "UISceneSession"))]
        #[method_id(@__retain_semantics Init initWithSession:connectionOptions:)]
        pub unsafe fn initWithSession_connectionOptions(
            this: Allocated<Self>,
            session: &UISceneSession,
            connection_options: &UISceneConnectionOptions,
        ) -> Retained<Self>;
    }
);

extern_methods!(
    #[cfg(all(feature = "UIResponder", feature = "UIScene"))]
    unsafe impl UIWindowScene {
        #[cfg(feature = "UITraitCollection")]
        #[method_id(@__retain_semantics Other traitOverrides)]
        pub unsafe fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>;
    }
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIScene",
    feature = "UITraitCollection"
))]
unsafe impl UITraitChangeObservable for UIWindowScene {}

#[cfg(all(
    feature = "UIResponder",
    feature = "UIScene",
    feature = "UITraitCollection"
))]
unsafe impl UITraitEnvironment for UIWindowScene {}

extern_protocol!(
    #[cfg(feature = "UIScene")]
    pub unsafe trait UIWindowSceneDelegate: UISceneDelegate + IsMainThreadOnly {
        #[cfg(all(feature = "UIResponder", feature = "UIView", feature = "UIWindow"))]
        #[optional]
        #[method_id(@__retain_semantics Other window)]
        unsafe fn window(&self) -> Option<Retained<UIWindow>>;

        #[cfg(all(feature = "UIResponder", feature = "UIView", feature = "UIWindow"))]
        #[optional]
        #[method(setWindow:)]
        unsafe fn setWindow(&self, window: Option<&UIWindow>);

        #[cfg(all(
            feature = "UIOrientation",
            feature = "UIResponder",
            feature = "UITraitCollection",
            feature = "UIView"
        ))]
        #[optional]
        #[method(windowScene:didUpdateCoordinateSpace:interfaceOrientation:traitCollection:)]
        unsafe fn windowScene_didUpdateCoordinateSpace_interfaceOrientation_traitCollection(
            &self,
            window_scene: &UIWindowScene,
            previous_coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
            previous_interface_orientation: UIInterfaceOrientation,
            previous_trait_collection: &UITraitCollection,
        );

        #[cfg(all(
            feature = "UIApplicationShortcutItem",
            feature = "UIResponder",
            feature = "block2"
        ))]
        #[optional]
        #[method(windowScene:performActionForShortcutItem:completionHandler:)]
        unsafe fn windowScene_performActionForShortcutItem_completionHandler(
            &self,
            window_scene: &UIWindowScene,
            shortcut_item: &UIApplicationShortcutItem,
            completion_handler: &block2::Block<dyn Fn(Bool)>,
        );

        #[cfg(all(feature = "UIResponder", feature = "objc2-cloud-kit"))]
        #[optional]
        #[method(windowScene:userDidAcceptCloudKitShareWithMetadata:)]
        unsafe fn windowScene_userDidAcceptCloudKitShareWithMetadata(
            &self,
            window_scene: &UIWindowScene,
            cloud_kit_share_metadata: &CKShareMetadata,
        );
    }

    #[cfg(feature = "UIScene")]
    unsafe impl ProtocolType for dyn UIWindowSceneDelegate {}
);

extern "C" {
    #[cfg(feature = "UISceneDefinitions")]
    pub static UIWindowSceneSessionRoleApplication: &'static UISceneSessionRole;
}

extern "C" {
    #[cfg(feature = "UISceneDefinitions")]
    pub static UIWindowSceneSessionRoleExternalDisplayNonInteractive: &'static UISceneSessionRole;
}

extern "C" {
    #[cfg(feature = "UISceneDefinitions")]
    pub static UIWindowSceneSessionRoleExternalDisplay: &'static UISceneSessionRole;
}

extern "C" {
    #[cfg(feature = "UISceneDefinitions")]
    pub static UIWindowSceneSessionRoleVolumetricApplication: &'static UISceneSessionRole;
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIWindowSceneDismissalAnimation(pub NSInteger);
impl UIWindowSceneDismissalAnimation {
    #[doc(alias = "UIWindowSceneDismissalAnimationStandard")]
    pub const Standard: Self = Self(1);
    #[doc(alias = "UIWindowSceneDismissalAnimationCommit")]
    pub const Commit: Self = Self(2);
    #[doc(alias = "UIWindowSceneDismissalAnimationDecline")]
    pub const Decline: Self = Self(3);
}

unsafe impl Encode for UIWindowSceneDismissalAnimation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIWindowSceneDismissalAnimation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "UISceneOptions")]
    pub struct UIWindowSceneDestructionRequestOptions;

    #[cfg(feature = "UISceneOptions")]
    unsafe impl ClassType for UIWindowSceneDestructionRequestOptions {
        #[inherits(NSObject)]
        type Super = UISceneDestructionRequestOptions;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(feature = "UISceneOptions")]
unsafe impl NSObjectProtocol for UIWindowSceneDestructionRequestOptions {}

extern_methods!(
    #[cfg(feature = "UISceneOptions")]
    unsafe impl UIWindowSceneDestructionRequestOptions {
        #[method(windowDismissalAnimation)]
        pub unsafe fn windowDismissalAnimation(&self) -> UIWindowSceneDismissalAnimation;

        #[method(setWindowDismissalAnimation:)]
        pub unsafe fn setWindowDismissalAnimation(
            &self,
            window_dismissal_animation: UIWindowSceneDismissalAnimation,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "UISceneOptions")]
    unsafe impl UIWindowSceneDestructionRequestOptions {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UISceneSizeRestrictions;

    unsafe impl ClassType for UISceneSizeRestrictions {
        type Super = NSObject;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSObjectProtocol for UISceneSizeRestrictions {}

extern_methods!(
    unsafe impl UISceneSizeRestrictions {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

        #[method(minimumSize)]
        pub unsafe fn minimumSize(&self) -> CGSize;

        #[method(setMinimumSize:)]
        pub unsafe fn setMinimumSize(&self, minimum_size: CGSize);

        #[method(maximumSize)]
        pub unsafe fn maximumSize(&self) -> CGSize;

        #[method(setMaximumSize:)]
        pub unsafe fn setMaximumSize(&self, maximum_size: CGSize);

        #[method(allowsFullScreen)]
        pub unsafe fn allowsFullScreen(&self) -> bool;

        #[method(setAllowsFullScreen:)]
        pub unsafe fn setAllowsFullScreen(&self, allows_full_screen: bool);
    }
);