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"))]
454unsafe impl NSAccessibility for NSApplication {}
455
456#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
457unsafe impl NSAccessibilityElementProtocol for NSApplication {}
458
459#[cfg(feature = "NSResponder")]
460unsafe impl NSCoding for NSApplication {}
461
462#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
463unsafe impl NSMenuItemValidation for NSApplication {}
464
465#[cfg(feature = "NSResponder")]
466unsafe impl NSObjectProtocol for NSApplication {}
467
468#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
469unsafe impl NSUserInterfaceValidations for NSApplication {}
470
471#[cfg(feature = "NSResponder")]
472impl NSApplication {
473    extern_methods!(
474        #[unsafe(method(sharedApplication))]
475        #[unsafe(method_family = none)]
476        pub fn sharedApplication(mtm: MainThreadMarker) -> Retained<NSApplication>;
477
478        #[unsafe(method(delegate))]
479        #[unsafe(method_family = none)]
480        pub unsafe fn delegate(
481            &self,
482        ) -> Option<Retained<ProtocolObject<dyn NSApplicationDelegate>>>;
483
484        /// This is a [weak property][objc2::topics::weak_property].
485        /// Setter for [`delegate`][Self::delegate].
486        #[unsafe(method(setDelegate:))]
487        #[unsafe(method_family = none)]
488        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSApplicationDelegate>>);
489
490        #[unsafe(method(hide:))]
491        #[unsafe(method_family = none)]
492        pub fn hide(&self, sender: Option<&AnyObject>);
493
494        #[unsafe(method(unhide:))]
495        #[unsafe(method_family = none)]
496        pub unsafe fn unhide(&self, sender: Option<&AnyObject>);
497
498        #[unsafe(method(unhideWithoutActivation))]
499        #[unsafe(method_family = none)]
500        pub unsafe fn unhideWithoutActivation(&self);
501
502        #[cfg(feature = "NSWindow")]
503        #[unsafe(method(windowWithWindowNumber:))]
504        #[unsafe(method_family = none)]
505        pub unsafe fn windowWithWindowNumber(
506            &self,
507            window_num: NSInteger,
508        ) -> Option<Retained<NSWindow>>;
509
510        #[cfg(feature = "NSWindow")]
511        #[unsafe(method(mainWindow))]
512        #[unsafe(method_family = none)]
513        pub unsafe fn mainWindow(&self) -> Option<Retained<NSWindow>>;
514
515        #[cfg(feature = "NSWindow")]
516        #[unsafe(method(keyWindow))]
517        #[unsafe(method_family = none)]
518        pub fn keyWindow(&self) -> Option<Retained<NSWindow>>;
519
520        #[unsafe(method(isActive))]
521        #[unsafe(method_family = none)]
522        pub unsafe fn isActive(&self) -> bool;
523
524        #[unsafe(method(isHidden))]
525        #[unsafe(method_family = none)]
526        pub unsafe fn isHidden(&self) -> bool;
527
528        #[unsafe(method(isRunning))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn isRunning(&self) -> bool;
531
532        #[unsafe(method(deactivate))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn deactivate(&self);
535
536        /// Makes the receiver the active app.
537        /// - Parameter ignoreOtherApps: If `NO`, the app is activated only if no other app is currently active. If `YES`, the app activates regardless.
538        #[deprecated = "This method will be deprecated in a future release. Use NSApp.activate instead."]
539        #[unsafe(method(activateIgnoringOtherApps:))]
540        #[unsafe(method_family = none)]
541        pub fn activateIgnoringOtherApps(&self, ignore_other_apps: bool);
542
543        /// Makes the receiver the active app, if possible.
544        ///
545        /// You shouldn’t assume the app will be active immediately
546        /// after sending this message. The framework also does not
547        /// guarantee that the app will be activated at all.
548        ///
549        /// For cooperative activation, the other application should
550        /// call `-yieldActivationToApplication:` or equivalent prior
551        /// to the target application invoking `-activate`.
552        ///
553        /// Invoking `-activate` on an already-active application
554        /// cancels any pending activation yields by the receiver.
555        #[unsafe(method(activate))]
556        #[unsafe(method_family = none)]
557        pub unsafe fn activate(&self);
558
559        #[cfg(feature = "NSRunningApplication")]
560        /// Explicitly allows another application to make itself active.
561        ///
562        /// Calling this method will not deactivate the current app, nor
563        /// will it activate the other app. For cooperative or coordinated
564        /// activation, the other app should request to be activated at
565        /// some point in the future by calling `activate` or equivalent.
566        #[unsafe(method(yieldActivationToApplication:))]
567        #[unsafe(method_family = none)]
568        pub unsafe fn yieldActivationToApplication(&self, application: &NSRunningApplication);
569
570        /// Same as `-yieldActivationToApplication:`, but the provided
571        /// bundle identifier does not have to correspond to a currently
572        /// running application.
573        ///
574        /// This method should be used to yield activation to apps that
575        /// may not be running at the time of invoking it. If it is known
576        /// that the target application is currently running, use
577        /// `-yieldActivationToApplication:` instead.
578        #[unsafe(method(yieldActivationToApplicationWithBundleIdentifier:))]
579        #[unsafe(method_family = none)]
580        pub unsafe fn yieldActivationToApplicationWithBundleIdentifier(
581            &self,
582            bundle_identifier: &NSString,
583        );
584
585        #[unsafe(method(hideOtherApplications:))]
586        #[unsafe(method_family = none)]
587        pub fn hideOtherApplications(&self, sender: Option<&AnyObject>);
588
589        #[unsafe(method(unhideAllApplications:))]
590        #[unsafe(method_family = none)]
591        pub unsafe fn unhideAllApplications(&self, sender: Option<&AnyObject>);
592
593        #[unsafe(method(finishLaunching))]
594        #[unsafe(method_family = none)]
595        pub unsafe fn finishLaunching(&self);
596
597        #[unsafe(method(run))]
598        #[unsafe(method_family = none)]
599        pub fn run(&self);
600
601        #[cfg(feature = "NSWindow")]
602        #[unsafe(method(runModalForWindow:))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn runModalForWindow(&self, window: &NSWindow) -> NSModalResponse;
605
606        #[unsafe(method(stop:))]
607        #[unsafe(method_family = none)]
608        pub fn stop(&self, sender: Option<&AnyObject>);
609
610        #[unsafe(method(stopModal))]
611        #[unsafe(method_family = none)]
612        pub unsafe fn stopModal(&self);
613
614        #[unsafe(method(stopModalWithCode:))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn stopModalWithCode(&self, return_code: NSModalResponse);
617
618        #[unsafe(method(abortModal))]
619        #[unsafe(method_family = none)]
620        pub unsafe fn abortModal(&self);
621
622        #[cfg(feature = "NSWindow")]
623        #[unsafe(method(modalWindow))]
624        #[unsafe(method_family = none)]
625        pub unsafe fn modalWindow(&self) -> Option<Retained<NSWindow>>;
626
627        #[cfg(feature = "NSWindow")]
628        #[unsafe(method(beginModalSessionForWindow:))]
629        #[unsafe(method_family = none)]
630        pub unsafe fn beginModalSessionForWindow(&self, window: &NSWindow) -> NSModalSession;
631
632        #[unsafe(method(runModalSession:))]
633        #[unsafe(method_family = none)]
634        pub unsafe fn runModalSession(&self, session: NSModalSession) -> NSModalResponse;
635
636        #[unsafe(method(endModalSession:))]
637        #[unsafe(method_family = none)]
638        pub unsafe fn endModalSession(&self, session: NSModalSession);
639
640        #[unsafe(method(terminate:))]
641        #[unsafe(method_family = none)]
642        pub unsafe fn terminate(&self, sender: Option<&AnyObject>);
643
644        /// Inform the user that this application needs attention - call this method only if your application is not already active.
645        #[unsafe(method(requestUserAttention:))]
646        #[unsafe(method_family = none)]
647        pub fn requestUserAttention(&self, request_type: NSRequestUserAttentionType) -> NSInteger;
648
649        #[unsafe(method(cancelUserAttentionRequest:))]
650        #[unsafe(method_family = none)]
651        pub unsafe fn cancelUserAttentionRequest(&self, request: NSInteger);
652
653        #[cfg(all(feature = "NSWindow", feature = "block2"))]
654        /// Execute a block for each of the app's windows. Set `*stop = YES` if desired, to halt the enumeration early.
655        #[unsafe(method(enumerateWindowsWithOptions:usingBlock:))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn enumerateWindowsWithOptions_usingBlock(
658            &self,
659            options: NSWindowListOptions,
660            block: &block2::Block<dyn Fn(NonNull<NSWindow>, NonNull<Bool>) + '_>,
661        );
662
663        #[unsafe(method(preventWindowOrdering))]
664        #[unsafe(method_family = none)]
665        pub unsafe fn preventWindowOrdering(&self);
666
667        #[cfg(feature = "NSWindow")]
668        #[unsafe(method(windows))]
669        #[unsafe(method_family = none)]
670        pub fn windows(&self) -> Retained<NSArray<NSWindow>>;
671
672        #[unsafe(method(setWindowsNeedUpdate:))]
673        #[unsafe(method_family = none)]
674        pub unsafe fn setWindowsNeedUpdate(&self, need_update: bool);
675
676        #[unsafe(method(updateWindows))]
677        #[unsafe(method_family = none)]
678        pub unsafe fn updateWindows(&self);
679
680        #[cfg(feature = "NSMenu")]
681        #[unsafe(method(mainMenu))]
682        #[unsafe(method_family = none)]
683        pub unsafe fn mainMenu(&self) -> Option<Retained<NSMenu>>;
684
685        #[cfg(feature = "NSMenu")]
686        /// Setter for [`mainMenu`][Self::mainMenu].
687        #[unsafe(method(setMainMenu:))]
688        #[unsafe(method_family = none)]
689        pub fn setMainMenu(&self, main_menu: Option<&NSMenu>);
690
691        #[cfg(feature = "NSMenu")]
692        /// 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.
693        /// `NSApplication`retains its Help menu and releases it when a different menu is set.
694        #[unsafe(method(helpMenu))]
695        #[unsafe(method_family = none)]
696        pub unsafe fn helpMenu(&self) -> Option<Retained<NSMenu>>;
697
698        #[cfg(feature = "NSMenu")]
699        /// Setter for [`helpMenu`][Self::helpMenu].
700        #[unsafe(method(setHelpMenu:))]
701        #[unsafe(method_family = none)]
702        pub unsafe fn setHelpMenu(&self, help_menu: Option<&NSMenu>);
703
704        #[cfg(feature = "NSImage")]
705        #[unsafe(method(applicationIconImage))]
706        #[unsafe(method_family = none)]
707        pub unsafe fn applicationIconImage(&self) -> Option<Retained<NSImage>>;
708
709        #[cfg(feature = "NSImage")]
710        /// Setter for [`applicationIconImage`][Self::applicationIconImage].
711        #[unsafe(method(setApplicationIconImage:))]
712        #[unsafe(method_family = none)]
713        pub unsafe fn setApplicationIconImage(&self, application_icon_image: Option<&NSImage>);
714
715        #[cfg(feature = "NSRunningApplication")]
716        /// Returns: The activation policy of the application.
717        #[unsafe(method(activationPolicy))]
718        #[unsafe(method_family = none)]
719        pub unsafe fn activationPolicy(&self) -> NSApplicationActivationPolicy;
720
721        #[cfg(feature = "NSRunningApplication")]
722        /// 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
723        /// `NSApplicationActivationPolicyProhibited`or
724        /// `NSApplicationActivationPolicyRegular,`but may not be changed to
725        /// `NSApplicationActivationPolicyAccessory.`This returns
726        /// `YES`if setting the activation policy is successful, and
727        /// `NO`if not.
728        #[unsafe(method(setActivationPolicy:))]
729        #[unsafe(method_family = none)]
730        pub fn setActivationPolicy(&self, activation_policy: NSApplicationActivationPolicy)
731            -> bool;
732
733        #[cfg(feature = "NSDockTile")]
734        #[unsafe(method(dockTile))]
735        #[unsafe(method_family = none)]
736        pub unsafe fn dockTile(&self) -> Retained<NSDockTile>;
737
738        #[unsafe(method(reportException:))]
739        #[unsafe(method_family = none)]
740        pub unsafe fn reportException(&self, exception: &NSException);
741
742        #[unsafe(method(detachDrawingThread:toTarget:withObject:))]
743        #[unsafe(method_family = none)]
744        pub unsafe fn detachDrawingThread_toTarget_withObject(
745            selector: Sel,
746            target: &AnyObject,
747            argument: Option<&AnyObject>,
748            mtm: MainThreadMarker,
749        );
750
751        /// If an application delegate returns NSTerminateLater from -applicationShouldTerminate:, -replyToApplicationShouldTerminate: must be called with YES or NO once the application decides if it can terminate.
752        #[unsafe(method(replyToApplicationShouldTerminate:))]
753        #[unsafe(method_family = none)]
754        pub unsafe fn replyToApplicationShouldTerminate(&self, should_terminate: bool);
755
756        /// If an application delegate encounters an error while handling `-application:openFiles:` or` -application:printFiles:`, `-replyToOpenOrPrint:` should be called with
757        /// `NSApplicationDelegateReplyFailure.`If the user cancels the operation,
758        /// `NSApplicationDelegateReplyCancel`should be used, and if the operation succeeds,
759        /// `NSApplicationDelegateReplySuccess`should be used .
760        #[unsafe(method(replyToOpenOrPrint:))]
761        #[unsafe(method_family = none)]
762        pub unsafe fn replyToOpenOrPrint(&self, reply: NSApplicationDelegateReply);
763
764        /// Opens the character palette.
765        #[unsafe(method(orderFrontCharacterPalette:))]
766        #[unsafe(method_family = none)]
767        pub fn orderFrontCharacterPalette(&self, sender: Option<&AnyObject>);
768
769        /// Gets or sets the
770        /// `presentationOptions`that should be in effect for the system when this application is the active application.  Only certain combinations of
771        /// `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.
772        #[unsafe(method(presentationOptions))]
773        #[unsafe(method_family = none)]
774        pub fn presentationOptions(&self) -> NSApplicationPresentationOptions;
775
776        /// Setter for [`presentationOptions`][Self::presentationOptions].
777        #[unsafe(method(setPresentationOptions:))]
778        #[unsafe(method_family = none)]
779        pub fn setPresentationOptions(
780            &self,
781            presentation_options: NSApplicationPresentationOptions,
782        );
783
784        /// Returns: The set of application presentation options that are currently in effect for the system.
785        /// These are the presentation options that have been put into effect by the currently active application.
786        #[unsafe(method(currentSystemPresentationOptions))]
787        #[unsafe(method_family = none)]
788        pub unsafe fn currentSystemPresentationOptions(&self) -> NSApplicationPresentationOptions;
789
790        #[unsafe(method(occlusionState))]
791        #[unsafe(method_family = none)]
792        pub unsafe fn occlusionState(&self) -> NSApplicationOcclusionState;
793
794        #[unsafe(method(isProtectedDataAvailable))]
795        #[unsafe(method_family = none)]
796        pub unsafe fn isProtectedDataAvailable(&self) -> bool;
797    );
798}
799
800/// Methods declared on superclass `NSResponder`.
801#[cfg(feature = "NSResponder")]
802impl NSApplication {
803    extern_methods!(
804        #[unsafe(method(init))]
805        #[unsafe(method_family = init)]
806        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
807
808        #[unsafe(method(initWithCoder:))]
809        #[unsafe(method_family = init)]
810        pub unsafe fn initWithCoder(
811            this: Allocated<Self>,
812            coder: &NSCoder,
813        ) -> Option<Retained<Self>>;
814    );
815}
816
817/// Methods declared on superclass `NSObject`.
818#[cfg(feature = "NSResponder")]
819impl NSApplication {
820    extern_methods!(
821        #[unsafe(method(new))]
822        #[unsafe(method_family = new)]
823        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
824    );
825}
826
827/// NSAppearanceCustomization.
828#[cfg(feature = "NSResponder")]
829impl NSApplication {
830    extern_methods!(
831        #[cfg(feature = "NSAppearance")]
832        #[unsafe(method(appearance))]
833        #[unsafe(method_family = none)]
834        pub unsafe fn appearance(&self) -> Option<Retained<NSAppearance>>;
835
836        #[cfg(feature = "NSAppearance")]
837        /// Setter for [`appearance`][Self::appearance].
838        #[unsafe(method(setAppearance:))]
839        #[unsafe(method_family = none)]
840        pub fn setAppearance(&self, appearance: Option<&NSAppearance>);
841
842        #[cfg(feature = "NSAppearance")]
843        #[unsafe(method(effectiveAppearance))]
844        #[unsafe(method_family = none)]
845        pub fn effectiveAppearance(&self) -> Retained<NSAppearance>;
846    );
847}
848
849#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
850unsafe impl NSAppearanceCustomization for NSApplication {}
851
852/// NSEvent.
853#[cfg(feature = "NSResponder")]
854impl NSApplication {
855    extern_methods!(
856        #[cfg(feature = "NSEvent")]
857        #[unsafe(method(sendEvent:))]
858        #[unsafe(method_family = none)]
859        pub unsafe fn sendEvent(&self, event: &NSEvent);
860
861        #[cfg(feature = "NSEvent")]
862        #[unsafe(method(postEvent:atStart:))]
863        #[unsafe(method_family = none)]
864        pub fn postEvent_atStart(&self, event: &NSEvent, at_start: bool);
865
866        #[cfg(feature = "NSEvent")]
867        #[unsafe(method(currentEvent))]
868        #[unsafe(method_family = none)]
869        pub fn currentEvent(&self) -> Option<Retained<NSEvent>>;
870
871        #[cfg(feature = "NSEvent")]
872        #[unsafe(method(nextEventMatchingMask:untilDate:inMode:dequeue:))]
873        #[unsafe(method_family = none)]
874        pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
875            &self,
876            mask: NSEventMask,
877            expiration: Option<&NSDate>,
878            mode: &NSRunLoopMode,
879            deq_flag: bool,
880        ) -> Option<Retained<NSEvent>>;
881
882        #[cfg(feature = "NSEvent")]
883        #[unsafe(method(discardEventsMatchingMask:beforeEvent:))]
884        #[unsafe(method_family = none)]
885        pub unsafe fn discardEventsMatchingMask_beforeEvent(
886            &self,
887            mask: NSEventMask,
888            last_event: Option<&NSEvent>,
889        );
890    );
891}
892
893/// NSResponder.
894#[cfg(feature = "NSResponder")]
895impl NSApplication {
896    extern_methods!(
897        #[unsafe(method(sendAction:to:from:))]
898        #[unsafe(method_family = none)]
899        pub unsafe fn sendAction_to_from(
900            &self,
901            action: Sel,
902            target: Option<&AnyObject>,
903            sender: Option<&AnyObject>,
904        ) -> bool;
905
906        #[unsafe(method(targetForAction:))]
907        #[unsafe(method_family = none)]
908        pub unsafe fn targetForAction(&self, action: Sel) -> Option<Retained<AnyObject>>;
909
910        #[unsafe(method(targetForAction:to:from:))]
911        #[unsafe(method_family = none)]
912        pub unsafe fn targetForAction_to_from(
913            &self,
914            action: Sel,
915            target: Option<&AnyObject>,
916            sender: Option<&AnyObject>,
917        ) -> Option<Retained<AnyObject>>;
918
919        #[unsafe(method(tryToPerform:with:))]
920        #[unsafe(method_family = none)]
921        pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
922
923        #[cfg(feature = "NSPasteboard")]
924        #[unsafe(method(validRequestorForSendType:returnType:))]
925        #[unsafe(method_family = none)]
926        pub unsafe fn validRequestorForSendType_returnType(
927            &self,
928            send_type: Option<&NSPasteboardType>,
929            return_type: Option<&NSPasteboardType>,
930        ) -> Option<Retained<AnyObject>>;
931    );
932}
933
934/// NSWindowsMenu.
935#[cfg(feature = "NSResponder")]
936impl NSApplication {
937    extern_methods!(
938        #[cfg(feature = "NSMenu")]
939        #[unsafe(method(windowsMenu))]
940        #[unsafe(method_family = none)]
941        pub unsafe fn windowsMenu(&self) -> Option<Retained<NSMenu>>;
942
943        #[cfg(feature = "NSMenu")]
944        /// Setter for [`windowsMenu`][Self::windowsMenu].
945        #[unsafe(method(setWindowsMenu:))]
946        #[unsafe(method_family = none)]
947        pub unsafe fn setWindowsMenu(&self, windows_menu: Option<&NSMenu>);
948
949        #[unsafe(method(arrangeInFront:))]
950        #[unsafe(method_family = none)]
951        pub unsafe fn arrangeInFront(&self, sender: Option<&AnyObject>);
952
953        #[cfg(feature = "NSWindow")]
954        #[unsafe(method(removeWindowsItem:))]
955        #[unsafe(method_family = none)]
956        pub unsafe fn removeWindowsItem(&self, win: &NSWindow);
957
958        #[cfg(feature = "NSWindow")]
959        #[unsafe(method(addWindowsItem:title:filename:))]
960        #[unsafe(method_family = none)]
961        pub unsafe fn addWindowsItem_title_filename(
962            &self,
963            win: &NSWindow,
964            string: &NSString,
965            is_filename: bool,
966        );
967
968        #[cfg(feature = "NSWindow")]
969        #[unsafe(method(changeWindowsItem:title:filename:))]
970        #[unsafe(method_family = none)]
971        pub unsafe fn changeWindowsItem_title_filename(
972            &self,
973            win: &NSWindow,
974            string: &NSString,
975            is_filename: bool,
976        );
977
978        #[cfg(feature = "NSWindow")]
979        #[unsafe(method(updateWindowsItem:))]
980        #[unsafe(method_family = none)]
981        pub unsafe fn updateWindowsItem(&self, win: &NSWindow);
982
983        #[unsafe(method(miniaturizeAll:))]
984        #[unsafe(method_family = none)]
985        pub unsafe fn miniaturizeAll(&self, sender: Option<&AnyObject>);
986    );
987}
988
989/// NSFullKeyboardAccess.
990#[cfg(feature = "NSResponder")]
991impl NSApplication {
992    extern_methods!(
993        /// A Boolean value indicating whether keyboard navigation is enabled in System Settings > Keyboard.
994        /// - 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.
995        /// - Note: This property’s value isn’t necessarily reflective of the separate accessibility setting named “Full Keyboard Access” in System Settings > Accessibility > Keyboard.
996        #[unsafe(method(isFullKeyboardAccessEnabled))]
997        #[unsafe(method_family = none)]
998        pub unsafe fn isFullKeyboardAccessEnabled(&self) -> bool;
999    );
1000}
1001
1002/// Return values for `-applicationShouldTerminate:`.
1003///
1004/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationterminatereply?language=objc)
1005// NS_ENUM
1006#[repr(transparent)]
1007#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1008pub struct NSApplicationTerminateReply(pub NSUInteger);
1009impl NSApplicationTerminateReply {
1010    #[doc(alias = "NSTerminateCancel")]
1011    pub const TerminateCancel: Self = Self(0);
1012    #[doc(alias = "NSTerminateNow")]
1013    pub const TerminateNow: Self = Self(1);
1014    #[doc(alias = "NSTerminateLater")]
1015    pub const TerminateLater: Self = Self(2);
1016}
1017
1018unsafe impl Encode for NSApplicationTerminateReply {
1019    const ENCODING: Encoding = NSUInteger::ENCODING;
1020}
1021
1022unsafe impl RefEncode for NSApplicationTerminateReply {
1023    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1024}
1025
1026/// Return values for `-application:printFiles:withSettings:showPrintPanels:`.
1027///
1028/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationprintreply?language=objc)
1029// NS_ENUM
1030#[repr(transparent)]
1031#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1032pub struct NSApplicationPrintReply(pub NSUInteger);
1033impl NSApplicationPrintReply {
1034    #[doc(alias = "NSPrintingCancelled")]
1035    pub const PrintingCancelled: Self = Self(0);
1036    #[doc(alias = "NSPrintingSuccess")]
1037    pub const PrintingSuccess: Self = Self(1);
1038    #[doc(alias = "NSPrintingReplyLater")]
1039    pub const PrintingReplyLater: Self = Self(2);
1040    #[doc(alias = "NSPrintingFailure")]
1041    pub const PrintingFailure: Self = Self(3);
1042}
1043
1044unsafe impl Encode for NSApplicationPrintReply {
1045    const ENCODING: Encoding = NSUInteger::ENCODING;
1046}
1047
1048unsafe impl RefEncode for NSApplicationPrintReply {
1049    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1050}
1051
1052extern_protocol!(
1053    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdelegate?language=objc)
1054    pub unsafe trait NSApplicationDelegate: NSObjectProtocol + MainThreadOnly {
1055        #[cfg(feature = "NSResponder")]
1056        /// Allowable return values are:
1057        /// `NSTerminateNow`- it is ok to proceed with termination
1058        /// `NSTerminateCancel`- the application should not be terminated
1059        /// `NSTerminateLater`- it may be ok to proceed with termination later.  The application must call `-replyToApplicationShouldTerminate:` with
1060        /// `YES`or
1061        /// `NO`once the answer is known
1062        ///
1063        /// Note: This return value is for delegates who need to provide document modal alerts (sheets) in order to decide whether to quit.
1064        #[optional]
1065        #[unsafe(method(applicationShouldTerminate:))]
1066        #[unsafe(method_family = none)]
1067        unsafe fn applicationShouldTerminate(
1068            &self,
1069            sender: &NSApplication,
1070        ) -> NSApplicationTerminateReply;
1071
1072        #[cfg(feature = "NSResponder")]
1073        /// 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 (
1074        /// `CFBundleDocumentTypes)`that have no associated
1075        /// `NSDocument`class. Document URLs that have an associated
1076        /// `NSDocument`class will be opened through
1077        /// `NSDocumentController.`If this is implemented, `-application:openFiles:` and `-application:openFile:` will not be called.
1078        #[optional]
1079        #[unsafe(method(application:openURLs:))]
1080        #[unsafe(method_family = none)]
1081        unsafe fn application_openURLs(&self, application: &NSApplication, urls: &NSArray<NSURL>);
1082
1083        #[cfg(feature = "NSResponder")]
1084        #[optional]
1085        #[unsafe(method(application:openFile:))]
1086        #[unsafe(method_family = none)]
1087        unsafe fn application_openFile(&self, sender: &NSApplication, filename: &NSString) -> bool;
1088
1089        #[cfg(feature = "NSResponder")]
1090        #[optional]
1091        #[unsafe(method(application:openFiles:))]
1092        #[unsafe(method_family = none)]
1093        unsafe fn application_openFiles(
1094            &self,
1095            sender: &NSApplication,
1096            filenames: &NSArray<NSString>,
1097        );
1098
1099        #[cfg(feature = "NSResponder")]
1100        #[optional]
1101        #[unsafe(method(application:openTempFile:))]
1102        #[unsafe(method_family = none)]
1103        unsafe fn application_openTempFile(
1104            &self,
1105            sender: &NSApplication,
1106            filename: &NSString,
1107        ) -> bool;
1108
1109        #[cfg(feature = "NSResponder")]
1110        #[optional]
1111        #[unsafe(method(applicationShouldOpenUntitledFile:))]
1112        #[unsafe(method_family = none)]
1113        unsafe fn applicationShouldOpenUntitledFile(&self, sender: &NSApplication) -> bool;
1114
1115        #[cfg(feature = "NSResponder")]
1116        #[optional]
1117        #[unsafe(method(applicationOpenUntitledFile:))]
1118        #[unsafe(method_family = none)]
1119        unsafe fn applicationOpenUntitledFile(&self, sender: &NSApplication) -> bool;
1120
1121        #[optional]
1122        #[unsafe(method(application:openFileWithoutUI:))]
1123        #[unsafe(method_family = none)]
1124        unsafe fn application_openFileWithoutUI(
1125            &self,
1126            sender: &AnyObject,
1127            filename: &NSString,
1128        ) -> bool;
1129
1130        #[cfg(feature = "NSResponder")]
1131        #[optional]
1132        #[unsafe(method(application:printFile:))]
1133        #[unsafe(method_family = none)]
1134        unsafe fn application_printFile(&self, sender: &NSApplication, filename: &NSString)
1135            -> bool;
1136
1137        #[cfg(all(feature = "NSPrintInfo", feature = "NSResponder"))]
1138        #[optional]
1139        #[unsafe(method(application:printFiles:withSettings:showPrintPanels:))]
1140        #[unsafe(method_family = none)]
1141        unsafe fn application_printFiles_withSettings_showPrintPanels(
1142            &self,
1143            application: &NSApplication,
1144            file_names: &NSArray<NSString>,
1145            print_settings: &NSDictionary<NSPrintInfoAttributeKey, AnyObject>,
1146            show_print_panels: bool,
1147        ) -> NSApplicationPrintReply;
1148
1149        #[cfg(feature = "NSResponder")]
1150        #[optional]
1151        #[unsafe(method(applicationShouldTerminateAfterLastWindowClosed:))]
1152        #[unsafe(method_family = none)]
1153        unsafe fn applicationShouldTerminateAfterLastWindowClosed(
1154            &self,
1155            sender: &NSApplication,
1156        ) -> bool;
1157
1158        #[cfg(feature = "NSResponder")]
1159        #[optional]
1160        #[unsafe(method(applicationShouldHandleReopen:hasVisibleWindows:))]
1161        #[unsafe(method_family = none)]
1162        unsafe fn applicationShouldHandleReopen_hasVisibleWindows(
1163            &self,
1164            sender: &NSApplication,
1165            has_visible_windows: bool,
1166        ) -> bool;
1167
1168        #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
1169        #[optional]
1170        #[unsafe(method(applicationDockMenu:))]
1171        #[unsafe(method_family = none)]
1172        unsafe fn applicationDockMenu(&self, sender: &NSApplication) -> Option<Retained<NSMenu>>;
1173
1174        #[cfg(feature = "NSResponder")]
1175        #[optional]
1176        #[unsafe(method(application:willPresentError:))]
1177        #[unsafe(method_family = none)]
1178        unsafe fn application_willPresentError(
1179            &self,
1180            application: &NSApplication,
1181            error: &NSError,
1182        ) -> Retained<NSError>;
1183
1184        #[cfg(feature = "NSResponder")]
1185        #[optional]
1186        #[unsafe(method(application:didRegisterForRemoteNotificationsWithDeviceToken:))]
1187        #[unsafe(method_family = none)]
1188        unsafe fn application_didRegisterForRemoteNotificationsWithDeviceToken(
1189            &self,
1190            application: &NSApplication,
1191            device_token: &NSData,
1192        );
1193
1194        #[cfg(feature = "NSResponder")]
1195        #[optional]
1196        #[unsafe(method(application:didFailToRegisterForRemoteNotificationsWithError:))]
1197        #[unsafe(method_family = none)]
1198        unsafe fn application_didFailToRegisterForRemoteNotificationsWithError(
1199            &self,
1200            application: &NSApplication,
1201            error: &NSError,
1202        );
1203
1204        #[cfg(feature = "NSResponder")]
1205        #[optional]
1206        #[unsafe(method(application:didReceiveRemoteNotification:))]
1207        #[unsafe(method_family = none)]
1208        unsafe fn application_didReceiveRemoteNotification(
1209            &self,
1210            application: &NSApplication,
1211            user_info: &NSDictionary<NSString, AnyObject>,
1212        );
1213
1214        #[cfg(feature = "NSResponder")]
1215        /// Method to opt-in to secure restorable state.
1216        ///
1217        /// When this returns
1218        /// `YES:`NSCoders that are passed into the various
1219        /// `NSWindowRestoration`methods will
1220        /// `requiresSecureCoding`and have a
1221        /// `decodingFailurePolicy`of
1222        /// `NSDecodingFailurePolicySetErrorAndReturn.`Any
1223        /// `restorationClass`set on a window must explicitly conform to
1224        /// `NSWindowRestoration.`This method will be called prior to any state encoding or restoration.
1225        #[optional]
1226        #[unsafe(method(applicationSupportsSecureRestorableState:))]
1227        #[unsafe(method_family = none)]
1228        unsafe fn applicationSupportsSecureRestorableState(&self, app: &NSApplication) -> bool;
1229
1230        #[cfg(feature = "NSResponder")]
1231        /// Method called by `-[NSApplication encodeRestorableStateWithCoder:]` to give the delegate a chance to encode any additional state into the
1232        /// `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.
1233        #[optional]
1234        #[unsafe(method(application:willEncodeRestorableState:))]
1235        #[unsafe(method_family = none)]
1236        unsafe fn application_willEncodeRestorableState(
1237            &self,
1238            app: &NSApplication,
1239            coder: &NSCoder,
1240        );
1241
1242        #[cfg(feature = "NSResponder")]
1243        /// Method called by `-[NSApplication restoreStateWithCoder:]` to give the delegate a chance to restore its own state, which it may decode from the
1244        /// `NSCoder.`See the header `NSWindowRestoration.h` for more information.
1245        #[optional]
1246        #[unsafe(method(application:didDecodeRestorableState:))]
1247        #[unsafe(method_family = none)]
1248        unsafe fn application_didDecodeRestorableState(&self, app: &NSApplication, coder: &NSCoder);
1249
1250        #[cfg(feature = "NSResponder")]
1251        /// This will be called on the main thread as soon as the user indicates they want to continue an activity in your application. The
1252        /// `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
1253        /// `YES`to indicate that you are doing so. Return
1254        /// `NO`(or leave it unimplemented) and AppKit/UIKit will put up a default UI.
1255        ///
1256        /// 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.
1257        #[optional]
1258        #[unsafe(method(application:willContinueUserActivityWithType:))]
1259        #[unsafe(method_family = none)]
1260        unsafe fn application_willContinueUserActivityWithType(
1261            &self,
1262            application: &NSApplication,
1263            user_activity_type: &NSString,
1264        ) -> bool;
1265
1266        #[cfg(all(
1267            feature = "NSResponder",
1268            feature = "NSUserActivity",
1269            feature = "block2"
1270        ))]
1271        /// This will be called on the main thread after the
1272        /// `NSUserActivity`object is available. Use the data you stored in the NSUserActivity object to re-create what the user was doing.
1273        ///
1274        ///
1275        /// Returns: `YES`to indicate that the activity was handled. Return
1276        /// `NO`(or leave it unimplemented) and AppKit will attempt to continue the user activity.
1277        ///
1278        /// 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
1279        /// `restorationHandler`is optional. It may be copied and invoked later, but must be invoked on the main thread.
1280        ///
1281        /// If this user activity was created automatically by having
1282        /// `NSUbiquitousDocumentUserActivityType`in a
1283        /// `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
1284        /// `NSUserActivityDocumentURLKey.`The document will have `-restoreUserActivity:` called on it.
1285        #[optional]
1286        #[unsafe(method(application:continueUserActivity:restorationHandler:))]
1287        #[unsafe(method_family = none)]
1288        unsafe fn application_continueUserActivity_restorationHandler(
1289            &self,
1290            application: &NSApplication,
1291            user_activity: &NSUserActivity,
1292            restoration_handler: &block2::Block<
1293                dyn Fn(NonNull<NSArray<ProtocolObject<dyn NSUserActivityRestoring>>>),
1294            >,
1295        ) -> bool;
1296
1297        #[cfg(feature = "NSResponder")]
1298        /// There are instances where continuing a
1299        /// `NSUserActivity`may fail. This will get called on the main thread if it does so. If it is unimplemented, AppKit will present the error.
1300        #[optional]
1301        #[unsafe(method(application:didFailToContinueUserActivityWithType:error:))]
1302        #[unsafe(method_family = none)]
1303        unsafe fn application_didFailToContinueUserActivityWithType_error(
1304            &self,
1305            application: &NSApplication,
1306            user_activity_type: &NSString,
1307            error: &NSError,
1308        );
1309
1310        #[cfg(feature = "NSResponder")]
1311        /// 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
1312        /// `userActivity.`
1313        #[optional]
1314        #[unsafe(method(application:didUpdateUserActivity:))]
1315        #[unsafe(method_family = none)]
1316        unsafe fn application_didUpdateUserActivity(
1317            &self,
1318            application: &NSApplication,
1319            user_activity: &NSUserActivity,
1320        );
1321
1322        #[cfg(all(feature = "NSResponder", feature = "objc2-cloud-kit"))]
1323        #[cfg(target_vendor = "apple")]
1324        /// This will be called on the main thread after the user indicates they want to accept a CloudKit sharing invitation in your application.
1325        ///
1326        /// You should use the
1327        /// `CKShareMetadata`object's
1328        /// `shareURL`and containerIdentifier to schedule a
1329        /// `CKAcceptSharesOperation,`then start using the resulting
1330        /// `CKShare`and its associated record(s), which will appear in the
1331        /// `CKContainer's`shared database in a zone matching that of the record's owner.
1332        #[optional]
1333        #[unsafe(method(application:userDidAcceptCloudKitShareWithMetadata:))]
1334        #[unsafe(method_family = none)]
1335        unsafe fn application_userDidAcceptCloudKitShareWithMetadata(
1336            &self,
1337            application: &NSApplication,
1338            metadata: &CKShareMetadata,
1339        );
1340
1341        #[cfg(feature = "NSResponder")]
1342        /// 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
1343        /// `NO`otherwise.
1344        #[optional]
1345        #[unsafe(method(application:delegateHandlesKey:))]
1346        #[unsafe(method_family = none)]
1347        unsafe fn application_delegateHandlesKey(
1348            &self,
1349            sender: &NSApplication,
1350            key: &NSString,
1351        ) -> bool;
1352
1353        #[cfg(feature = "NSResponder")]
1354        /// This method will be called once during application launch at `-[NSApplication finishLaunching]`.
1355        ///
1356        ///
1357        /// Returns: `NO`if the receiving delegate object wishes to opt-out of system-wide keyboard shortcut localization for all application-supplied menus. Return
1358        /// `YES`by default for apps linked against 12.0 and later SDK.
1359        #[optional]
1360        #[unsafe(method(applicationShouldAutomaticallyLocalizeKeyEquivalents:))]
1361        #[unsafe(method_family = none)]
1362        unsafe fn applicationShouldAutomaticallyLocalizeKeyEquivalents(
1363            &self,
1364            application: &NSApplication,
1365        ) -> bool;
1366
1367        #[optional]
1368        #[unsafe(method(applicationWillFinishLaunching:))]
1369        #[unsafe(method_family = none)]
1370        unsafe fn applicationWillFinishLaunching(&self, notification: &NSNotification);
1371
1372        #[optional]
1373        #[unsafe(method(applicationDidFinishLaunching:))]
1374        #[unsafe(method_family = none)]
1375        unsafe fn applicationDidFinishLaunching(&self, notification: &NSNotification);
1376
1377        #[optional]
1378        #[unsafe(method(applicationWillHide:))]
1379        #[unsafe(method_family = none)]
1380        unsafe fn applicationWillHide(&self, notification: &NSNotification);
1381
1382        #[optional]
1383        #[unsafe(method(applicationDidHide:))]
1384        #[unsafe(method_family = none)]
1385        unsafe fn applicationDidHide(&self, notification: &NSNotification);
1386
1387        #[optional]
1388        #[unsafe(method(applicationWillUnhide:))]
1389        #[unsafe(method_family = none)]
1390        unsafe fn applicationWillUnhide(&self, notification: &NSNotification);
1391
1392        #[optional]
1393        #[unsafe(method(applicationDidUnhide:))]
1394        #[unsafe(method_family = none)]
1395        unsafe fn applicationDidUnhide(&self, notification: &NSNotification);
1396
1397        #[optional]
1398        #[unsafe(method(applicationWillBecomeActive:))]
1399        #[unsafe(method_family = none)]
1400        unsafe fn applicationWillBecomeActive(&self, notification: &NSNotification);
1401
1402        #[optional]
1403        #[unsafe(method(applicationDidBecomeActive:))]
1404        #[unsafe(method_family = none)]
1405        unsafe fn applicationDidBecomeActive(&self, notification: &NSNotification);
1406
1407        #[optional]
1408        #[unsafe(method(applicationWillResignActive:))]
1409        #[unsafe(method_family = none)]
1410        unsafe fn applicationWillResignActive(&self, notification: &NSNotification);
1411
1412        #[optional]
1413        #[unsafe(method(applicationDidResignActive:))]
1414        #[unsafe(method_family = none)]
1415        unsafe fn applicationDidResignActive(&self, notification: &NSNotification);
1416
1417        #[optional]
1418        #[unsafe(method(applicationWillUpdate:))]
1419        #[unsafe(method_family = none)]
1420        unsafe fn applicationWillUpdate(&self, notification: &NSNotification);
1421
1422        #[optional]
1423        #[unsafe(method(applicationDidUpdate:))]
1424        #[unsafe(method_family = none)]
1425        unsafe fn applicationDidUpdate(&self, notification: &NSNotification);
1426
1427        #[optional]
1428        #[unsafe(method(applicationWillTerminate:))]
1429        #[unsafe(method_family = none)]
1430        unsafe fn applicationWillTerminate(&self, notification: &NSNotification);
1431
1432        #[optional]
1433        #[unsafe(method(applicationDidChangeScreenParameters:))]
1434        #[unsafe(method_family = none)]
1435        unsafe fn applicationDidChangeScreenParameters(&self, notification: &NSNotification);
1436
1437        #[optional]
1438        #[unsafe(method(applicationDidChangeOcclusionState:))]
1439        #[unsafe(method_family = none)]
1440        unsafe fn applicationDidChangeOcclusionState(&self, notification: &NSNotification);
1441
1442        #[optional]
1443        #[unsafe(method(applicationProtectedDataWillBecomeUnavailable:))]
1444        #[unsafe(method_family = none)]
1445        unsafe fn applicationProtectedDataWillBecomeUnavailable(
1446            &self,
1447            notification: &NSNotification,
1448        );
1449
1450        #[optional]
1451        #[unsafe(method(applicationProtectedDataDidBecomeAvailable:))]
1452        #[unsafe(method_family = none)]
1453        unsafe fn applicationProtectedDataDidBecomeAvailable(&self, notification: &NSNotification);
1454    }
1455);
1456
1457/// NSServicesMenu.
1458#[cfg(feature = "NSResponder")]
1459impl NSApplication {
1460    extern_methods!(
1461        #[cfg(feature = "NSMenu")]
1462        #[unsafe(method(servicesMenu))]
1463        #[unsafe(method_family = none)]
1464        pub unsafe fn servicesMenu(&self) -> Option<Retained<NSMenu>>;
1465
1466        #[cfg(feature = "NSMenu")]
1467        /// Setter for [`servicesMenu`][Self::servicesMenu].
1468        #[unsafe(method(setServicesMenu:))]
1469        #[unsafe(method_family = none)]
1470        pub unsafe fn setServicesMenu(&self, services_menu: Option<&NSMenu>);
1471
1472        #[cfg(feature = "NSPasteboard")]
1473        #[unsafe(method(registerServicesMenuSendTypes:returnTypes:))]
1474        #[unsafe(method_family = none)]
1475        pub unsafe fn registerServicesMenuSendTypes_returnTypes(
1476            &self,
1477            send_types: &NSArray<NSPasteboardType>,
1478            return_types: &NSArray<NSPasteboardType>,
1479        );
1480    );
1481}
1482
1483extern_protocol!(
1484    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsservicesmenurequestor?language=objc)
1485    pub unsafe trait NSServicesMenuRequestor: NSObjectProtocol {
1486        #[cfg(feature = "NSPasteboard")]
1487        #[optional]
1488        #[unsafe(method(writeSelectionToPasteboard:types:))]
1489        #[unsafe(method_family = none)]
1490        unsafe fn writeSelectionToPasteboard_types(
1491            &self,
1492            pboard: &NSPasteboard,
1493            types: &NSArray<NSPasteboardType>,
1494        ) -> bool;
1495
1496        #[cfg(feature = "NSPasteboard")]
1497        #[optional]
1498        #[unsafe(method(readSelectionFromPasteboard:))]
1499        #[unsafe(method_family = none)]
1500        unsafe fn readSelectionFromPasteboard(&self, pboard: &NSPasteboard) -> bool;
1501    }
1502);
1503
1504/// NSServicesHandling.
1505#[cfg(feature = "NSResponder")]
1506impl NSApplication {
1507    extern_methods!(
1508        #[unsafe(method(servicesProvider))]
1509        #[unsafe(method_family = none)]
1510        pub unsafe fn servicesProvider(&self) -> Option<Retained<AnyObject>>;
1511
1512        /// Setter for [`servicesProvider`][Self::servicesProvider].
1513        #[unsafe(method(setServicesProvider:))]
1514        #[unsafe(method_family = none)]
1515        pub unsafe fn setServicesProvider(&self, services_provider: Option<&AnyObject>);
1516    );
1517}
1518
1519/// Optional keys in `-orderFrontStandardAboutPanelWithOptions:`
1520/// `optionsDictionary.`
1521///
1522/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionkey?language=objc)
1523// NS_TYPED_ENUM
1524pub type NSAboutPanelOptionKey = NSString;
1525
1526extern "C" {
1527    /// 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.
1528    ///
1529    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc)
1530    pub static NSAboutPanelOptionCredits: &'static NSAboutPanelOptionKey;
1531}
1532
1533extern "C" {
1534    /// NSString displayed in place of the default app name. If not specified, uses the value of CFBundleName (localizable). Fallback is [[NSProcessInfo processInfo] processName].
1535    ///
1536    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionapplicationname?language=objc)
1537    pub static NSAboutPanelOptionApplicationName: &'static NSAboutPanelOptionKey;
1538}
1539
1540extern "C" {
1541    /// NSImage displayed in place of NSApplicationIcon. If not specified, use [NSImage imageNamed:
1542    /// "
1543    /// NSApplicationIcon"]; if not available, generic icon.
1544    ///
1545    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionapplicationicon?language=objc)
1546    pub static NSAboutPanelOptionApplicationIcon: &'static NSAboutPanelOptionKey;
1547}
1548
1549extern "C" {
1550    /// 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.
1551    ///
1552    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionversion?language=objc)
1553    pub static NSAboutPanelOptionVersion: &'static NSAboutPanelOptionKey;
1554}
1555
1556extern "C" {
1557    /// 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.
1558    ///
1559    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptionapplicationversion?language=objc)
1560    pub static NSAboutPanelOptionApplicationVersion: &'static NSAboutPanelOptionKey;
1561}
1562
1563/// NSStandardAboutPanel.
1564#[cfg(feature = "NSResponder")]
1565impl NSApplication {
1566    extern_methods!(
1567        #[unsafe(method(orderFrontStandardAboutPanel:))]
1568        #[unsafe(method_family = none)]
1569        pub unsafe fn orderFrontStandardAboutPanel(&self, sender: Option<&AnyObject>);
1570
1571        #[unsafe(method(orderFrontStandardAboutPanelWithOptions:))]
1572        #[unsafe(method_family = none)]
1573        pub unsafe fn orderFrontStandardAboutPanelWithOptions(
1574            &self,
1575            options_dictionary: &NSDictionary<NSAboutPanelOptionKey, AnyObject>,
1576        );
1577    );
1578}
1579
1580/// NSApplicationLayoutDirection.
1581#[cfg(feature = "NSResponder")]
1582impl NSApplication {
1583    extern_methods!(
1584        #[cfg(feature = "NSUserInterfaceLayout")]
1585        #[unsafe(method(userInterfaceLayoutDirection))]
1586        #[unsafe(method_family = none)]
1587        pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
1588    );
1589}
1590
1591/// NSRestorableUserInterface.
1592#[cfg(feature = "NSResponder")]
1593impl NSApplication {
1594    extern_methods!(
1595        /// 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.
1596        ///
1597        /// 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.
1598        ///
1599        /// 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.
1600        ///
1601        /// These methods are thread safe.
1602        #[unsafe(method(disableRelaunchOnLogin))]
1603        #[unsafe(method_family = none)]
1604        pub unsafe fn disableRelaunchOnLogin(&self);
1605
1606        #[unsafe(method(enableRelaunchOnLogin))]
1607        #[unsafe(method_family = none)]
1608        pub unsafe fn enableRelaunchOnLogin(&self);
1609    );
1610}
1611
1612/// Soft deprecated.
1613/// Please use `NSApplication`'s `-registerForRemoteNotifications` along with `-requestAuthorizationWithOptions:` from the `UserNotifications.framework` to specify allowable notification types.
1614///
1615/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsremotenotificationtype?language=objc)
1616// NS_OPTIONS
1617#[repr(transparent)]
1618#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1619pub struct NSRemoteNotificationType(pub NSUInteger);
1620bitflags::bitflags! {
1621    impl NSRemoteNotificationType: NSUInteger {
1622        #[doc(alias = "NSRemoteNotificationTypeNone")]
1623        const None = 0;
1624        #[doc(alias = "NSRemoteNotificationTypeBadge")]
1625        const Badge = 1<<0;
1626        #[doc(alias = "NSRemoteNotificationTypeSound")]
1627        const Sound = 1<<1;
1628        #[doc(alias = "NSRemoteNotificationTypeAlert")]
1629        const Alert = 1<<2;
1630    }
1631}
1632
1633unsafe impl Encode for NSRemoteNotificationType {
1634    const ENCODING: Encoding = NSUInteger::ENCODING;
1635}
1636
1637unsafe impl RefEncode for NSRemoteNotificationType {
1638    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1639}
1640
1641/// NSRemoteNotifications.
1642#[cfg(feature = "NSResponder")]
1643impl NSApplication {
1644    extern_methods!(
1645        #[unsafe(method(registerForRemoteNotifications))]
1646        #[unsafe(method_family = none)]
1647        pub unsafe fn registerForRemoteNotifications(&self);
1648
1649        #[unsafe(method(unregisterForRemoteNotifications))]
1650        #[unsafe(method_family = none)]
1651        pub unsafe fn unregisterForRemoteNotifications(&self);
1652
1653        /// Returns: `YES`if the application is currently registered for remote notifications, taking into account any systemwide settings; doesn't relate to connectivity.
1654        #[unsafe(method(isRegisteredForRemoteNotifications))]
1655        #[unsafe(method_family = none)]
1656        pub unsafe fn isRegisteredForRemoteNotifications(&self) -> bool;
1657
1658        /// The following are soft deprecated.
1659        /// Please use the `-registerForRemoteNotifications` above and `-requestAuthorizationWithOptions:` from `UserNotifications.framework`.
1660        #[unsafe(method(registerForRemoteNotificationTypes:))]
1661        #[unsafe(method_family = none)]
1662        pub unsafe fn registerForRemoteNotificationTypes(&self, types: NSRemoteNotificationType);
1663
1664        #[unsafe(method(enabledRemoteNotificationTypes))]
1665        #[unsafe(method_family = none)]
1666        pub unsafe fn enabledRemoteNotificationTypes(&self) -> NSRemoteNotificationType;
1667    );
1668}
1669
1670extern "C-unwind" {
1671    /// An Application's startup function.
1672    pub fn NSApplicationMain(argc: c_int, argv: NonNull<NonNull<c_char>>) -> c_int;
1673}
1674
1675/// `NSApplicationLoad`should be called when loading a Cocoa bundle in a Carbon app in order to initialize
1676/// `NSApplication`and other Cocoa objects.  Redundant calls are ignored.
1677#[inline]
1678pub unsafe extern "C-unwind" fn NSApplicationLoad() -> bool {
1679    extern "C-unwind" {
1680        fn NSApplicationLoad() -> Bool;
1681    }
1682    unsafe { NSApplicationLoad() }.as_bool()
1683}
1684
1685/// `NSShowsServicesMenuItem()`always returns
1686/// `YES.`
1687#[inline]
1688pub unsafe extern "C-unwind" fn NSShowsServicesMenuItem(item_name: &NSString) -> bool {
1689    extern "C-unwind" {
1690        fn NSShowsServicesMenuItem(item_name: &NSString) -> Bool;
1691    }
1692    unsafe { NSShowsServicesMenuItem(item_name) }.as_bool()
1693}
1694
1695/// `NSSetShowsServicesMenuItem()`has no effect, and always returns 0.
1696#[inline]
1697pub unsafe extern "C-unwind" fn NSSetShowsServicesMenuItem(
1698    item_name: &NSString,
1699    enabled: bool,
1700) -> NSInteger {
1701    extern "C-unwind" {
1702        fn NSSetShowsServicesMenuItem(item_name: &NSString, enabled: Bool) -> NSInteger;
1703    }
1704    unsafe { NSSetShowsServicesMenuItem(item_name, Bool::new(enabled)) }
1705}
1706
1707extern "C-unwind" {
1708    /// `NSUpdateDynamicServices()`causes the services information for the system to be updated.
1709    /// 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).
1710    pub fn NSUpdateDynamicServices();
1711}
1712
1713#[cfg(feature = "NSPasteboard")]
1714#[inline]
1715pub unsafe extern "C-unwind" fn NSPerformService(
1716    item_name: &NSString,
1717    pboard: Option<&NSPasteboard>,
1718) -> bool {
1719    extern "C-unwind" {
1720        fn NSPerformService(item_name: &NSString, pboard: Option<&NSPasteboard>) -> Bool;
1721    }
1722    unsafe { NSPerformService(item_name, pboard) }.as_bool()
1723}
1724
1725/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsserviceprovidername?language=objc)
1726pub type NSServiceProviderName = NSString;
1727
1728extern "C-unwind" {
1729    /// Apps should use -setServicesProvider.
1730    pub fn NSRegisterServicesProvider(provider: Option<&AnyObject>, name: &NSServiceProviderName);
1731}
1732
1733extern "C-unwind" {
1734    pub fn NSUnregisterServicesProvider(name: &NSServiceProviderName);
1735}
1736
1737extern "C" {
1738    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidbecomeactivenotification?language=objc)
1739    pub static NSApplicationDidBecomeActiveNotification: &'static NSNotificationName;
1740}
1741
1742extern "C" {
1743    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidhidenotification?language=objc)
1744    pub static NSApplicationDidHideNotification: &'static NSNotificationName;
1745}
1746
1747extern "C" {
1748    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidfinishlaunchingnotification?language=objc)
1749    pub static NSApplicationDidFinishLaunchingNotification: &'static NSNotificationName;
1750}
1751
1752extern "C" {
1753    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidresignactivenotification?language=objc)
1754    pub static NSApplicationDidResignActiveNotification: &'static NSNotificationName;
1755}
1756
1757extern "C" {
1758    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidunhidenotification?language=objc)
1759    pub static NSApplicationDidUnhideNotification: &'static NSNotificationName;
1760}
1761
1762extern "C" {
1763    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidupdatenotification?language=objc)
1764    pub static NSApplicationDidUpdateNotification: &'static NSNotificationName;
1765}
1766
1767extern "C" {
1768    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillbecomeactivenotification?language=objc)
1769    pub static NSApplicationWillBecomeActiveNotification: &'static NSNotificationName;
1770}
1771
1772extern "C" {
1773    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillhidenotification?language=objc)
1774    pub static NSApplicationWillHideNotification: &'static NSNotificationName;
1775}
1776
1777extern "C" {
1778    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillfinishlaunchingnotification?language=objc)
1779    pub static NSApplicationWillFinishLaunchingNotification: &'static NSNotificationName;
1780}
1781
1782extern "C" {
1783    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillresignactivenotification?language=objc)
1784    pub static NSApplicationWillResignActiveNotification: &'static NSNotificationName;
1785}
1786
1787extern "C" {
1788    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillunhidenotification?language=objc)
1789    pub static NSApplicationWillUnhideNotification: &'static NSNotificationName;
1790}
1791
1792extern "C" {
1793    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillupdatenotification?language=objc)
1794    pub static NSApplicationWillUpdateNotification: &'static NSNotificationName;
1795}
1796
1797extern "C" {
1798    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationwillterminatenotification?language=objc)
1799    pub static NSApplicationWillTerminateNotification: &'static NSNotificationName;
1800}
1801
1802extern "C" {
1803    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidchangescreenparametersnotification?language=objc)
1804    pub static NSApplicationDidChangeScreenParametersNotification: &'static NSNotificationName;
1805}
1806
1807extern "C" {
1808    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationprotecteddatawillbecomeunavailablenotification?language=objc)
1809    pub static NSApplicationProtectedDataWillBecomeUnavailableNotification:
1810        &'static NSNotificationName;
1811}
1812
1813extern "C" {
1814    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationprotecteddatadidbecomeavailablenotification?language=objc)
1815    pub static NSApplicationProtectedDataDidBecomeAvailableNotification:
1816        &'static NSNotificationName;
1817}
1818
1819extern "C" {
1820    /// 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.
1821    ///
1822    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationlaunchisdefaultlaunchkey?language=objc)
1823    pub static NSApplicationLaunchIsDefaultLaunchKey: &'static NSString;
1824}
1825
1826extern "C" {
1827    /// 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.
1828    ///
1829    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationlaunchusernotificationkey?language=objc)
1830    pub static NSApplicationLaunchUserNotificationKey: &'static NSString;
1831}
1832
1833extern "C" {
1834    /// 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
1835    ///
1836    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationlaunchremotenotificationkey?language=objc)
1837    pub static NSApplicationLaunchRemoteNotificationKey: &'static NSString;
1838}
1839
1840extern "C" {
1841    /// 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.
1842    ///
1843    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationdidchangeocclusionstatenotification?language=objc)
1844    pub static NSApplicationDidChangeOcclusionStateNotification: &'static NSNotificationName;
1845}
1846
1847/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrunstoppedresponse?language=objc)
1848#[deprecated = "Use NSModalResponseStop instead"]
1849pub const NSRunStoppedResponse: c_int = -1000;
1850/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrunabortedresponse?language=objc)
1851#[deprecated = "Use NSModalResponseAbort instead"]
1852pub const NSRunAbortedResponse: c_int = -1001;
1853/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsruncontinuesresponse?language=objc)
1854#[deprecated = "Use NSModalResponseContinue instead"]
1855pub const NSRunContinuesResponse: c_int = -1002;
1856
1857/// NSDeprecated.
1858#[cfg(feature = "NSResponder")]
1859impl NSApplication {
1860    extern_methods!(
1861        #[cfg(feature = "NSWindow")]
1862        /// `-runModalForWindow:relativeToWindow:` was deprecated in Mac OS X 10.0. Please use `-[NSWindow beginSheet:completionHandler:]` instead.
1863        #[deprecated = "Use -[NSWindow beginSheet:completionHandler:] instead"]
1864        #[unsafe(method(runModalForWindow:relativeToWindow:))]
1865        #[unsafe(method_family = none)]
1866        pub unsafe fn runModalForWindow_relativeToWindow(
1867            &self,
1868            window: Option<&NSWindow>,
1869            doc_window: Option<&NSWindow>,
1870        ) -> NSInteger;
1871
1872        #[cfg(feature = "NSWindow")]
1873        /// `-beginModalSessionForWindow:relativeToWindow:` was deprecated in Mac OS X 10.0. Please use `-[NSWindow beginSheet:completionHandler:]` instead.
1874        #[deprecated = "Use -[NSWindow beginSheet:completionHandler:] instead"]
1875        #[unsafe(method(beginModalSessionForWindow:relativeToWindow:))]
1876        #[unsafe(method_family = none)]
1877        pub unsafe fn beginModalSessionForWindow_relativeToWindow(
1878            &self,
1879            window: Option<&NSWindow>,
1880            doc_window: Option<&NSWindow>,
1881        ) -> NSModalSession;
1882
1883        /// `-application:printFiles:` was deprecated in Mac OS X 10.4.
1884        /// Implement `-application:printFiles:withSettings:showPrintPanels:` in your application delegate instead.
1885        #[deprecated]
1886        #[unsafe(method(application:printFiles:))]
1887        #[unsafe(method_family = none)]
1888        pub unsafe fn application_printFiles(
1889            &self,
1890            sender: Option<&NSApplication>,
1891            filenames: Option<&NSArray<NSString>>,
1892        );
1893
1894        #[cfg(feature = "NSWindow")]
1895        /// `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.
1896        #[deprecated = "Use -[NSWindow beginSheet:completionHandler:] instead"]
1897        #[unsafe(method(beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:))]
1898        #[unsafe(method_family = none)]
1899        pub unsafe fn beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo(
1900            &self,
1901            sheet: &NSWindow,
1902            doc_window: &NSWindow,
1903            modal_delegate: Option<&AnyObject>,
1904            did_end_selector: Option<Sel>,
1905            context_info: *mut c_void,
1906        );
1907
1908        #[cfg(feature = "NSWindow")]
1909        #[deprecated = "Use -[NSWindow endSheet:] instead"]
1910        #[unsafe(method(endSheet:))]
1911        #[unsafe(method_family = none)]
1912        pub unsafe fn endSheet(&self, sheet: &NSWindow);
1913
1914        #[cfg(feature = "NSWindow")]
1915        #[deprecated = "Use -[NSWindow endSheet:returnCode:] instead"]
1916        #[unsafe(method(endSheet:returnCode:))]
1917        #[unsafe(method_family = none)]
1918        pub unsafe fn endSheet_returnCode(&self, sheet: &NSWindow, return_code: NSInteger);
1919
1920        #[cfg(feature = "NSWindow")]
1921        #[deprecated = "Use -enumerateWindowsWithOptions:usingBlock: instead"]
1922        #[unsafe(method(makeWindowsPerform:inOrder:))]
1923        #[unsafe(method_family = none)]
1924        pub unsafe fn makeWindowsPerform_inOrder(
1925            &self,
1926            selector: Sel,
1927            in_order: bool,
1928        ) -> Option<Retained<NSWindow>>;
1929
1930        #[cfg(feature = "NSGraphicsContext")]
1931        /// 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.
1932        #[deprecated = "This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation."]
1933        #[unsafe(method(context))]
1934        #[unsafe(method_family = none)]
1935        pub unsafe fn context(&self) -> Option<Retained<NSGraphicsContext>>;
1936    );
1937}