objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbuttontype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSButtonType(pub NSUInteger);
impl NSButtonType {
    #[doc(alias = "NSButtonTypeMomentaryLight")]
    pub const MomentaryLight: Self = Self(0);
    #[doc(alias = "NSButtonTypePushOnPushOff")]
    pub const PushOnPushOff: Self = Self(1);
    #[doc(alias = "NSButtonTypeToggle")]
    pub const Toggle: Self = Self(2);
    #[doc(alias = "NSButtonTypeSwitch")]
    pub const Switch: Self = Self(3);
    #[doc(alias = "NSButtonTypeRadio")]
    pub const Radio: Self = Self(4);
    #[doc(alias = "NSButtonTypeMomentaryChange")]
    pub const MomentaryChange: Self = Self(5);
    #[doc(alias = "NSButtonTypeOnOff")]
    pub const OnOff: Self = Self(6);
    #[doc(alias = "NSButtonTypeMomentaryPushIn")]
    pub const MomentaryPushIn: Self = Self(7);
    #[doc(alias = "NSButtonTypeAccelerator")]
    pub const Accelerator: Self = Self(8);
    #[doc(alias = "NSButtonTypeMultiLevelAccelerator")]
    pub const MultiLevelAccelerator: Self = Self(9);
}

unsafe impl Encode for NSButtonType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbezelstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSBezelStyle(pub NSUInteger);
impl NSBezelStyle {
    /// The appearance of this bezel style is automatically determined based on the button's contents and position within the window. This bezel style is the default for all button initializers.
    #[doc(alias = "NSBezelStyleAutomatic")]
    pub const Automatic: Self = Self(0);
    /// The standard system push button style.
    #[doc(alias = "NSBezelStylePush")]
    pub const Push: Self = Self(1);
    /// A flexible-height variant of NSBezelStylePush.
    #[doc(alias = "NSBezelStyleFlexiblePush")]
    pub const FlexiblePush: Self = Self(2);
    /// An unbezeled button with a disclosure triangle.
    #[doc(alias = "NSBezelStyleDisclosure")]
    pub const Disclosure: Self = Self(5);
    /// A button with a circular bezel suitable for a small icon or single character.
    #[doc(alias = "NSBezelStyleCircular")]
    pub const Circular: Self = Self(7);
    /// A circular button with a question mark providing the standard Help button appearance.
    #[doc(alias = "NSBezelStyleHelpButton")]
    pub const HelpButton: Self = Self(9);
    /// A button with squared edges and flexible height.
    #[doc(alias = "NSBezelStyleSmallSquare")]
    pub const SmallSquare: Self = Self(10);
    /// A button style that is appropriate for use in a toolbar item.
    #[doc(alias = "NSBezelStyleToolbar")]
    pub const Toolbar: Self = Self(11);
    /// A bezel style that is suitable for accessory and scope bars. This style is typically used for buttons that perform an action or for pop-up buttons.
    #[doc(alias = "NSBezelStyleAccessoryBarAction")]
    pub const AccessoryBarAction: Self = Self(12);
    /// A bezel style that is suitable for accessory and scope bars. This style is typically used for buttons with togglable state.
    #[doc(alias = "NSBezelStyleAccessoryBar")]
    pub const AccessoryBar: Self = Self(13);
    /// A bezeled variant of NSBezelStyleDisclosure.
    #[doc(alias = "NSBezelStylePushDisclosure")]
    pub const PushDisclosure: Self = Self(14);
    /// A bezel style that is typically used in table rows to display information about the row, such as a count.
    #[doc(alias = "NSBezelStyleBadge")]
    pub const Badge: Self = Self(15);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleGlass")]
    pub const Glass: Self = Self(16);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleShadowlessSquare")]
    #[deprecated]
    pub const ShadowlessSquare: Self = Self(6);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleTexturedSquare")]
    #[deprecated]
    pub const TexturedSquare: Self = Self(8);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleRounded")]
    #[deprecated]
    pub const Rounded: Self = Self(NSBezelStyle::Push.0);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleRegularSquare")]
    #[deprecated]
    pub const RegularSquare: Self = Self(NSBezelStyle::FlexiblePush.0);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleTexturedRounded")]
    #[deprecated]
    pub const TexturedRounded: Self = Self(NSBezelStyle::Toolbar.0);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleRoundRect")]
    #[deprecated]
    pub const RoundRect: Self = Self(NSBezelStyle::AccessoryBarAction.0);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleRecessed")]
    #[deprecated]
    pub const Recessed: Self = Self(NSBezelStyle::AccessoryBar.0);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleRoundedDisclosure")]
    #[deprecated]
    pub const RoundedDisclosure: Self = Self(NSBezelStyle::PushDisclosure.0);
    /// A bezel style with a glass effect
    #[doc(alias = "NSBezelStyleInline")]
    #[deprecated]
    pub const Inline: Self = Self(NSBezelStyle::Badge.0);
}

