objc2_app_kit/generated/
NSApplication.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2::__framework_prelude::*;
8#[cfg(feature = "objc2-cloud-kit")]
9#[cfg(target_vendor = "apple")]
10use objc2_cloud_kit::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversion?language=objc)
16// NS_TYPED_EXTENSIBLE_ENUM
17pub type NSAppKitVersion = c_double;
18
19extern "C" {
20    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber?language=objc)
21    pub static NSAppKitVersionNumber: NSAppKitVersion;
22}
23
24/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_0?language=objc)
25pub static NSAppKitVersionNumber10_0: NSAppKitVersion = 577 as _;
26
27/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_1?language=objc)
28pub static NSAppKitVersionNumber10_1: NSAppKitVersion = 620 as _;
29
30/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_2?language=objc)
31pub static NSAppKitVersionNumber10_2: NSAppKitVersion = 663 as _;
32
33/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_2_3?language=objc)
34pub static NSAppKitVersionNumber10_2_3: NSAppKitVersion = 663.6 as _;
35
36/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_3?language=objc)
37pub static NSAppKitVersionNumber10_3: NSAppKitVersion = 743 as _;
38
39/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_3_2?language=objc)
40pub static NSAppKitVersionNumber10_3_2: NSAppKitVersion = 743.14 as _;
41
42/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_3_3?language=objc)
43pub static NSAppKitVersionNumber10_3_3: NSAppKitVersion = 743.2 as _;
44
45/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_3_5?language=objc)
46pub static NSAppKitVersionNumber10_3_5: NSAppKitVersion = 743.24 as _;
47
48/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_3_7?language=objc)
49pub static NSAppKitVersionNumber10_3_7: NSAppKitVersion = 743.33 as _;
50
51/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_3_9?language=objc)
52pub static NSAppKitVersionNumber10_3_9: NSAppKitVersion = 743.36 as _;
53
54/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_4?language=objc)
55pub static NSAppKitVersionNumber10_4: NSAppKitVersion = 824 as _;
56
57/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_4_1?language=objc)
58pub static NSAppKitVersionNumber10_4_1: NSAppKitVersion = 824.1 as _;
59
60/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_4_3?language=objc)
61pub static NSAppKitVersionNumber10_4_3: NSAppKitVersion = 824.23 as _;
62
63/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_4_4?language=objc)
64pub static NSAppKitVersionNumber10_4_4: NSAppKitVersion = 824.33 as _;
65
66/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_4_7?language=objc)
67pub static NSAppKitVersionNumber10_4_7: NSAppKitVersion = 824.41 as _;
68
69/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_5?language=objc)
70pub static NSAppKitVersionNumber10_5: NSAppKitVersion = 949 as _;
71
72/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_5_2?language=objc)
73pub static NSAppKitVersionNumber10_5_2: NSAppKitVersion = 949.27 as _;
74
75/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_5_3?language=objc)
76pub static NSAppKitVersionNumber10_5_3: NSAppKitVersion = 949.33 as _;
77
78/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_6?language=objc)
79pub static NSAppKitVersionNumber10_6: NSAppKitVersion = 1038 as _;
80
81/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_7?language=objc)
82pub static NSAppKitVersionNumber10_7: NSAppKitVersion = 1138 as _;
83
84/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_7_2?language=objc)
85pub static NSAppKitVersionNumber10_7_2: NSAppKitVersion = 1138.23 as _;
86
87/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_7_3?language=objc)
88pub static NSAppKitVersionNumber10_7_3: NSAppKitVersion = 1138.32 as _;
89
90/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_7_4?language=objc)
91pub static NSAppKitVersionNumber10_7_4: NSAppKitVersion = 1138.47 as _;
92
93/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_8?language=objc)
94pub static NSAppKitVersionNumber10_8: NSAppKitVersion = 1187 as _;
95
96/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_9?language=objc)
97pub static NSAppKitVersionNumber10_9: NSAppKitVersion = 1265 as _;
98
99/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_10?language=objc)
100pub static NSAppKitVersionNumber10_10: NSAppKitVersion = 1343 as _;
101
102/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_10_2?language=objc)
103pub static NSAppKitVersionNumber10_10_2: NSAppKitVersion = 1344 as _;
104
105/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_10_3?language=objc)
106pub static NSAppKitVersionNumber10_10_3: NSAppKitVersion = 1347 as _;
107
108/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_10_4?language=objc)
109pub static NSAppKitVersionNumber10_10_4: NSAppKitVersion = 1348 as _;
110
111/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_10_5?language=objc)
112pub static NSAppKitVersionNumber10_10_5: NSAppKitVersion = 1348 as _;
113
114/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_10_max?language=objc)
115pub static NSAppKitVersionNumber10_10_Max: NSAppKitVersion = 1349 as _;
116
117/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_11?language=objc)
118pub static NSAppKitVersionNumber10_11: NSAppKitVersion = 1404 as _;
119
120/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_11_1?language=objc)
121pub static NSAppKitVersionNumber10_11_1: NSAppKitVersion = 1404.13 as _;
122
123/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_11_2?language=objc)
124pub static NSAppKitVersionNumber10_11_2: NSAppKitVersion = 1404.34 as _;
125
126/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_11_3?language=objc)
127pub static NSAppKitVersionNumber10_11_3: NSAppKitVersion = 1404.34 as _;
128
129/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_12?language=objc)
130pub static NSAppKitVersionNumber10_12: NSAppKitVersion = 1504 as _;
131
132/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_12_1?language=objc)
133pub static NSAppKitVersionNumber10_12_1: NSAppKitVersion = 1504.6 as _;
134
135/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_12_2?language=objc)
136pub static NSAppKitVersionNumber10_12_2: NSAppKitVersion = 1504.76 as _;
137
138/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_13?language=objc)
139pub static NSAppKitVersionNumber10_13: NSAppKitVersion = 1561 as _;
140
141/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_13_1?language=objc)
142pub static NSAppKitVersionNumber10_13_1: NSAppKitVersion = 1561.1 as _;
143
144/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_13_2?language=objc)
145pub static NSAppKitVersionNumber10_13_2: NSAppKitVersion = 1561.2 as _;
146
147/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_13_4?language=objc)
148pub static NSAppKitVersionNumber10_13_4: NSAppKitVersion = 1561.4 as _;
149
150/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_14?language=objc)
151pub static NSAppKitVersionNumber10_14: NSAppKitVersion = 1671 as _;
152
153/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_14_1?language=objc)
154pub static NSAppKitVersionNumber10_14_1: NSAppKitVersion = 1671.1 as _;
155
156/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_14_2?language=objc)
157pub static NSAppKitVersionNumber10_14_2: NSAppKitVersion = 1671.2 as _;
158
159/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_14_3?language=objc)
160pub static NSAppKitVersionNumber10_14_3: NSAppKitVersion = 1671.3 as _;
161
162/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_14_4?language=objc)
163pub static NSAppKitVersionNumber10_14_4: NSAppKitVersion = 1671.4 as _;
164
165/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_14_5?language=objc)
166pub static NSAppKitVersionNumber10_14_5: NSAppKitVersion = 1671.5 as _;
167
168/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15?language=objc)
169pub static NSAppKitVersionNumber10_15: NSAppKitVersion = 1894 as _;
170
171/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15_1?language=objc)
172pub static NSAppKitVersionNumber10_15_1: NSAppKitVersion = 1894.1 as _;
173
174/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15_2?language=objc)
175pub static NSAppKitVersionNumber10_15_2: NSAppKitVersion = 1894.2 as _;
176
177/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15_3?language=objc)
178pub static NSAppKitVersionNumber10_15_3: NSAppKitVersion = 1894.3 as _;
179
180/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15_4?language=objc)
181pub static NSAppKitVersionNumber10_15_4: NSAppKitVersion = 1894.4 as _;
182
183/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15_5?language=objc)
184pub static NSAppKitVersionNumber10_15_5: NSAppKitVersion = 1894.5 as _;
185
186/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber10_15_6?language=objc)
187pub static NSAppKitVersionNumber10_15_6: NSAppKitVersion = 1894.6 as _;
188
189/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber11_0?language=objc)
190pub static NSAppKitVersionNumber11_0: NSAppKitVersion = 2022 as _;
191
192/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber11_1?language=objc)
193pub static NSAppKitVersionNumber11_1: NSAppKitVersion = 2022.2 as _;
194
195/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber11_2?language=objc)
196pub static NSAppKitVersionNumber11_2: NSAppKitVersion = 2022.3 as _;
197
198/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber11_3?language=objc)
199pub static NSAppKitVersionNumber11_3: NSAppKitVersion = 2022.4 as _;
200
201/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber11_4?language=objc)
202pub static NSAppKitVersionNumber11_4: NSAppKitVersion = 2022.5 as _;
203
204/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber11_5?language=objc)
205pub static NSAppKitVersionNumber11_5: NSAppKitVersion = 2022.6 as _;
206
207/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber12_0?language=objc)
208pub static NSAppKitVersionNumber12_0: NSAppKitVersion = 2113 as _;
209
210/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber12_1?language=objc)
211pub static NSAppKitVersionNumber12_1: NSAppKitVersion = 2113.2 as _;
212
213/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber12_2?language=objc)
214pub static NSAppKitVersionNumber12_2: NSAppKitVersion = 2113.3 as _;
215
216/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber12_3?language=objc)
217pub static NSAppKitVersionNumber12_3: NSAppKitVersion = 2113.4 as _;
218
219/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber12_4?language=objc)
220pub static NSAppKitVersionNumber12_4: NSAppKitVersion = 2113.5 as _;
221
222/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber12_5?language=objc)
223pub static NSAppKitVersionNumber12_5: NSAppKitVersion = 2113.6 as _;
224
225/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_0?language=objc)
226pub static NSAppKitVersionNumber13_0: NSAppKitVersion = 2299 as _;
227
228/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_1?language=objc)
229pub static NSAppKitVersionNumber13_1: NSAppKitVersion = 2299.3 as _;
230
231/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_2?language=objc)
232pub static NSAppKitVersionNumber13_2: NSAppKitVersion = 2299.3 as _;
233
234/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_3?language=objc)
235pub static NSAppKitVersionNumber13_3: NSAppKitVersion = 2299.4 as _;
236
237/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_4?language=objc)
238pub static NSAppKitVersionNumber13_4: NSAppKitVersion = 2299.5 as _;
239
240/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_5?language=objc)
241pub static NSAppKitVersionNumber13_5: NSAppKitVersion = 2299.6 as _;
242
243/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber13_6?language=objc)
244pub static NSAppKitVersionNumber13_6: NSAppKitVersion = 2299.7 as _;
245
246/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber14_0?language=objc)
247pub static NSAppKitVersionNumber14_0: NSAppKitVersion = 2487 as _;
248
249/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumber14_1?language=objc)
250pub static NSAppKitVersionNumber14_1: NSAppKitVersion = 2487.2 as _;
251
252extern "C" {
253    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalpanelrunloopmode?language=objc)
254    pub static NSModalPanelRunLoopMode: &'static NSRunLoopMode;
255}
256
257extern "C" {
258    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nseventtrackingrunloopmode?language=objc)
259    pub static NSEventTrackingRunLoopMode: &'static NSRunLoopMode;
260}
261
262/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalresponse?language=objc)
263// NS_TYPED_EXTENSIBLE_ENUM
264pub type NSModalResponse = NSInteger;
265
266/// Also used as the default response for sheets
267///
268/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalresponsestop?language=objc)
269pub static NSModalResponseStop: NSModalResponse = -1000;
270
271/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalresponseabort?language=objc)
272pub static NSModalResponseAbort: NSModalResponse = -1001;
273
274/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalresponsecontinue?language=objc)
275pub static NSModalResponseContinue: NSModalResponse = -1002;
276
277/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsupdatewindowsrunloopordering?language=objc)
278pub const NSUpdateWindowsRunLoopOrdering: c_uint = 500000;
279
280/// Flags that comprise an application's
281/// `presentationOptions.`
282///
283/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationpresentationoptions?language=objc)
284// NS_OPTIONS
285#[repr(transparent)]
286#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
287pub struct NSApplicationPresentationOptions(pub NSUInteger);
288bitflags::bitflags! {
289    impl NSApplicationPresentationOptions: NSUInteger {
290        #[doc(alias = "NSApplicationPresentationDefault")]
291        const Default = 0;
292/// Dock appears when moused to.
293        #[doc(alias = "NSApplicationPresentationAutoHideDock")]
294        const AutoHideDock = 1<<0;
295/// Dock is entirely unavailable.
296        #[doc(alias = "NSApplicationPresentationHideDock")]
297        const HideDock = 1<<1;
298/// Menu Bar appears when moused to.
299        #[doc(alias = "NSApplicationPresentationAutoHideMenuBar")]
300        const AutoHideMenuBar = 1<<2;
301/// Menu Bar is entirely unavailable.
302        #[doc(alias = "NSApplicationPresentationHideMenuBar")]
303        const HideMenuBar = 1<<3;
304/// All Apple menu items are disabled.
305        #[doc(alias = "NSApplicationPresentationDisableAppleMenu")]
306        const DisableAppleMenu = 1<<4;
307/// Cmd+Tab UI is disabled.
308        #[doc(alias = "NSApplicationPresentationDisableProcessSwitching")]
309        const DisableProcessSwitching = 1<<5;
310/// Cmd+Opt+Esc panel is disabled.
311        #[doc(alias = "NSApplicationPresentationDisableForceQuit")]
312        const DisableForceQuit = 1<<6;
313/// PowerKey panel and Restart/Shut Down/Log Out disabled.
314        #[doc(alias = "NSApplicationPresentationDisableSessionTermination")]
315        const DisableSessionTermination = 1<<7;
316/// Application "Hide" menu item is disabled.
317        #[doc(alias = "NSApplicationPresentationDisableHideApplication")]
318        const DisableHideApplication = 1<<8;
319/// Menu Bar's transparent appearance is disabled.
320        #[doc(alias = "NSApplicationPresentationDisableMenuBarTransparency")]
321        const DisableMenuBarTransparency = 1<<9;
322/// Application is in fullscreen mode.
323        #[doc(alias = "NSApplicationPresentationFullScreen")]
324        const FullScreen = 1<<10;
325/// Fullscreen window toolbar is detached from window and hides/shows on rollover.
326/// May be used only when both
327/// `NSApplicationPresentationFullScreen`is also set.
328        #[doc(alias = "NSApplicationPresentationAutoHideToolbar")]
329        const AutoHideToolbar = 1<<11;
330/// "Shake mouse pointer to locate" is disabled for this application.
331        #[doc(alias = "NSApplicationPresentationDisableCursorLocationAssistance")]
332        const DisableCursorLocationAssistance = 1<<12;
333    }
334}
335
336unsafe impl Encode for NSApplicationPresentationOptions {
337    const ENCODING: Encoding = NSUInteger::ENCODING;
338}
339
340unsafe impl RefEncode for NSApplicationPresentationOptions {
341    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
342}
343
344/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationocclusionstate?language=objc)
345// NS_OPTIONS
346#[repr(transparent)]
347#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
348pub struct NSApplicationOcclusionState(pub NSUInteger);
349bitflags::bitflags! {
350    impl NSApplicationOcclusionState: NSUInteger {
351/// If set, at least part of any window owned by this application is visible. If not set, all parts of all windows owned by this application are completely occluded. The menu bar does not count as a window owned by this application, so if only the menu bar is showing then the application is considered not visible. Status items, however, have windows owned by your application. If the status item is present in the menu bar, your application will be considered visible as long as the menu bar is visible.
352        #[doc(alias = "NSApplicationOcclusionStateVisible")]
353        const Visible = 1<<1;
354    }
355}
356
357unsafe impl Encode for NSApplicationOcclusionState {
358    const ENCODING: Encoding = NSUInteger::ENCODING;
359}
360
361unsafe impl RefEncode for NSApplicationOcclusionState {
362    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
363}
364
365/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowlistoptions?language=objc)
366// NS_OPTIONS
367#[repr(transparent)]
368#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
369pub struct NSWindowListOptions(pub NSInteger);
370bitflags::bitflags! {
371    impl NSWindowListOptions: NSInteger {
372/// Onscreen application windows in front to back order. By default, -[NSApp windows] is used.
373        #[doc(alias = "NSWindowListOrderedFrontToBack")]
374        const OrderedFrontToBack = 1<<0;
375    }
376}
377
378unsafe impl Encode for NSWindowListOptions {
379    const ENCODING: Encoding = NSInteger::ENCODING;
380}
381
382unsafe impl RefEncode for NSWindowListOptions {
383    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
384}
385
386/// [Apple's documentation](https://developer.apple.com/documentation/appkit/_nsmodalsession?language=objc)
387#[repr(C)]
388#[derive(Debug)]
389pub struct _NSModalSession {
390    inner: [u8; 0],
391    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
392}
393
394unsafe impl RefEncode for _NSModalSession {
395    const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("_NSModalSession", &[]));
396}
397
398/// Information used by the system during modal sessions.
399///
400/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalsession?language=objc)
401pub type NSModalSession = *mut _NSModalSession;
402
403/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype?language=objc)
404// NS_ENUM
405#[repr(transparent)]
406#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
407pub struct NSRequestUserAttentionType(pub NSUInteger);
408impl NSRequestUserAttentionType {
409    #[doc(alias = "NSCriticalRequest")]
410    pub const CriticalRequest: Self = Self(0);
411    #[doc(alias = "NSInformationalRequest")]
412    pub const InformationalRequest: Self = Self(10);
413}
414
415unsafe impl Encode for NSRequestUserAttentionType {
416    const ENCODING: Encoding = NSUInteger::ENCODING;
417}
418
419unsafe impl RefEncode for NSRequestUserAttentionType {
420    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
421}
422
423/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdelegatereply?language=objc)
424// NS_ENUM
425#[repr(transparent)]
426#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
427pub struct NSApplicationDelegateReply(pub NSUInteger);
428impl NSApplicationDelegateReply {
429    #[doc(alias = "NSApplicationDelegateReplySuccess")]
430    pub const Success: Self = Self(0);
431    #[doc(alias = "NSApplicationDelegateReplyCancel")]
432    pub const Cancel: Self = Self(1);
433    #[doc(alias = "NSApplicationDelegateReplyFailure")]
434    pub const Failure: Self = Self(2);
435}
436
437unsafe impl Encode for NSApplicationDelegateReply {
438    const ENCODING: Encoding = NSUInteger::ENCODING;
439}
440
441unsafe impl RefEncode for NSApplicationDelegateReply {
442    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
443}
444
445extern_class!(
446    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplication?language=objc)
447    #[unsafe(super(NSResponder, NSObject))]
448    #[derive(Debug, PartialEq, Eq, Hash)]
449    #[cfg(feature = "NSResponder")]
450    pub struct NSApplication;
451);
452
453#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
454extern_conformance!(
455    unsafe impl NSAccessibility for NSApplication {}
456);
457
458#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
459extern_conformance!(
460    unsafe impl NSAccessibilityElementProtocol for NSApplication {}
461);
462
463#[cfg(feature = "NSResponder")]
464extern_conformance!(
465    unsafe impl NSCoding for NSApplication {}
466);
467
468#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
469extern_conformance!(
470    unsafe impl NSMenuItemValidation for NSApplication {}
471);
472
473#[cfg(feature = "NSResponder")]
474extern_conformance!(
475    unsafe impl NSObjectProtocol for NSApplication {}
476);
477
478#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
479extern_conformance!(
480    unsafe impl NSUserInterfaceValidations for NSApplication {}
481);
482
483#[cfg(feature = "NSResponder")]
484impl NSApplication {
485    extern_methods!(
486        #[unsafe(method(sharedApplication))]
487        #[unsafe(method_family = none)]
488        pub fn sharedApplication(mtm: MainThreadMarker) -> Retained<NSApplication>;
489
490        #[unsafe(method(delegate))]
491        #[unsafe(method_family = none)]
492        pub unsafe fn delegate(
493            &self,
494        ) -> Option<Retained<ProtocolObject<dyn NSApplicationDelegate>>>;
495
496        /// This is a [weak property][objc2::topics::weak_property].
497        /// Setter for [`delegate`][Self::delegate].
498        #[unsafe(method(setDelegate:))]
499        #[unsafe(method_family = none)]
500        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSApplicationDelegate>>);
501
502        #[unsafe(method(hide:))]
503        #[unsafe(method_family = none)]
504        pub fn hide(&self, sender: Option<&AnyObject>);
505
506        #[unsafe(method(unhide:))]
507        #[unsafe(method_family = none)]
508        pub unsafe fn unhide(&self, sender: Option<&AnyObject>);
509
510        #[unsafe(method(unhideWithoutActivation))]
511        #[unsafe(method_family = none)]
512        pub unsafe fn unhideWithoutActivation(&self);
513
514        #[cfg(feature = "NSWindow")]
515        #[unsafe(method(windowWithWindowNumber:))]
516        #[unsafe(method_family = none)]
517        pub unsafe fn windowWithWindowNumber(
518            &self,
519            window_num: NSInteger,
520        ) -> Option<Retained<NSWindow>>;
521
522        #[cfg(feature = "NSWindow")]
523        #[unsafe(method(mainWindow))]
524        #[unsafe(method_family = none)]
525        pub unsafe fn mainWindow(&self) -> Option<Retained<NSWindow>>;
526
527        #[cfg(feature = "NSWindow")]
528        #[unsafe(method(keyWindow))]
529        #[unsafe(method_family = none)]
530        pub fn keyWindow(&self) -> Option<Retained<NSWindow>>;
531
532        #[unsafe(method(isActive))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn isActive(&self) -> bool;
535
536        #[unsafe(method(isHidden))]
537        #[unsafe(method_family = none)]
538        pub unsafe fn isHidden(&self) -> bool;
539
540        #[unsafe(method(isRunning))]
541        #[unsafe(method_family = none)]
542        pub unsafe fn isRunning(&self) -> bool;
543
544        #[unsafe(method(deactivate))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn deactivate(&self);
547
548        /// Makes the receiver the active app.
549        /// - Parameter ignoreOtherApps: If `NO`, the app is activated only if no other app is currently active. If `YES`, the app activates regardless.
550        #[deprecated = "This method will be deprecated in a future release. Use NSApp.activate instead."]
551        #[unsafe(method(activateIgnoringOtherApps:))]
552        #[unsafe(method_family = none)]
553        pub fn activateIgnoringOtherApps(&self, ignore_other_apps: bool);
554
555        /// Makes the receiver the active app, if possible.
556        ///
557        /// You shouldn’t assume the app will be active immediately
558        /// after sending this message. The framework also does not
559        /// guarantee that the app will be activated at all.
560        ///
561        /// For cooperative activation, the other application should
562        /// call `-yieldActivationToApplication:` or equivalent prior
563        /// to the target application invoking `-activate`.
564        ///
565        /// Invoking `-activate` on an already-active application
566        /// cancels any pending activation yields by the receiver.
567        #[unsafe(method(activate))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn activate(&self);
570
571        #[cfg(feature = "NSRunningApplication")]
572        /// Explicitly allows another application to make itself active.
573        ///
574        /// Calling this method will not deactivate the current app, nor
575        /// will it activate the other app. For cooperative or coordinated
576        /// activation, the other app should request to be activated at
577        /// some point in the future by calling `activate` or equivalent.
578        #[unsafe(method(yieldActivationToApplication:))]
579        #[unsafe(method_family = none)]
580        pub unsafe fn yieldActivationToApplication(&self, application: &NSRunningApplication);
581
582        /// Same as `-yieldActivationToApplication:`, but the provided
583        /// bundle identifier does not have to correspond to a currently
584        /// running application.
585        ///
586        /// This method should be used to yield activation to apps that
587        /// may not be running at the time of invoking it. If it is known
588        /// that the target application is currently running, use
589        /// `-yieldActivationToApplication:` instead.
590        #[unsafe(method(yieldActivationToApplicationWithBundleIdentifier:))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn yieldActivationToApplicationWithBundleIdentifier(
593            &self,
594            bundle_identifier: &NSString,
595        );
596
597        #[unsafe(method(hideOtherApplications:))]
598        #[unsafe(method_family = none)]
599        pub fn hideOtherApplications(&self, sender: Option<&AnyObject>);
600
601        #[unsafe(method(unhideAllApplications:))]
602        #[unsafe(method_family = none)]
603        pub unsafe fn unhideAllApplications(&self, sender: Option<&AnyObject>);
604
605        #[unsafe(method(finishLaunching))]
606        #[unsafe(method_family = none)]
607        pub unsafe fn finishLaunching(&self);
608
609        #[unsafe(method(run))]
610        #[unsafe(method_family = none)]
611        pub fn run(&self);
612
613        #[cfg(feature = "NSWindow")]
614        #[unsafe(method(runModalForWindow:))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn runModalForWindow(&self, window: &NSWindow) -> NSModalResponse;
617
618        #[unsafe(method(stop:))]
619        #[unsafe(method_family = none)]
620        pub fn stop(&self, sender: Option<&AnyObject>);
621
622        #[unsafe(method(stopModal))]
623        #[unsafe(method_family = none)]
624        pub unsafe fn stopModal(&self);
625
626        #[unsafe(method(stopModalWithCode:))]
627        #[unsafe(method_family = none)]
628        pub unsafe fn stopModalWithCode(&self, return_code: NSModalResponse);
629
630        #[unsafe(method(abortModal))]
631        #[unsafe(method_family = none)]
632        pub unsafe fn abortModal(&self);
633
634        #[cfg(feature = "NSWindow")]
635        #[unsafe(method(modalWindow))]
636        #[unsafe(method_family = none)]
637        pub unsafe fn modalWindow(&self) -> Option<Retained<NSWindow>>;
638
639        #[cfg(feature = "NSWindow")]
640        #[unsafe(method(beginModalSessionForWindow:))]
641        #[unsafe(method_family = none)]
642        pub unsafe fn beginModalSessionForWindow(&self, window: &NSWindow) -> NSModalSession;
643
644        #[unsafe(method(runModalSession:))]
645        #[unsafe(method_family = none)]
646        pub unsafe fn runModalSession(&self, session: NSModalSession) -> NSModalResponse;
647
648        #[unsafe(method(endModalSession:))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn endModalSession(&self, session: NSModalSession);
651
652        #[unsafe(method(terminate:))]
653        #[unsafe(method_family = none)]
654        pub unsafe fn terminate(&self, sender: Option<&AnyObject>);
655
656        /// Inform the user that this application needs attention - call this method only if your application is not already active.
657        #[unsafe(method(requestUserAttention:))]
658        #[unsafe(method_family = none)]
659        pub fn requestUserAttention(&self, request_type: NSRequestUserAttentionType) -> NSInteger;
660
661        #[unsafe(method(cancelUserAttentionRequest:))]
662        #[unsafe(method_family = none)]
663        pub unsafe fn cancelUserAttentionRequest(&self, request: NSInteger);
664
665        #[cfg(all(feature = "NSWindow", feature = "block2"))]
666        /// Execute a block for each of the app's windows. Set `*stop = YES` if desired, to halt the enumeration early.
667        #[unsafe(method(enumerateWindowsWithOptions:usingBlock:))]
668        #[unsafe(method_family = none)]
669        pub unsafe fn enumerateWindowsWithOptions_usingBlock(
670            &self,
671            options: NSWindowListOptions,
672            block: &block2::DynBlock<dyn Fn(NonNull<NSWindow>, NonNull<Bool>) + '_>,
673        );
674
675        #[unsafe(method(preventWindowOrdering))]
676        #[unsafe(method_family = none)]
677        pub unsafe fn preventWindowOrdering(&self);
678
679        #[cfg(feature = "NSWindow")]
680        #[unsafe(method(windows))]
681        #[unsafe(method_family = none)]
682        pub fn windows(&self) -> Retained<NSArray<NSWindow>>;
683
684        #[unsafe(method(setWindowsNeedUpdate:))]
685        #[unsafe(method_family = none)]
686        pub unsafe fn setWindowsNeedUpdate(&self, need_update: bool);
687
688        #[unsafe(method(updateWindows))]
689        #[unsafe(method_family = none)]
690        pub unsafe fn updateWindows(&self);
691
692        #[cfg(feature = "NSMenu")]
693        #[unsafe(method(mainMenu))]
694        #[unsafe(method_family = none)]
695        pub unsafe fn mainMenu(&self) -> Option<Retained<NSMenu>>;
696
697        #[cfg(feature = "NSMenu")]
698        /// Setter for [`mainMenu`][Self::mainMenu].
699        #[unsafe(method(setMainMenu:))]
700        #[unsafe(method_family = none)]
701        pub fn setMainMenu(&self, main_menu: Option<&NSMenu>);
702
703        #[cfg(feature = "NSMenu")]
704        /// Set or get the Help menu for the app.  If a non-nil menu is set as the Help menu, Spotlight for Help will be installed in it; otherwise AppKit will install Spotlight for Help into a menu of its choosing (and that menu is not returned from `-helpMenu`).  If you wish to completely suppress Spotlight for Help, you can set a menu that does not appear in the menu bar.
705        /// `NSApplication`retains its Help menu and releases it when a different menu is set.
706        #[unsafe(method(helpMenu))]
707        #[unsafe(method_family = none)]
708        pub unsafe fn helpMenu(&self) -> Option<Retained<NSMenu>>;
709
710        #[cfg(feature = "NSMenu")]
711        /// Setter for [`helpMenu`][Self::helpMenu].
712        #[unsafe(method(setHelpMenu:))]
713        #[unsafe(method_family = none)]
714        pub unsafe fn setHelpMenu(&self, help_menu: Option<&NSMenu>);
715
716        #[cfg(feature = "NSImage")]
717        #[unsafe(method(applicationIconImage))]
718        #[unsafe(method_family = none)]
719        pub unsafe fn applicationIconImage(&self) -> Option<Retained<NSImage>>;
720
721        #[cfg(feature = "NSImage")]
722        /// Setter for [`applicationIconImage`][Self::applicationIconImage].
723        #[unsafe(method(setApplicationIconImage:))]
724        #[unsafe(method_family = none)]
725        pub unsafe fn setApplicationIconImage(&self, application_icon_image: Option<&NSImage>);
726
727        #[cfg(feature = "NSRunningApplication")]
728        /// Returns: The activation policy of the application.
729        #[unsafe(method(activationPolicy))]
730        #[unsafe(method_family = none)]
731        pub unsafe fn activationPolicy(&self) -> NSApplicationActivationPolicy;
732
733        #[cfg(feature = "NSRunningApplication")]
734        /// Attempts to modify the application's activation policy.  In OS X 10.9, any policy may be set; prior to 10.9, the activation policy may be changed to
735        /// `NSApplicationActivationPolicyProhibited`or
736        /// `NSApplicationActivationPolicyRegular,`but may not be changed to
737        /// `NSApplicationActivationPolicyAccessory.`This returns
738        /// `YES`if setting the activation policy is successful, and
739        /// `NO`if not.
740        #[unsafe(method(setActivationPolicy:))]
741        #[unsafe(method_family = none)]
742        pub fn setActivationPolicy(&self, activation_policy: NSApplicationActivationPolicy)
743            -> bool;
744
745        #[cfg(feature = "NSDockTile")]
746        #[unsafe(method(dockTile))]
747        #[unsafe(method_family = none)]
748        pub unsafe fn dockTile(&self) -> Retained<NSDockTile>;
749
750        #[unsafe(method(reportException:))]
751        #[unsafe(method_family = none)]
752        pub unsafe fn reportException(&self, exception: &NSException);
753
754        #[unsafe(method(detachDrawingThread:toTarget:withObject:))]
755        #[unsafe(method_family = none)]
756        pub unsafe fn detachDrawingThread_toTarget_withObject(
757            selector: Sel,
758            target: &AnyObject,
759            argument: Option<&AnyObject>,
760            mtm: MainThreadMarker,
761        );
762
763        /// If an application delegate returns NSTerminateLater from -applicationShouldTerminate:, -replyToApplicationShouldTerminate: must be called with YES or NO once the application decides if it can terminate.
764        #[unsafe(method(replyToApplicationShouldTerminate:))]
765        #[unsafe(method_family = none)]
766        pub unsafe fn replyToApplicationShouldTerminate(&self, should_terminate: bool);
767
768        /// If an application delegate encounters an error while handling `-application:openFiles:` or` -application:printFiles:`, `-replyToOpenOrPrint:` should be called with
769        /// `NSApplicationDelegateReplyFailure.`If the user cancels the operation,
770        /// `NSApplicationDelegateReplyCancel`should be used, and if the operation succeeds,
771        /// `NSApplicationDelegateReplySuccess`should be used .
772        #[unsafe(method(replyToOpenOrPrint:))]
773        #[unsafe(method_family = none)]
774        pub unsafe fn replyToOpenOrPrint(&self, reply: NSApplicationDelegateReply);
775
776        /// Opens the character palette.
777        #[unsafe(method(orderFrontCharacterPalette:))]
778        #[unsafe(method_family = none)]
779        pub fn orderFrontCharacterPalette(&self, sender: Option<&AnyObject>);
780
781        /// Gets or sets the
782        /// `presentationOptions`that should be in effect for the system when this application is the active application.  Only certain combinations of
783        /// `NSApplicationPresentationOptions`flags are allowed, as detailed in the AppKit Release Notes and the reference documentation for `-setPresentationOptions:`.  When given an invalid combination of option flags, `-setPresentationOptions:` raises an exception.
784        #[unsafe(method(presentationOptions))]
785        #[unsafe(method_family = none)]
786        pub fn presentationOptions(&self) -> NSApplicationPresentationOptions;
787
788        /// Setter for [`presentationOptions`][Self::presentationOptions].
789        #[unsafe(method(setPresentationOptions:))]
790        #[unsafe(method_family = none)]
791        pub fn setPresentationOptions(
792            &self,
793            presentation_options: NSApplicationPresentationOptions,
794        );
795
796        /// Returns: The set of application presentation options that are currently in effect for the system.
797        /// These are the presentation options that have been put into effect by the currently active application.
798        #[unsafe(method(currentSystemPresentationOptions))]
799        #[unsafe(method_family = none)]
800        pub unsafe fn currentSystemPresentationOptions(&self) -> NSApplicationPresentationOptions;
801
802        #[unsafe(method(occlusionState))]
803        #[unsafe(method_family = none)]
804        pub unsafe fn occlusionState(&self) -> NSApplicationOcclusionState;
805
806        #[unsafe(method(isProtectedDataAvailable))]
807        #[unsafe(method_family = none)]
808        pub unsafe fn isProtectedDataAvailable(&self) -> bool;
809    );
810}
811
812/// Methods declared on superclass `NSResponder`.
813#[cfg(feature = "NSResponder")]
814impl NSApplication {
815    extern_methods!(
816        #[unsafe(method(init))]
817        #[unsafe(method_family = init)]
818        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
819
820        #[unsafe(method(initWithCoder:))]
821        #[unsafe(method_family = init)]
822        pub unsafe fn initWithCoder(
823            this: Allocated<Self>,
824            coder: &NSCoder,
825        ) -> Option<Retained<Self>>;
826    );
827}
828
829/// Methods declared on superclass `NSObject`.
830#[cfg(feature = "NSResponder")]
831impl NSApplication {
832    extern_methods!(
833        #[unsafe(method(new))]
834        #[unsafe(method_family = new)]
835        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
836    );
837}
838
839/// NSAppearanceCustomization.
840#[cfg(feature = "NSResponder")]
841impl NSApplication {
842    extern_methods!(
843        #[cfg(feature = "NSAppearance")]
844        #[unsafe(method(appearance))]
845        #[unsafe(method_family = none)]
846        pub unsafe fn appearance(&self) -> Option<Retained<NSAppearance>>;
847
848        #[cfg(feature = "NSAppearance")]
849        /// Setter for [`appearance`][Self::appearance].
850        #[unsafe(method(setAppearance:))]
851        #[unsafe(method_family = none)]
852        pub fn setAppearance(&self, appearance: Option<&NSAppearance>);
853
854        #[cfg(feature = "NSAppearance")]
855        #[unsafe(method(effectiveAppearance))]
856        #[unsafe(method_family = none)]
857        pub fn effectiveAppearance(&self) -> Retained<NSAppearance>;
858    );
859}
860
861#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
862extern_conformance!(
863    unsafe impl NSAppearanceCustomization for NSApplication {}
864);
865
866/// NSEvent.
867#[cfg(feature = "NSResponder")]
868impl NSApplication {
869    extern_methods!(
870        #[cfg(feature = "NSEvent")]
871        #[unsafe(method(sendEvent:))]
872        #[unsafe(method_family = none)]
873        pub unsafe fn sendEvent(&self, event: &NSEvent);
874
875        #[cfg(feature = "NSEvent")]
876        #[unsafe(method(postEvent:atStart:))]
877        #[unsafe(method_family = none)]
878        pub fn postEvent_atStart(&self, event: &NSEvent, at_start: bool);
879
880        #[cfg(feature = "NSEvent")]
881        #[unsafe(method(currentEvent))]
882        #[unsafe(method_family = none)]
883        pub fn currentEvent(&self) -> Option<Retained<NSEvent>>;
884
885        #[cfg(feature = "NSEvent")]
886        #[unsafe(method(nextEventMatchingMask:untilDate:inMode:dequeue:))]
887        #[unsafe(method_family = none)]
888        pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
889            &self,
890            mask: NSEventMask,
891            expiration: Option<&NSDate>,
892            mode: &NSRunLoopMode,
893            deq_flag: bool,
894        ) -> Option<Retained<NSEvent>>;
895
896        #[cfg(feature = "NSEvent")]
897        #[unsafe(method(discardEventsMatchingMask:beforeEvent:))]
898        #[unsafe(method_family = none)]
899        pub unsafe fn discardEventsMatchingMask_beforeEvent(
900            &self,
901            mask: NSEventMask,
902            last_event: Option<&NSEvent>,
903        );
904    );
905}
906
907/// NSResponder.
908#[cfg(feature = "NSResponder")]
909impl NSApplication {
910    extern_methods!(
911        #[unsafe(method(sendAction:to:from:))]
912        #[unsafe(method_family = none)]
913        pub unsafe fn sendAction_to_from(
914            &self,
915            action: Sel,
916            target: Option<&AnyObject>,
917            sender: Option<&AnyObject>,
918        ) -> bool;
919
920        #[unsafe(method(targetForAction:))]
921        #[unsafe(method_family = none)]
922        pub unsafe fn targetForAction(&self, action: Sel) -> Option<Retained<AnyObject>>;
923
924        #[unsafe(method(targetForAction:to:from:))]
925        #[unsafe(method_family = none)]
926        pub unsafe fn targetForAction_to_from(
927            &self,
928            action: Sel,
929            target: Option<&AnyObject>,
930            sender: Option<&AnyObject>,
931        ) -> Option<Retained<AnyObject>>;
932
933        #[unsafe(method(tryToPerform:with:))]
934        #[unsafe(method_family = none)]
935        pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
936
937        #[cfg(feature = "NSPasteboard")]
938        #[unsafe(method(validRequestorForSendType:returnType:))]
939        #[unsafe(method_family = none)]
940        pub unsafe fn validRequestorForSendType_returnType(
941            &self,
942            send_type: Option<&NSPasteboardType>,
943            return_type: Option<&NSPasteboardType>,
944        ) -> Option<Retained<AnyObject>>;
945    );
946}
947
948/// NSWindowsMenu.
949#[cfg(feature = "NSResponder")]
950impl NSApplication {
951    extern_methods!(
952        #[cfg(feature = "NSMenu")]
953        #[unsafe(method(windowsMenu))]
954        #[unsafe(method_family = none)]
955        pub unsafe fn windowsMenu(&self) -> Option<Retained<NSMenu>>;
956
957        #[cfg(feature = "NSMenu")]
958        /// Setter for [`windowsMenu`][Self::windowsMenu].
959        #[unsafe(method(setWindowsMenu:))]
960        #[unsafe(method_family = none)]
961        pub unsafe fn setWindowsMenu(&self, windows_menu: Option<&NSMenu>);
962
963        #[unsafe(method(arrangeInFront:))]
964        #[unsafe(method_family = none)]
965        pub unsafe fn arrangeInFront(&self, sender: Option<&AnyObject>);
966
967        #[cfg(feature = "NSWindow")]
968        #[unsafe(method(removeWindowsItem:))]
969        #[unsafe(method_family = none)]
970        pub unsafe fn removeWindowsItem(&self, win: &NSWindow);
971
972        #[cfg(feature = "NSWindow")]
973        #[unsafe(method(addWindowsItem:title:filename:))]
974        #[unsafe(method_family = none)]
975        pub unsafe fn addWindowsItem_title_filename(
976            &self,
977            win: &NSWindow,
978            string: &NSString,
979            is_filename: bool,
980        );
981
982        #[cfg(feature = "NSWindow")]
983        #[unsafe(method(changeWindowsItem:title:filename:))]
984        #[unsafe(method_family = none)]
985        pub unsafe fn changeWindowsItem_title_filename(
986            &self,
987            win: &NSWindow,
988            string: &NSString,
989            is_filename: bool,
990        );
991
992        #[cfg(feature = "NSWindow")]
993        #[unsafe(method(updateWindowsItem:))]
994        #[unsafe(method_family = none)]
995        pub unsafe fn updateWindowsItem(&self, win: &NSWindow);
996
997        #[unsafe(method(miniaturizeAll:))]
998        #[unsafe(method_family = none)]
999        pub unsafe fn miniaturizeAll(&self, sender: Option<&AnyObject>);
1000    );
1001}
1002
1003/// NSFullKeyboardAccess.
1004#[cfg(feature = "NSResponder")]
1005impl NSApplication {
1006    extern_methods!(
1007        /// A Boolean value indicating whether keyboard navigation is enabled in System Settings > Keyboard.
1008        /// - Note: The value of this property is `YES` if keyboard navigation is enabled or `NO` if it’s not. You might use this value to implement your own key loop or to implement in-control tabbing behavior similar to `NSTableView`. Because of the nature of the preference storage, you won’t be notified of changes to this property if you attempt to observe it through key-value observing; however, accessing this property is fairly inexpensive, so you can access it directly rather than caching it.
1009        /// - Note: This property’s value isn’t necessarily reflective of the separate accessibility setting named “Full Keyboard Access” in System Settings > Accessibility > Keyboard.
1010        #[unsafe(method(isFullKeyboardAccessEnabled))]
1011        #[unsafe(method_family = none)]
1012        pub unsafe fn isFullKeyboardAccessEnabled(&self) -> bool;
1013    );
1014}
1015
1016/// Return values for `-applicationShouldTerminate:`.
1017///
1018/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationterminatereply?language=objc)
1019// NS_ENUM
1020#[repr(transparent)]
1021#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1022pub struct NSApplicationTerminateReply(pub NSUInteger);
1023impl NSApplicationTerminateReply {
1024    #[doc(alias = "NSTerminateCancel")]
1025    pub const TerminateCancel: Self = Self(0);
1026    #[doc(alias = "NSTerminateNow")]
1027    pub const TerminateNow: Self = Self(1);
1028    #[doc(alias = "NSTerminateLater")]
1029    pub const TerminateLater: Self = Self(2);
1030}
1031
1032unsafe impl Encode for NSApplicationTerminateReply {
1033    const ENCODING: Encoding = NSUInteger::ENCODING;
1034}
1035
1036unsafe impl RefEncode for NSApplicationTerminateReply {
1037    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1038}
1039
1040/// Return values for `-application:printFiles:withSettings:showPrintPanels:`.
1041///
1042/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationprintreply?language=objc)
1043// NS_ENUM
1044#[repr(transparent)]
1045#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1046pub struct NSApplicationPrintReply(pub NSUInteger);
1047impl NSApplicationPrintReply {
1048    #[doc(alias = "NSPrintingCancelled")]
1049    pub const PrintingCancelled: Self = Self(0);
1050    #[doc(alias = "NSPrintingSuccess")]
1051    pub const PrintingSuccess: Self = Self(1);
1052    #[doc(alias = "NSPrintingReplyLater")]
1053    pub const PrintingReplyLater: Self = Self(2);
1054    #[doc(alias = "NSPrintingFailure")]
1055    pub const PrintingFailure: Self = Self(3);
1056}
1057
1058unsafe impl Encode for NSApplicationPrintReply {
1059    const ENCODING: Encoding = NSUInteger::ENCODING;
1060}
1061
1062unsafe impl RefEncode for NSApplicationPrintReply {
1063    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1064}
1065
1066extern_protocol!(
1067    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdelegate?language=objc)
1068    pub unsafe trait NSApplicationDelegate: NSObjectProtocol + MainThreadOnly {
1069        #[cfg(feature = "NSResponder")]
1070        /// Allowable return values are:
1071        /// `NSTerminateNow`- it is ok to proceed with termination
1072        /// `NSTerminateCancel`- the application should not be terminated
1073        /// `NSTerminateLater`- it may be ok to proceed with termination later.  The application must call `-replyToApplicationShouldTerminate:` with
1074        /// `YES`or
1075        /// `NO`once the answer is known
1076        ///
1077        /// Note: This return value is for delegates who need to provide document modal alerts (sheets) in order to decide whether to quit.
1078        #[optional]
1079        #[unsafe(method(applicationShouldTerminate:))]
1080        #[unsafe(method_family = none)]
1081        unsafe fn applicationShouldTerminate(
1082            &self,
1083            sender: &NSApplication,
1084        ) -> NSApplicationTerminateReply;
1085
1086        #[cfg(feature = "NSResponder")]
1087        /// This will be called for any URLs your application is asked to open. This includes URL types (CFBundleURLTypes) defined in your Info.plist, and Document types (
1088        /// `CFBundleDocumentTypes)`that have no associated
1089        /// `NSDocument`class. Document URLs that have an associated
1090        /// `NSDocument`class will be opened through
1091        /// `NSDocumentController.`If this is implemented, `-application:openFiles:` and `-application:openFile:` will not be called.
1092        #[optional]
1093        #[unsafe(method(application:openURLs:))]
1094        #[unsafe(method_family = none)]
1095        unsafe fn application_openURLs(&self, application: &NSApplication, urls: &NSArray<NSURL>);
1096
1097        #[cfg(feature = "NSResponder")]
1098        #[optional]
1099        #[unsafe(method(application:openFile:))]
1100        #[unsafe(method_family = none)]
1101        unsafe fn application_openFile(&self, sender: &NSApplication, filename: &NSString) -> bool;
1102
1103        #[cfg(feature = "NSResponder")]
1104        #[optional]
1105        #[unsafe(method(application:openFiles:))]
1106        #[unsafe(method_family = none)]
1107        unsafe fn application_openFiles(
1108            &self,
1109            sender: &NSApplication,
1110            filenames: &NSArray<NSString>,
1111        );
1112
1113        #[cfg(feature = "NSResponder")]
1114        #[optional]
1115        #[unsafe(method(application:openTempFile:))]
1116        #[unsafe(method_family = none)]
1117        unsafe fn application_openTempFile(
1118            &self,
1119            sender: &NSApplication,
1120            filename: &NSString,
1121        ) -> bool;
1122
1123        #[cfg(feature = "NSResponder")]
1124        #[optional]
1125        #[unsafe(method(applicationShouldOpenUntitledFile:))]
1126        #[unsafe(method_family = none)]
1127        unsafe fn applicationShouldOpenUntitledFile(&self, sender: &NSApplication) -> bool;
1128
1129        #[cfg(feature = "NSResponder")]
1130        #[optional]
1131        #[unsafe(method(applicationOpenUntitledFile:))]
1132        #[unsafe(method_family = none)]
1133        unsafe fn applicationOpenUntitledFile(&self, sender: &NSApplication) -> bool;
1134
1135        #[optional]
1136        #[unsafe(method(application:openFileWithoutUI:))]
1137        #[unsafe(method_family = none)]
1138        unsafe fn application_openFileWithoutUI(
1139            &self,
1140            sender: &AnyObject,
1141            filename: &NSString,
1142        ) -> bool;
1143
1144        #[cfg(feature = "NSResponder")]
1145        #[optional]
1146        #[unsafe(method(application:printFile:))]
1147        #[unsafe(method_family = none)]
1148        unsafe fn application_printFile(&self, sender: &NSApplication, filename: &NSString)
1149            -> bool;
1150
1151        #[cfg(all(feature = "NSPrintInfo", feature = "NSResponder"))]
1152        #[optional]
1153        #[unsafe(method(application:printFiles:withSettings:showPrintPanels:))]
1154        #[unsafe(method_family = none)]
1155        unsafe fn application_printFiles_withSettings_showPrintPanels(
1156            &self,
1157            application: &NSApplication,
1158            file_names: &NSArray<NSString>,
1159            print_settings: &NSDictionary<NSPrintInfoAttributeKey, AnyObject>,
1160            show_print_panels: bool,
1161        ) -> NSApplicationPrintReply;
1162
1163        #[cfg(feature = "NSResponder")]
1164        #[optional]
1165        #[unsafe(method(applicationShouldTerminateAfterLastWindowClosed:))]
1166        #[unsafe(method_family = none)]
1167        unsafe fn applicationShouldTerminateAfterLastWindowClosed(
1168            &self,
1169            sender: &NSApplication,
1170        ) -> bool;
1171
1172        #[cfg(feature = "NSResponder")]
1173        #[optional]
1174        #[unsafe(method(applicationShouldHandleReopen:hasVisibleWindows:))]
1175        #[unsafe(method_family = none)]
1176        unsafe fn applicationShouldHandleReopen_hasVisibleWindows(
1177            &self,
1178            sender: &NSApplication,
1179            has_visible_windows: bool,
1180        ) -> bool;
1181
1182        #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
1183        #[optional]
1184        #[unsafe(method(applicationDockMenu:))]
1185        #[unsafe(method_family = none)]
1186        unsafe fn applicationDockMenu(&self, sender: &NSApplication) -> Option<Retained<NSMenu>>;
1187
1188        #[cfg(feature = "NSResponder")]
1189        #[optional]
1190        #[unsafe(method(application:willPresentError:))]
1191        #[unsafe(method_family = none)]
1192        unsafe fn application_willPresentError(
1193            &self,
1194            application: &NSApplication,
1195            error: &NSError,
1196        ) -> Retained<NSError>;
1197
1198        #[cfg(feature = "NSResponder")]
1199        #[optional]
1200        #[unsafe(method(application:didRegisterForRemoteNotificationsWithDeviceToken:))]
1201        #[unsafe(method_family = none)]
1202        unsafe fn application_didRegisterForRemoteNotificationsWithDeviceToken(
1203            &self,
1204            application: &NSApplication,
1205            device_token: &NSData,
1206        );
1207
1208        #[cfg(feature = "NSResponder")]
1209        #[optional]
1210        #[unsafe(method(application:didFailToRegisterForRemoteNotificationsWithError:))]
1211        #[unsafe(method_family = none)]
1212        unsafe fn application_didFailToRegisterForRemoteNotificationsWithError(
1213            &self,
1214            application: &NSApplication,
1215            error: &NSError,
1216        );
1217
1218        #[cfg(feature = "NSResponder")]
1219        #[optional]
1220        #[unsafe(method(application:didReceiveRemoteNotification:))]
1221        #[unsafe(method_family = none)]
1222        unsafe fn application_didReceiveRemoteNotification(
1223            &self,
1224            application: &NSApplication,
1225            user_info: &NSDictionary<NSString, AnyObject>,
1226        );
1227
1228        #[cfg(feature = "NSResponder")]
1229        /// Method to opt-in to secure restorable state.
1230        ///
1231        /// When this returns
1232        /// `YES:`NSCoders that are passed into the various
1233        /// `NSWindowRestoration`methods will
1234        /// `requiresSecureCoding`and have a
1235        /// `decodingFailurePolicy`of
1236        /// `NSDecodingFailurePolicySetErrorAndReturn.`Any
1237        /// `restorationClass`set on a window must explicitly conform to
1238        /// `NSWindowRestoration.`This method will be called prior to any state encoding or restoration.
1239        #[optional]
1240        #[unsafe(method(applicationSupportsSecureRestorableState:))]
1241        #[unsafe(method_family = none)]
1242        unsafe fn applicationSupportsSecureRestorableState(&self, app: &NSApplication) -> bool;
1243
1244        #[cfg(feature = "NSResponder")]
1245        /// Method called by `-[NSApplication encodeRestorableStateWithCoder:]` to give the delegate a chance to encode any additional state into the
1246        /// `NSCoder.`If the restorable state managed by the delegate changes, you must call `-[NSApplication invalidateRestorableState]` so that it will be re-encoded. See the header `NSWindowRestoration.h` for more information.
1247        #[optional]
1248        #[unsafe(method(application:willEncodeRestorableState:))]
1249        #[unsafe(method_family = none)]
1250        unsafe fn application_willEncodeRestorableState(
1251            &self,
1252            app: &NSApplication,
1253            coder: &NSCoder,
1254        );
1255
1256        #[cfg(feature = "NSResponder")]
1257        /// Method called by `-[NSApplication restoreStateWithCoder:]` to give the delegate a chance to restore its own state, which it may decode from the
1258        /// `NSCoder.`See the header `NSWindowRestoration.h` for more information.
1259        #[optional]
1260        #[unsafe(method(application:didDecodeRestorableState:))]
1261        #[unsafe(method_family = none)]
1262        unsafe fn application_didDecodeRestorableState(&self, app: &NSApplication, coder: &NSCoder);
1263
1264        #[cfg(feature = "NSResponder")]
1265        /// This will be called on the main thread as soon as the user indicates they want to continue an activity in your application. The
1266        /// `NSUserActivity`object may not be available instantly, so use this as an opportunity to show the user that an activity will be continued shortly. Return
1267        /// `YES`to indicate that you are doing so. Return
1268        /// `NO`(or leave it unimplemented) and AppKit/UIKit will put up a default UI.
1269        ///
1270        /// For each `-application:willContinueUserActivityWithType:` invocation, you are guaranteed to get exactly one invocation of `-application:continueUserActivity:restorationHandler:` on success, or `-application:didFailToContinueUserActivityWithType:error:` if an error was encountered.
1271        #[optional]
1272        #[unsafe(method(application:willContinueUserActivityWithType:))]
1273        #[unsafe(method_family = none)]
1274        unsafe fn application_willContinueUserActivityWithType(
1275            &self,
1276            application: &NSApplication,
1277            user_activity_type: &NSString,
1278        ) -> bool;
1279
1280        #[cfg(all(
1281            feature = "NSResponder",
1282            feature = "NSUserActivity",
1283            feature = "block2"
1284        ))]
1285        /// This will be called on the main thread after the
1286        /// `NSUserActivity`object is available. Use the data you stored in the NSUserActivity object to re-create what the user was doing.
1287        ///
1288        ///
1289        /// Returns: `YES`to indicate that the activity was handled. Return
1290        /// `NO`(or leave it unimplemented) and AppKit will attempt to continue the user activity.
1291        ///
1292        /// You should create/fetch any restorable objects associated with the user activity, and pass them to the restorationHandler. They will then get the above `-restoreUserActivityState:` method invoked with the user activity. Invoking the
1293        /// `restorationHandler`is optional. It may be copied and invoked later, but must be invoked on the main thread.
1294        ///
1295        /// If this user activity was created automatically by having
1296        /// `NSUbiquitousDocumentUserActivityType`in a
1297        /// `CFBundleDocumentTypes`entry, AppKit can automatically restore the NSUserActivity on OS X if NO is returned, or this method is unimplemented. It will do so by creating a document of the appropriate type using the URL stored in the userInfo under the
1298        /// `NSUserActivityDocumentURLKey.`The document will have `-restoreUserActivity:` called on it.
1299        #[optional]
1300        #[unsafe(method(application:continueUserActivity:restorationHandler:))]
1301        #[unsafe(method_family = none)]
1302        unsafe fn application_continueUserActivity_restorationHandler(
1303            &self,
1304            application: &NSApplication,
1305            user_activity: &NSUserActivity,
1306            restoration_handler: &block2::DynBlock<
1307                dyn Fn(NonNull<NSArray<ProtocolObject<dyn NSUserActivityRestoring>>>),
1308            >,
1309        ) -> bool;
1310
1311        #[cfg(feature = "NSResponder")]
1312        /// There are instances where continuing a
1313        /// `NSUserActivity`may fail. This will get called on the main thread if it does so. If it is unimplemented, AppKit will present the error.
1314        #[optional]
1315        #[unsafe(method(application:didFailToContinueUserActivityWithType:error:))]
1316        #[unsafe(method_family = none)]
1317        unsafe fn application_didFailToContinueUserActivityWithType_error(
1318            &self,
1319            application: &NSApplication,
1320            user_activity_type: &NSString,
1321            error: &NSError,
1322        );
1323
1324        #[cfg(feature = "NSResponder")]
1325        /// This will be called on the main thread when a user activity managed by AppKit/UIKit has been updated. You should use this as a last chance to add additional data to the
1326        /// `userActivity.`
1327        #[optional]
1328        #[unsafe(method(application:didUpdateUserActivity:))]
1329        #[unsafe(method_family = none)]
1330        unsafe fn application_didUpdateUserActivity(
1331            &self,
1332            application: &NSApplication,
1333            user_activity: &NSUserActivity,
1334        );
1335
1336        #[cfg(all(feature = "NSResponder", feature = "objc2-cloud-kit"))]
1337        #[cfg(target_vendor = "apple")]
1338        /// This will be called on the main thread after the user indicates they want to accept a CloudKit sharing invitation in your application.
1339        ///
1340        /// You should use the
1341        /// `CKShareMetadata`object's
1342        /// `shareURL`and containerIdentifier to schedule a
1343        /// `CKAcceptSharesOperation,`then start using the resulting
1344        /// `CKShare`and its associated record(s), which will appear in the
1345        /// `CKContainer's`shared database in a zone matching that of the record's owner.
1346        #[optional]
1347        #[unsafe(method(application:userDidAcceptCloudKitShareWithMetadata:))]
1348        #[unsafe(method_family = none)]
1349        unsafe fn application_userDidAcceptCloudKitShareWithMetadata(
1350            &self,
1351            application: &NSApplication,
1352            metadata: &CKShareMetadata,
1353        );
1354
1355        #[cfg(feature = "NSResponder")]
1356        /// Returns: `YES`if the receiving delegate object can respond to key value coding messages for a specific keyed attribute, to-one relationship, or to-many relationship.  Return
1357        /// `NO`otherwise.
1358        #[optional]
1359        #[unsafe(method(application:delegateHandlesKey:))]
1360        #[unsafe(method_family = none)]
1361        unsafe fn application_delegateHandlesKey(
1362            &self,
1363            sender: &NSApplication,
1364            key: &NSString,
1365        ) -> bool;
1366
1367        #[cfg(feature = "NSResponder")]
1368        /// This method will be called once during application launch at `-[NSApplication finishLaunching]`.
1369        ///
1370        ///
1371        /// Returns: `NO`if the receiving delegate object wishes to opt-out of system-wide keyboard shortcut localization for all application-supplied menus. Return
1372        /// `YES`by default for apps linked against 12.0 and later SDK.
1373        #[optional]
1374        #[unsafe(method(applicationShouldAutomaticallyLocalizeKeyEquivalents:))]
1375        #[unsafe(method_family = none)]
1376        unsafe fn applicationShouldAutomaticallyLocalizeKeyEquivalents(
1377            &self,
1378            application: &NSApplication,
1379        ) -> bool;
1380
1381        #[optional]
1382        #[unsafe(method(applicationWillFinishLaunching:))]
1383        #[unsafe(method_family = none)]
1384        unsafe fn applicationWillFinishLaunching(&self, notification: &NSNotification);
1385
1386        #[optional]
1387        #[unsafe(method(applicationDidFinishLaunching:))]
1388        #[unsafe(method_family = none)]
1389        unsafe fn applicationDidFinishLaunching(&self, notification: &NSNotification);
1390
1391        #[optional]
1392        #[unsafe(method(applicationWillHide:))]
1393        #[unsafe(method_family = none)]
1394        unsafe fn applicationWillHide(&self, notification: &NSNotification);
1395
1396        #[optional]
1397        #[unsafe(method(applicationDidHide:))]
1398        #[unsafe(method_family = none)]
1399        unsafe fn applicationDidHide(&self, notification: &NSNotification);
1400
1401        #[optional]
1402        #[unsafe(method(applicationWillUnhide:))]
1403        #[unsafe(method_family = none)]
1404        unsafe fn applicationWillUnhide(&self, notification: &NSNotification);
1405
1406        #[optional]
1407        #[unsafe(method(applicationDidUnhide:))]
1408        #[unsafe(method_family = none)]
1409        unsafe fn applicationDidUnhide(&self, notification: &NSNotification);
1410
1411        #[optional]
1412        #[unsafe(method(applicationWillBecomeActive:))]
1413        #[unsafe(method_family = none)]
1414        unsafe fn applicationWillBecomeActive(&self, notification: &NSNotification);
1415
1416        #[optional]
1417        #[unsafe(method(applicationDidBecomeActive:))]
1418        #[unsafe(method_family = none)]
1419        unsafe fn applicationDidBecomeActive(&self, notification: &NSNotification);
1420
1421        #[optional]
1422        #[unsafe(method(applicationWillResignActive:))]
1423        #[unsafe(method_family = none)]
1424        unsafe fn applicationWillResignActive(&self, notification: &NSNotification);
1425
1426        #[optional]
1427        #[unsafe(method(applicationDidResignActive:))]
1428        #[unsafe(method_family = none)]
1429        unsafe fn applicationDidResignActive(&self, notification: &NSNotification);
1430
1431        #[optional]
1432        #[unsafe(method(applicationWillUpdate:))]
1433        #[unsafe(method_family = none)]
1434        unsafe fn applicationWillUpdate(&self, notification: &NSNotification);
1435
1436        #[optional]
1437        #[unsafe(method(applicationDidUpdate:))]
1438        #[unsafe(method_family = none)]
1439        unsafe fn applicationDidUpdate(&self, notification: &NSNotification);
1440
1441        #[optional]
1442        #[unsafe(method(applicationWillTerminate:))]
1443        #[unsafe(method_family = none)]
1444        unsafe fn applicationWillTerminate(&self, notification: &NSNotification);
1445
1446        #[optional]
1447        #[unsafe(method(applicationDidChangeScreenParameters:))]
1448        #[unsafe(method_family = none)]
1449        unsafe fn applicationDidChangeScreenParameters(&self, notification: &NSNotification);
1450
1451        #[optional]
1452        #[unsafe(method(applicationDidChangeOcclusionState:))]
1453        #[unsafe(method_family = none)]
1454        unsafe fn applicationDidChangeOcclusionState(&self, notification: &NSNotification);
1455
1456        #[optional]
1457        #[unsafe(method(applicationProtectedDataWillBecomeUnavailable:))]
1458        #[unsafe(method_family = none)]
1459        unsafe fn applicationProtectedDataWillBecomeUnavailable(
1460            &self,
1461            notification: &NSNotification,
1462        );
1463
1464        #[optional]
1465        #[unsafe(method(applicationProtectedDataDidBecomeAvailable:))]
1466        #[unsafe(method_family = none)]
1467        unsafe fn applicationProtectedDataDidBecomeAvailable(&self, notification: &NSNotification);
1468    }
1469);
1470
1471/// NSServicesMenu.
1472#[cfg(feature = "NSResponder")]
1473impl NSApplication {
1474    extern_methods!(
1475        #[cfg(feature = "NSMenu")]
1476        #[unsafe(method(servicesMenu))]
1477        #[unsafe(method_family = none)]
1478        pub unsafe fn servicesMenu(&self) -> Option<Retained<NSMenu>>;
1479
1480        #[cfg(feature = "NSMenu")]
1481        /// Setter for [`servicesMenu`][Self::servicesMenu].
1482        #[unsafe(method(setServicesMenu:))]
1483        #[unsafe(method_family = none)]
1484        pub unsafe fn setServicesMenu(&self, services_menu: Option<&NSMenu>);
1485
1486        #[cfg(feature = "NSPasteboard")]
1487        #[unsafe(method(registerServicesMenuSendTypes:returnTypes:))]
1488        #[unsafe(method_family = none)]
1489        pub unsafe fn registerServicesMenuSendTypes_returnTypes(
1490            &self,
1491            send_types: &NSArray<NSPasteboardType>,
1492            return_types: &NSArray<NSPasteboardType>,
1493        );
1494    );
1495}
1496
1497extern_protocol!(
1498    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsservicesmenurequestor?language=objc)
1499    pub unsafe trait NSServicesMenuRequestor: NSObjectProtocol {
1500        #[cfg(feature = "NSPasteboard")]
1501        #[optional]
1502        #[unsafe(method(writeSelectionToPasteboard:types:))]
1503        #[unsafe(method_family = none)]
1504        unsafe fn writeSelectionToPasteboard_types(
1505            &self,
1506            pboard: &NSPasteboard,
1507            types: &NSArray<NSPasteboardType>,
1508        ) -> bool;
1509
1510        #[cfg(feature = "NSPasteboard")]
1511        #[optional]
1512        #[unsafe(method(readSelectionFromPasteboard:))]
1513        #[unsafe(method_family = none)]
1514        unsafe fn readSelectionFromPasteboard(&self, pboard: &NSPasteboard) -> bool;
1515    }
1516);
1517
1518/// NSServicesHandling.
1519#[cfg(feature = "NSResponder")]
1520impl NSApplication {
1521    extern_methods!(
1522        #[unsafe(method(servicesProvider))]
1523        #[unsafe(method_family = none)]
1524        pub unsafe fn servicesProvider(&self) -> Option<Retained<AnyObject>>;
1525
1526        /// Setter for [`servicesProvider`][Self::servicesProvider].
1527        #[unsafe(method(setServicesProvider:))]
1528        #[unsafe(method_family = none)]
1529        pub unsafe fn setServicesProvider(&self, services_provider: Option<&AnyObject>);
1530    );
1531}
1532
1533/// Optional keys in `-orderFrontStandardAboutPanelWithOptions:`
1534/// `optionsDictionary.`
1535///
1536/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionkey?language=objc)
1537// NS_TYPED_ENUM
1538pub type NSAboutPanelOptionKey = NSString;
1539
1540extern "C" {
1541    /// NSAttributedString displayed in the info area of the panel. If not specified, contents obtained from "Credits.rtf" (.rtfd, .html) in [NSBundle mainBundle]; if not available, blank. Note that  in applications built against the 10.14 SDK or earlier, the credits are shown in light appearance even when the application is running in dark appearance, except when the credits are specified as an attributed string, or come from a file are the text is just pure black. In applications built against the 10.15 SDK or newer, credits will be shown in dark appearance, using the "adaptive color mapping" setting in NSTextView.
1542    ///
1543    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc)
1544    pub static NSAboutPanelOptionCredits: &'static NSAboutPanelOptionKey;
1545}
1546
1547extern "C" {
1548    /// NSString displayed in place of the default app name. If not specified, uses the value of CFBundleName (localizable). Fallback is [[NSProcessInfo processInfo] processName].
1549    ///
1550    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionapplicationname?language=objc)
1551    pub static NSAboutPanelOptionApplicationName: &'static NSAboutPanelOptionKey;
1552}
1553
1554extern "C" {
1555    /// NSImage displayed in place of NSApplicationIcon. If not specified, use [NSImage imageNamed:
1556    /// "
1557    /// NSApplicationIcon"]; if not available, generic icon.
1558    ///
1559    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionapplicationicon?language=objc)
1560    pub static NSAboutPanelOptionApplicationIcon: &'static NSAboutPanelOptionKey;
1561}
1562
1563extern "C" {
1564    /// NSString containing the build version number of the application ("58.4", "1.2d3"); displayed as "Version 58.4" or "Version 1.0 (58.4) depending on the presence of ApplicationVersion. If not specified, obtain from the CFBundleVersion key in infoDictionary; if not specified or empty string, leave blank.
1565    ///
1566    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionversion?language=objc)
1567    pub static NSAboutPanelOptionVersion: &'static NSAboutPanelOptionKey;
1568}
1569
1570extern "C" {
1571    /// NSString displayed as the marketing version  ("1.0", "Mac OS X", "3", "WebObjects 3.5", ...), before the build version. If not specified, obtain from CFBundleShortVersionString key in infoDictionary. Prefixed with word "Version" if it looks like a number.
1572    ///
1573    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionapplicationversion?language=objc)
1574    pub static NSAboutPanelOptionApplicationVersion: &'static NSAboutPanelOptionKey;
1575}
1576
1577/// NSStandardAboutPanel.
1578#[cfg(feature = "NSResponder")]
1579impl NSApplication {
1580    extern_methods!(
1581        #[unsafe(method(orderFrontStandardAboutPanel:))]
1582        #[unsafe(method_family = none)]
1583        pub unsafe fn orderFrontStandardAboutPanel(&self, sender: Option<&AnyObject>);
1584
1585        #[unsafe(method(orderFrontStandardAboutPanelWithOptions:))]
1586        #[unsafe(method_family = none)]
1587        pub unsafe fn orderFrontStandardAboutPanelWithOptions(
1588            &self,
1589            options_dictionary: &NSDictionary<NSAboutPanelOptionKey, AnyObject>,
1590        );
1591    );
1592}
1593
1594/// NSApplicationLayoutDirection.
1595#[cfg(feature = "NSResponder")]
1596impl NSApplication {
1597    extern_methods!(
1598        #[cfg(feature = "NSUserInterfaceLayout")]
1599        #[unsafe(method(userInterfaceLayoutDirection))]
1600        #[unsafe(method_family = none)]
1601        pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
1602    );
1603}
1604
1605/// NSRestorableUserInterface.
1606#[cfg(feature = "NSResponder")]
1607impl NSApplication {
1608    extern_methods!(
1609        /// Disable or reenable relaunching this app on login, if the app was running at the time the user logged out.  These methods increment and decrement a counter respectively; if the counter is 0 at the time the user logs out, then the app may be relaunched when the user logs back in.  The counter is initially zero, so by default apps are relaunched.
1610        ///
1611        /// If your app should not be relaunched because it launches via some other mechanism (e.g. launchd), then the recommended usage is to call `-[NSApp disableRelaunchOnLogin]` once, and never pair it with an -enable call.
1612        ///
1613        /// If your app should not be relaunched because it triggers a restart (e.g. an installer), then the recommended usage is to call `-[NSApp disableRelaunchOnLogin]` immediately before you attempt to trigger a restart, and `-[NSApp enableRelaunchOnLogin]` immediately after.  This is because the user may cancel restarting; if the user later restarts for another reason, then your app should be brought back.
1614        ///
1615        /// These methods are thread safe.
1616        #[unsafe(method(disableRelaunchOnLogin))]
1617        #[unsafe(method_family = none)]
1618        pub unsafe fn disableRelaunchOnLogin(&self);
1619
1620        #[unsafe(method(enableRelaunchOnLogin))]
1621        #[unsafe(method_family = none)]
1622        pub unsafe fn enableRelaunchOnLogin(&self);
1623    );
1624}
1625
1626/// Soft deprecated.
1627/// Please use `NSApplication`'s `-registerForRemoteNotifications` along with `-requestAuthorizationWithOptions:` from the `UserNotifications.framework` to specify allowable notification types.
1628///
1629/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsremotenotificationtype?language=objc)
1630// NS_OPTIONS
1631#[repr(transparent)]
1632#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1633pub struct NSRemoteNotificationType(pub NSUInteger);
1634bitflags::bitflags! {
1635    impl NSRemoteNotificationType: NSUInteger {
1636        #[doc(alias = "NSRemoteNotificationTypeNone")]
1637        const None = 0;
1638        #[doc(alias = "NSRemoteNotificationTypeBadge")]
1639        const Badge = 1<<0;
1640        #[doc(alias = "NSRemoteNotificationTypeSound")]
1641        const Sound = 1<<1;
1642        #[doc(alias = "NSRemoteNotificationTypeAlert")]
1643        const Alert = 1<<2;
1644    }
1645}
1646
1647unsafe impl Encode for NSRemoteNotificationType {
1648    const ENCODING: Encoding = NSUInteger::ENCODING;
1649}
1650
1651unsafe impl RefEncode for NSRemoteNotificationType {
1652    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1653}
1654
1655/// NSRemoteNotifications.
1656#[cfg(feature = "NSResponder")]
1657impl NSApplication {
1658    extern_methods!(
1659        #[unsafe(method(registerForRemoteNotifications))]
1660        #[unsafe(method_family = none)]
1661        pub unsafe fn registerForRemoteNotifications(&self);
1662
1663        #[unsafe(method(unregisterForRemoteNotifications))]
1664        #[unsafe(method_family = none)]
1665        pub unsafe fn unregisterForRemoteNotifications(&self);
1666
1667        /// Returns: `YES`if the application is currently registered for remote notifications, taking into account any systemwide settings; doesn't relate to connectivity.
1668        #[unsafe(method(isRegisteredForRemoteNotifications))]
1669        #[unsafe(method_family = none)]
1670        pub unsafe fn isRegisteredForRemoteNotifications(&self) -> bool;
1671
1672        /// The following are soft deprecated.
1673        /// Please use the `-registerForRemoteNotifications` above and `-requestAuthorizationWithOptions:` from `UserNotifications.framework`.
1674        #[unsafe(method(registerForRemoteNotificationTypes:))]
1675        #[unsafe(method_family = none)]
1676        pub unsafe fn registerForRemoteNotificationTypes(&self, types: NSRemoteNotificationType);
1677
1678        #[unsafe(method(enabledRemoteNotificationTypes))]
1679        #[unsafe(method_family = none)]
1680        pub unsafe fn enabledRemoteNotificationTypes(&self) -> NSRemoteNotificationType;
1681    );
1682}
1683
1684#[cfg(feature = "NSResponder")]
1685impl NSApplication {
1686    /// An Application's startup function.
1687    #[doc(alias = "NSApplicationMain")]
1688    #[inline]
1689    pub(crate) unsafe fn __main(argc: c_int, argv: NonNull<NonNull<c_char>>) -> c_int {
1690        extern "C-unwind" {
1691            fn NSApplicationMain(argc: c_int, argv: NonNull<NonNull<c_char>>) -> c_int;
1692        }
1693        unsafe { NSApplicationMain(argc, argv) }
1694    }
1695
1696    /// `NSApplicationLoad`should be called when loading a Cocoa bundle in a Carbon app in order to initialize
1697    /// `NSApplication`and other Cocoa objects.  Redundant calls are ignored.
1698    #[doc(alias = "NSApplicationLoad")]
1699    #[inline]
1700    pub unsafe fn load() -> bool {
1701        extern "C-unwind" {
1702            fn NSApplicationLoad() -> Bool;
1703        }
1704        unsafe { NSApplicationLoad() }.as_bool()
1705    }
1706}
1707
1708/// `NSShowsServicesMenuItem()`always returns
1709/// `YES.`
1710#[inline]
1711pub unsafe extern "C-unwind" fn NSShowsServicesMenuItem(item_name: &NSString) -> bool {
1712    extern "C-unwind" {
1713        fn NSShowsServicesMenuItem(item_name: &NSString) -> Bool;
1714    }
1715    unsafe { NSShowsServicesMenuItem(item_name) }.as_bool()
1716}
1717
1718/// `NSSetShowsServicesMenuItem()`has no effect, and always returns 0.
1719#[inline]
1720pub unsafe extern "C-unwind" fn NSSetShowsServicesMenuItem(
1721    item_name: &NSString,
1722    enabled: bool,
1723) -> NSInteger {
1724    extern "C-unwind" {
1725        fn NSSetShowsServicesMenuItem(item_name: &NSString, enabled: Bool) -> NSInteger;
1726    }
1727    unsafe { NSSetShowsServicesMenuItem(item_name, Bool::new(enabled)) }
1728}
1729
1730extern "C-unwind" {
1731    /// `NSUpdateDynamicServices()`causes the services information for the system to be updated.
1732    /// This will only be necessary if your program adds dynamic services to the system (i.e. services not found in mach-o segments of executables).
1733    pub fn NSUpdateDynamicServices();
1734}
1735
1736#[cfg(feature = "NSPasteboard")]
1737#[inline]
1738pub unsafe extern "C-unwind" fn NSPerformService(
1739    item_name: &NSString,
1740    pboard: Option<&NSPasteboard>,
1741) -> bool {
1742    extern "C-unwind" {
1743        fn NSPerformService(item_name: &NSString, pboard: Option<&NSPasteboard>) -> Bool;
1744    }
1745    unsafe { NSPerformService(item_name, pboard) }.as_bool()
1746}
1747
1748/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsserviceprovidername?language=objc)
1749pub type NSServiceProviderName = NSString;
1750
1751extern "C-unwind" {
1752    /// Apps should use -setServicesProvider.
1753    pub fn NSRegisterServicesProvider(provider: Option<&AnyObject>, name: &NSServiceProviderName);
1754}
1755
1756extern "C-unwind" {
1757    pub fn NSUnregisterServicesProvider(name: &NSServiceProviderName);
1758}
1759
1760extern "C" {
1761    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidbecomeactivenotification?language=objc)
1762    pub static NSApplicationDidBecomeActiveNotification: &'static NSNotificationName;
1763}
1764
1765extern "C" {
1766    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidhidenotification?language=objc)
1767    pub static NSApplicationDidHideNotification: &'static NSNotificationName;
1768}
1769
1770extern "C" {
1771    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidfinishlaunchingnotification?language=objc)
1772    pub static NSApplicationDidFinishLaunchingNotification: &'static NSNotificationName;
1773}
1774
1775extern "C" {
1776    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidresignactivenotification?language=objc)
1777    pub static NSApplicationDidResignActiveNotification: &'static NSNotificationName;
1778}
1779
1780extern "C" {
1781    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidunhidenotification?language=objc)
1782    pub static NSApplicationDidUnhideNotification: &'static NSNotificationName;
1783}
1784
1785extern "C" {
1786    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidupdatenotification?language=objc)
1787    pub static NSApplicationDidUpdateNotification: &'static NSNotificationName;
1788}
1789
1790extern "C" {
1791    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillbecomeactivenotification?language=objc)
1792    pub static NSApplicationWillBecomeActiveNotification: &'static NSNotificationName;
1793}
1794
1795extern "C" {
1796    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillhidenotification?language=objc)
1797    pub static NSApplicationWillHideNotification: &'static NSNotificationName;
1798}
1799
1800extern "C" {
1801    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillfinishlaunchingnotification?language=objc)
1802    pub static NSApplicationWillFinishLaunchingNotification: &'static NSNotificationName;
1803}
1804
1805extern "C" {
1806    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillresignactivenotification?language=objc)
1807    pub static NSApplicationWillResignActiveNotification: &'static NSNotificationName;
1808}
1809
1810extern "C" {
1811    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillunhidenotification?language=objc)
1812    pub static NSApplicationWillUnhideNotification: &'static NSNotificationName;
1813}
1814
1815extern "C" {
1816    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillupdatenotification?language=objc)
1817    pub static NSApplicationWillUpdateNotification: &'static NSNotificationName;
1818}
1819
1820extern "C" {
1821    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillterminatenotification?language=objc)
1822    pub static NSApplicationWillTerminateNotification: &'static NSNotificationName;
1823}
1824
1825extern "C" {
1826    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidchangescreenparametersnotification?language=objc)
1827    pub static NSApplicationDidChangeScreenParametersNotification: &'static NSNotificationName;
1828}
1829
1830extern "C" {
1831    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationprotecteddatawillbecomeunavailablenotification?language=objc)
1832    pub static NSApplicationProtectedDataWillBecomeUnavailableNotification:
1833        &'static NSNotificationName;
1834}
1835
1836extern "C" {
1837    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationprotecteddatadidbecomeavailablenotification?language=objc)
1838    pub static NSApplicationProtectedDataDidBecomeAvailableNotification:
1839        &'static NSNotificationName;
1840}
1841
1842extern "C" {
1843    /// The following key is present in the userInfo of NSApplicationDidFinishLaunchingNotification.  Its value is an NSNumber containing a bool.  It will be NO if the app was launched to open or print a file, to perform a Service, if the app had saved state that will be restored, or if the app launch was in some other sense not a "default" launch.  Otherwise its value will be YES.
1844    ///
1845    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationlaunchisdefaultlaunchkey?language=objc)
1846    pub static NSApplicationLaunchIsDefaultLaunchKey: &'static NSString;
1847}
1848
1849extern "C" {
1850    /// The following key is present in the userInfo of NSApplicationDidFinishLaunchingNotification. It will be present if your application was launched because a user activated a notification in the Notification Center. Its value is an NSUserNotification object.
1851    ///
1852    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationlaunchusernotificationkey?language=objc)
1853    pub static NSApplicationLaunchUserNotificationKey: &'static NSString;
1854}
1855
1856extern "C" {
1857    /// NSApplicationLaunchRemoteNotificationKey is unimplemented.  Please use NSApplicationLaunchUserNotificationKey to get the NSUserNotification object.  The NSUserNotification object has an isRemote property to indicate whether this application was launched as a result of a remote notification
1858    ///
1859    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationlaunchremotenotificationkey?language=objc)
1860    pub static NSApplicationLaunchRemoteNotificationKey: &'static NSString;
1861}
1862
1863extern "C" {
1864    /// Upon receiving this notification, you can query the NSApplication for its occlusion state. Note that this only notifies about changes in the state of the occlusion, not when the occlusion region changes. You can use this notification to increase responsiveness and save power, by halting any expensive calculations that the user can not see.
1865    ///
1866    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidchangeocclusionstatenotification?language=objc)
1867    pub static NSApplicationDidChangeOcclusionStateNotification: &'static NSNotificationName;
1868}
1869
1870/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrunstoppedresponse?language=objc)
1871#[deprecated = "Use NSModalResponseStop instead"]
1872pub const NSRunStoppedResponse: c_int = -1000;
1873/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrunabortedresponse?language=objc)
1874#[deprecated = "Use NSModalResponseAbort instead"]
1875pub const NSRunAbortedResponse: c_int = -1001;
1876/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsruncontinuesresponse?language=objc)
1877#[deprecated = "Use NSModalResponseContinue instead"]
1878pub const NSRunContinuesResponse: c_int = -1002;
1879
1880/// NSDeprecated.
1881#[cfg(feature = "NSResponder")]
1882impl NSApplication {
1883    extern_methods!(
1884        #[cfg(feature = "NSWindow")]
1885        /// `-runModalForWindow:relativeToWindow:` was deprecated in Mac OS X 10.0. Please use `-[NSWindow beginSheet:completionHandler:]` instead.
1886        #[deprecated = "Use -[NSWindow beginSheet:completionHandler:] instead"]
1887        #[unsafe(method(runModalForWindow:relativeToWindow:))]
1888        #[unsafe(method_family = none)]
1889        pub unsafe fn runModalForWindow_relativeToWindow(
1890            &self,
1891            window: Option<&NSWindow>,
1892            doc_window: Option<&NSWindow>,
1893        ) -> NSInteger;
1894
1895        #[cfg(feature = "NSWindow")]
1896        /// `-beginModalSessionForWindow:relativeToWindow:` was deprecated in Mac OS X 10.0. Please use `-[NSWindow beginSheet:completionHandler:]` instead.
1897        #[deprecated = "Use -[NSWindow beginSheet:completionHandler:] instead"]
1898        #[unsafe(method(beginModalSessionForWindow:relativeToWindow:))]
1899        #[unsafe(method_family = none)]
1900        pub unsafe fn beginModalSessionForWindow_relativeToWindow(
1901            &self,
1902            window: Option<&NSWindow>,
1903            doc_window: Option<&NSWindow>,
1904        ) -> NSModalSession;
1905
1906        /// `-application:printFiles:` was deprecated in Mac OS X 10.4.
1907        /// Implement `-application:printFiles:withSettings:showPrintPanels:` in your application delegate instead.
1908        #[deprecated]
1909        #[unsafe(method(application:printFiles:))]
1910        #[unsafe(method_family = none)]
1911        pub unsafe fn application_printFiles(
1912            &self,
1913            sender: Option<&NSApplication>,
1914            filenames: Option<&NSArray<NSString>>,
1915        );
1916
1917        #[cfg(feature = "NSWindow")]
1918        /// `NSWindow`'s `-beginSheet:completionHandler:` and `-endSheet:returnCode:` should be used instead.  `NSApplication`'s `-beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:` will continue to work as it previously did, leaking contextInfo and failing when there is already an existing sheet.
1919        #[deprecated = "Use -[NSWindow beginSheet:completionHandler:] instead"]
1920        #[unsafe(method(beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:))]
1921        #[unsafe(method_family = none)]
1922        pub unsafe fn beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo(
1923            &self,
1924            sheet: &NSWindow,
1925            doc_window: &NSWindow,
1926            modal_delegate: Option<&AnyObject>,
1927            did_end_selector: Option<Sel>,
1928            context_info: *mut c_void,
1929        );
1930
1931        #[cfg(feature = "NSWindow")]
1932        #[deprecated = "Use -[NSWindow endSheet:] instead"]
1933        #[unsafe(method(endSheet:))]
1934        #[unsafe(method_family = none)]
1935        pub unsafe fn endSheet(&self, sheet: &NSWindow);
1936
1937        #[cfg(feature = "NSWindow")]
1938        #[deprecated = "Use -[NSWindow endSheet:returnCode:] instead"]
1939        #[unsafe(method(endSheet:returnCode:))]
1940        #[unsafe(method_family = none)]
1941        pub unsafe fn endSheet_returnCode(&self, sheet: &NSWindow, return_code: NSInteger);
1942
1943        #[cfg(feature = "NSWindow")]
1944        #[deprecated = "Use -enumerateWindowsWithOptions:usingBlock: instead"]
1945        #[unsafe(method(makeWindowsPerform:inOrder:))]
1946        #[unsafe(method_family = none)]
1947        pub unsafe fn makeWindowsPerform_inOrder(
1948            &self,
1949            selector: Sel,
1950            in_order: bool,
1951        ) -> Option<Retained<NSWindow>>;
1952
1953        #[cfg(feature = "NSGraphicsContext")]
1954        /// This method is deprecated as of macOS 10.12. Beginning in OS X 10.11 it would always return nil. Prior to this it would return an undefined graphics context that was not generally suitable for drawing.
1955        #[deprecated = "This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation."]
1956        #[unsafe(method(context))]
1957        #[unsafe(method_family = none)]
1958        pub unsafe fn context(&self) -> Option<Retained<NSGraphicsContext>>;
1959    );
1960}
1961
1962extern "C-unwind" {
1963    #[deprecated = "renamed to `NSApplication::__main`"]
1964    pub fn NSApplicationMain(argc: c_int, argv: NonNull<NonNull<c_char>>) -> c_int;
1965}
1966
1967#[deprecated = "renamed to `NSApplication::load`"]
1968#[inline]
1969pub unsafe extern "C-unwind" fn NSApplicationLoad() -> bool {
1970    extern "C-unwind" {
1971        fn NSApplicationLoad() -> Bool;
1972    }
1973    unsafe { NSApplicationLoad() }.as_bool()
1974}