unsafe impl Encode for NSBezelStyle {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

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

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbuttoncell?language=objc)
    #[unsafe(super(NSActionCell, NSCell, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
    pub struct NSButtonCell;
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSActionCell",
    feature = "NSCell"
))]
extern_conformance!(
    unsafe impl NSAccessibility for NSButtonCell {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSActionCell",
    feature = "NSCell"
))]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for NSButtonCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
extern_conformance!(
    unsafe impl NSCoding for NSButtonCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
extern_conformance!(
    unsafe impl NSCopying for NSButtonCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
unsafe impl CopyingHelper for NSButtonCell {
    type Result = Self;
}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSButtonCell {}
);

#[cfg(all(
    feature = "NSActionCell",
    feature = "NSCell",
    feature = "NSUserInterfaceItemIdentification"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for NSButtonCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSButtonCell {
    extern_methods!(
        #[unsafe(method(initTextCell:))]
        #[unsafe(method_family = init)]
        pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(initImageCell:))]
        #[unsafe(method_family = init)]
        pub fn initImageCell(this: Allocated<Self>, image: Option<&NSImage>) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;

        #[unsafe(method(bezelStyle))]
        #[unsafe(method_family = none)]
        pub fn bezelStyle(&self) -> NSBezelStyle;

        /// Setter for [`bezelStyle`][Self::bezelStyle].
        #[unsafe(method(setBezelStyle:))]
        #[unsafe(method_family = none)]
        pub fn setBezelStyle(&self, bezel_style: NSBezelStyle);

        #[unsafe(method(setButtonType:))]
        #[unsafe(method_family = none)]
        pub fn setButtonType(&self, r#type: NSButtonType);

        #[unsafe(method(highlightsBy))]
        #[unsafe(method_family = none)]
        pub fn highlightsBy(&self) -> NSCellStyleMask;

        /// Setter for [`highlightsBy`][Self::highlightsBy].
        #[unsafe(method(setHighlightsBy:))]
        #[unsafe(method_family = none)]
        pub fn setHighlightsBy(&self, highlights_by: NSCellStyleMask);

        #[unsafe(method(showsStateBy))]
        #[unsafe(method_family = none)]
        pub fn showsStateBy(&self) -> NSCellStyleMask;

        /// Setter for [`showsStateBy`][Self::showsStateBy].
        #[unsafe(method(setShowsStateBy:))]
        #[unsafe(method_family = none)]
        pub fn setShowsStateBy(&self, shows_state_by: NSCellStyleMask);

        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub fn title(&self) -> Retained<NSString>;

        /// Setter for [`title`][Self::title].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        pub fn setTitle(&self, title: Option<&NSString>);

        #[unsafe(method(attributedTitle))]
        #[unsafe(method_family = none)]
        pub fn attributedTitle(&self) -> Retained<NSAttributedString>;

        /// Setter for [`attributedTitle`][Self::attributedTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedTitle:))]
        #[unsafe(method_family = none)]
        pub fn setAttributedTitle(&self, attributed_title: &NSAttributedString);

        #[unsafe(method(alternateTitle))]
        #[unsafe(method_family = none)]
        pub fn alternateTitle(&self) -> Retained<NSString>;

        /// Setter for [`alternateTitle`][Self::alternateTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAlternateTitle:))]
        #[unsafe(method_family = none)]
        pub fn setAlternateTitle(&self, alternate_title: &NSString);

        #[unsafe(method(attributedAlternateTitle))]
        #[unsafe(method_family = none)]
        pub fn attributedAlternateTitle(&self) -> Retained<NSAttributedString>;

        /// Setter for [`attributedAlternateTitle`][Self::attributedAlternateTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedAlternateTitle:))]
        #[unsafe(method_family = none)]
        pub fn setAttributedAlternateTitle(&self, attributed_alternate_title: &NSAttributedString);

        #[cfg(feature = "NSImage")]
        #[unsafe(method(alternateImage))]
        #[unsafe(method_family = none)]
        pub fn alternateImage(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        /// Setter for [`alternateImage`][Self::alternateImage].
        #[unsafe(method(setAlternateImage:))]
        #[unsafe(method_family = none)]
        pub fn setAlternateImage(&self, alternate_image: Option<&NSImage>);

        #[unsafe(method(imagePosition))]
        #[unsafe(method_family = none)]
        pub fn imagePosition(&self) -> NSCellImagePosition;

        /// Setter for [`imagePosition`][Self::imagePosition].
        #[unsafe(method(setImagePosition:))]
        #[unsafe(method_family = none)]
        pub fn setImagePosition(&self, image_position: NSCellImagePosition);

        #[unsafe(method(imageScaling))]
        #[unsafe(method_family = none)]
        pub fn imageScaling(&self) -> NSImageScaling;

        /// Setter for [`imageScaling`][Self::imageScaling].
        #[unsafe(method(setImageScaling:))]
        #[unsafe(method_family = none)]
        pub fn setImageScaling(&self, image_scaling: NSImageScaling);

        #[unsafe(method(keyEquivalent))]
        #[unsafe(method_family = none)]
        pub fn keyEquivalent(&self) -> Retained<NSString>;

        /// Setter for [`keyEquivalent`][Self::keyEquivalent].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setKeyEquivalent:))]
        #[unsafe(method_family = none)]
        pub fn setKeyEquivalent(&self, key_equivalent: &NSString);

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(keyEquivalentModifierMask))]
        #[unsafe(method_family = none)]
        pub fn keyEquivalentModifierMask(&self) -> NSEventModifierFlags;

        #[cfg(feature = "NSEvent")]
        /// Setter for [`keyEquivalentModifierMask`][Self::keyEquivalentModifierMask].
        #[unsafe(method(setKeyEquivalentModifierMask:))]
        #[unsafe(method_family = none)]
        pub fn setKeyEquivalentModifierMask(
            &self,
            key_equivalent_modifier_mask: NSEventModifierFlags,
        );

        #[unsafe(method(isTransparent))]
        #[unsafe(method_family = none)]
        pub fn isTransparent(&self) -> bool;

        /// Setter for [`isTransparent`][Self::isTransparent].
        #[unsafe(method(setTransparent:))]
        #[unsafe(method_family = none)]
        pub fn setTransparent(&self, transparent: bool);

        #[unsafe(method(isOpaque))]
        #[unsafe(method_family = none)]
        pub fn isOpaque(&self) -> bool;

        #[unsafe(method(imageDimsWhenDisabled))]
        #[unsafe(method_family = none)]
        pub fn imageDimsWhenDisabled(&self) -> bool;

        /// Setter for [`imageDimsWhenDisabled`][Self::imageDimsWhenDisabled].
        #[unsafe(method(setImageDimsWhenDisabled:))]
        #[unsafe(method_family = none)]
        pub fn setImageDimsWhenDisabled(&self, image_dims_when_disabled: bool);

        #[unsafe(method(showsBorderOnlyWhileMouseInside))]
        #[unsafe(method_family = none)]
        pub fn showsBorderOnlyWhileMouseInside(&self) -> bool;

        /// Setter for [`showsBorderOnlyWhileMouseInside`][Self::showsBorderOnlyWhileMouseInside].
        #[unsafe(method(setShowsBorderOnlyWhileMouseInside:))]
        #[unsafe(method_family = none)]
        pub fn setShowsBorderOnlyWhileMouseInside(
            &self,
            shows_border_only_while_mouse_inside: bool,
        );

        #[cfg(feature = "NSSound")]
        #[unsafe(method(sound))]
        #[unsafe(method_family = none)]
        pub fn sound(&self) -> Option<Retained<NSSound>>;

        #[cfg(feature = "NSSound")]
        /// Setter for [`sound`][Self::sound].
        #[unsafe(method(setSound:))]
        #[unsafe(method_family = none)]
        pub fn setSound(&self, sound: Option<&NSSound>);

        #[cfg(feature = "NSColor")]
        #[unsafe(method(backgroundColor))]
        #[unsafe(method_family = none)]
        pub fn backgroundColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColor")]
        /// Setter for [`backgroundColor`][Self::backgroundColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);

        #[unsafe(method(setPeriodicDelay:interval:))]
        #[unsafe(method_family = none)]
        pub fn setPeriodicDelay_interval(&self, delay: c_float, interval: c_float);

        /// # Safety
        ///
        /// - `delay` must be a valid pointer.
        /// - `interval` must be a valid pointer.
        #[unsafe(method(getPeriodicDelay:interval:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getPeriodicDelay_interval(
            &self,
            delay: NonNull<c_float>,
            interval: NonNull<c_float>,
        );

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[unsafe(method(performClick:))]
        #[unsafe(method_family = none)]
        pub unsafe fn performClick(&self, sender: Option<&AnyObject>);

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(mouseEntered:))]
        #[unsafe(method_family = none)]
        pub fn mouseEntered(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(mouseExited:))]
        #[unsafe(method_family = none)]
        pub fn mouseExited(&self, event: &NSEvent);

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(drawBezelWithFrame:inView:))]
        #[unsafe(method_family = none)]
        pub fn drawBezelWithFrame_inView(&self, frame: NSRect, control_view: &NSView);

        #[cfg(all(feature = "NSImage", feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(drawImage:withFrame:inView:))]
        #[unsafe(method_family = none)]
        pub fn drawImage_withFrame_inView(
            &self,
            image: &NSImage,
            frame: NSRect,
            control_view: &NSView,
        );

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(drawTitle:withFrame:inView:))]
        #[unsafe(method_family = none)]
        pub fn drawTitle_withFrame_inView(
            &self,
            title: &NSAttributedString,
            frame: NSRect,
            control_view: &NSView,
        ) -> NSRect;
    );
}

/// Methods declared on superclass `NSCell`.
#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSButtonCell {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSButtonCell {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsgradienttype?language=objc)
// NS_ENUM
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGradientType(pub NSUInteger);
impl NSGradientType {
    #[doc(alias = "NSGradientNone")]
    #[deprecated]
    pub const None: Self = Self(0);
    #[doc(alias = "NSGradientConcaveWeak")]
    #[deprecated]
    pub const ConcaveWeak: Self = Self(1);
    #[doc(alias = "NSGradientConcaveStrong")]
    #[deprecated]
    pub const ConcaveStrong: Self = Self(2);
    #[doc(alias = "NSGradientConvexWeak")]
    #[deprecated]
    pub const ConvexWeak: Self = Self(3);
    #[doc(alias = "NSGradientConvexStrong")]
    #[deprecated]
    pub const ConvexStrong: Self = Self(4);
}

unsafe impl Encode for NSGradientType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarylightbutton?language=objc)
#[deprecated]
pub static NSMomentaryLightButton: NSButtonType = NSButtonType(NSButtonType::MomentaryLight.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspushonpushoffbutton?language=objc)
#[deprecated]
pub static NSPushOnPushOffButton: NSButtonType = NSButtonType(NSButtonType::PushOnPushOff.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstogglebutton?language=objc)
#[deprecated]
pub static NSToggleButton: NSButtonType = NSButtonType(NSButtonType::Toggle.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsswitchbutton?language=objc)
#[deprecated]
pub static NSSwitchButton: NSButtonType = NSButtonType(NSButtonType::Switch.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsradiobutton?language=objc)
#[deprecated]
pub static NSRadioButton: NSButtonType = NSButtonType(NSButtonType::Radio.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarychangebutton?language=objc)
#[deprecated]
pub static NSMomentaryChangeButton: NSButtonType = NSButtonType(NSButtonType::MomentaryChange.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsonoffbutton?language=objc)
#[deprecated]
pub static NSOnOffButton: NSButtonType = NSButtonType(NSButtonType::OnOff.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarypushinbutton?language=objc)
#[deprecated]
pub static NSMomentaryPushInButton: NSButtonType = NSButtonType(NSButtonType::MomentaryPushIn.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsacceleratorbutton?language=objc)
#[deprecated]
pub static NSAcceleratorButton: NSButtonType = NSButtonType(NSButtonType::Accelerator.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmultilevelacceleratorbutton?language=objc)
#[deprecated]
pub static NSMultiLevelAcceleratorButton: NSButtonType =
    NSButtonType(NSButtonType::MultiLevelAccelerator.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarypushbutton?language=objc)
#[deprecated = "This constant is misnamed and has the same effect as NSButtonTypeMomentaryLight. Use that name instead, or switch to NSButtonTypeMomentaryPushIn."]
pub static NSMomentaryPushButton: NSButtonType = NSButtonType(NSButtonType::MomentaryLight.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarylight?language=objc)
#[deprecated = "This constant is misnamed and has the same effect as NSButtonTypeMomentaryPushIn. Use that name instead, or switch to NSButtonTypeMomentaryLight."]
pub static NSMomentaryLight: NSButtonType = NSButtonType(NSButtonType::MomentaryPushIn.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundedbezelstyle?language=objc)
#[deprecated]
pub static NSRoundedBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Push.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsregularsquarebezelstyle?language=objc)
#[deprecated]
pub static NSRegularSquareBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::FlexiblePush.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdisclosurebezelstyle?language=objc)
#[deprecated]
pub static NSDisclosureBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Disclosure.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshadowlesssquarebezelstyle?language=objc)
#[deprecated]
pub static NSShadowlessSquareBezelStyle: NSBezelStyle =
    NSBezelStyle(NSBezelStyle::ShadowlessSquare.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscircularbezelstyle?language=objc)
#[deprecated]
pub static NSCircularBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Circular.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexturedsquarebezelstyle?language=objc)
#[deprecated]
pub static NSTexturedSquareBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::TexturedSquare.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshelpbuttonbezelstyle?language=objc)
#[deprecated]
pub static NSHelpButtonBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::HelpButton.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssmallsquarebezelstyle?language=objc)
#[deprecated]
pub static NSSmallSquareBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::SmallSquare.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexturedroundedbezelstyle?language=objc)
#[deprecated]
pub static NSTexturedRoundedBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Toolbar.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundrectbezelstyle?language=objc)
#[deprecated]
pub static NSRoundRectBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::AccessoryBarAction.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrecessedbezelstyle?language=objc)
#[deprecated]
pub static NSRecessedBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::AccessoryBar.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundeddisclosurebezelstyle?language=objc)
#[deprecated]
pub static NSRoundedDisclosureBezelStyle: NSBezelStyle =
    NSBezelStyle(NSBezelStyle::PushDisclosure.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinlinebezelstyle?language=objc)
#[deprecated]
pub static NSInlineBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Badge.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssmalliconbuttonbezelstyle?language=objc)
#[deprecated = "This bezel style is obsolete and should not be used."]
pub static NSSmallIconButtonBezelStyle: NSBezelStyle = NSBezelStyle(2);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsthicksquarebezelstyle?language=objc)
#[deprecated]
pub static NSThickSquareBezelStyle: NSBezelStyle = NSBezelStyle(3);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsthickersquarebezelstyle?language=objc)
#[deprecated]
pub static NSThickerSquareBezelStyle: NSBezelStyle = NSBezelStyle(4);

/// NSDeprecated.
#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSButtonCell {
    extern_methods!(
        #[deprecated = "The gradientType property is unused, and setting it has no effect."]
        #[unsafe(method(gradientType))]
        #[unsafe(method_family = none)]
        pub fn gradientType(&self) -> NSGradientType;

        /// Setter for [`gradientType`][Self::gradientType].
        #[deprecated = "The gradientType property is unused, and setting it has no effect."]
        #[unsafe(method(setGradientType:))]
        #[unsafe(method_family = none)]
        pub fn setGradientType(&self, gradient_type: NSGradientType);

        /// # Safety
        ///
        /// `string_with_ampersand` might not allow `None`.
        #[deprecated = "Mnemonics are not used on macOS. Set the title property directly instead."]
        #[unsafe(method(setTitleWithMnemonic:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTitleWithMnemonic(&self, string_with_ampersand: Option<&NSString>);

        /// # Safety
        ///
        /// `string_with_ampersand` might not allow `None`.
        #[deprecated = "Mnemonics are not used on macOS. Set the alternateTitle property directly instead."]
        #[unsafe(method(setAlternateTitleWithMnemonic:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAlternateTitleWithMnemonic(
            &self,
            string_with_ampersand: Option<&NSString>,
        );

        #[deprecated = "Mnemonics are not used on macOS. Calling this method has no effect."]
        #[unsafe(method(setAlternateMnemonicLocation:))]
        #[unsafe(method_family = none)]
        pub fn setAlternateMnemonicLocation(&self, location: NSUInteger);

        #[deprecated = "Mnemonics are not used on macOS. This property always returns NSNotFound."]
        #[unsafe(method(alternateMnemonicLocation))]
        #[unsafe(method_family = none)]
        pub fn alternateMnemonicLocation(&self) -> NSUInteger;

        #[deprecated = "Mnemonics are not used on macOS. This property always returns an empty string."]
        #[unsafe(method(alternateMnemonic))]
        #[unsafe(method_family = none)]
        pub fn alternateMnemonic(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSFont")]
        #[deprecated = "The keyEquivalentFont property is no longer used. It always returns the NSButtonCell's font, and setting it has no effect."]
        #[unsafe(method(keyEquivalentFont))]
        #[unsafe(method_family = none)]
        pub fn keyEquivalentFont(&self) -> Option<Retained<NSFont>>;

        #[cfg(feature = "NSFont")]
        /// Setter for [`keyEquivalentFont`][Self::keyEquivalentFont].
        #[deprecated = "The keyEquivalentFont property is no longer used. It always returns the NSButtonCell's font, and setting it has no effect."]
        #[unsafe(method(setKeyEquivalentFont:))]
        #[unsafe(method_family = none)]
        pub fn setKeyEquivalentFont(&self, key_equivalent_font: Option<&NSFont>);

        #[cfg(feature = "objc2-core-foundation")]
        #[deprecated = "The keyEquivalentFont property is no longer used. Setting it has no effect."]
        #[unsafe(method(setKeyEquivalentFont:size:))]
        #[unsafe(method_family = none)]
        pub fn setKeyEquivalentFont_size(&self, font_name: &NSString, font_size: CGFloat);
    );
}