objc2_app_kit/generated/
NSButtonCell.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbuttontype?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSButtonType(pub NSUInteger);
17impl NSButtonType {
18    #[doc(alias = "NSButtonTypeMomentaryLight")]
19    pub const MomentaryLight: Self = Self(0);
20    #[doc(alias = "NSButtonTypePushOnPushOff")]
21    pub const PushOnPushOff: Self = Self(1);
22    #[doc(alias = "NSButtonTypeToggle")]
23    pub const Toggle: Self = Self(2);
24    #[doc(alias = "NSButtonTypeSwitch")]
25    pub const Switch: Self = Self(3);
26    #[doc(alias = "NSButtonTypeRadio")]
27    pub const Radio: Self = Self(4);
28    #[doc(alias = "NSButtonTypeMomentaryChange")]
29    pub const MomentaryChange: Self = Self(5);
30    #[doc(alias = "NSButtonTypeOnOff")]
31    pub const OnOff: Self = Self(6);
32    #[doc(alias = "NSButtonTypeMomentaryPushIn")]
33    pub const MomentaryPushIn: Self = Self(7);
34    #[doc(alias = "NSButtonTypeAccelerator")]
35    pub const Accelerator: Self = Self(8);
36    #[doc(alias = "NSButtonTypeMultiLevelAccelerator")]
37    pub const MultiLevelAccelerator: Self = Self(9);
38}
39
40unsafe impl Encode for NSButtonType {
41    const ENCODING: Encoding = NSUInteger::ENCODING;
42}
43
44unsafe impl RefEncode for NSButtonType {
45    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
46}
47
48/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbezelstyle?language=objc)
49// NS_ENUM
50#[repr(transparent)]
51#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
52pub struct NSBezelStyle(pub NSUInteger);
53impl NSBezelStyle {
54    /// 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.
55    #[doc(alias = "NSBezelStyleAutomatic")]
56    pub const Automatic: Self = Self(0);
57    /// The standard system push button style.
58    #[doc(alias = "NSBezelStylePush")]
59    pub const Push: Self = Self(1);
60    /// A flexible-height variant of NSBezelStylePush.
61    #[doc(alias = "NSBezelStyleFlexiblePush")]
62    pub const FlexiblePush: Self = Self(2);
63    /// An unbezeled button with a disclosure triangle.
64    #[doc(alias = "NSBezelStyleDisclosure")]
65    pub const Disclosure: Self = Self(5);
66    /// A button with a circular bezel suitable for a small icon or single character.
67    #[doc(alias = "NSBezelStyleCircular")]
68    pub const Circular: Self = Self(7);
69    /// A circular button with a question mark providing the standard Help button appearance.
70    #[doc(alias = "NSBezelStyleHelpButton")]
71    pub const HelpButton: Self = Self(9);
72    /// A button with squared edges and flexible height.
73    #[doc(alias = "NSBezelStyleSmallSquare")]
74    pub const SmallSquare: Self = Self(10);
75    /// A button style that is appropriate for use in a toolbar item.
76    #[doc(alias = "NSBezelStyleToolbar")]
77    pub const Toolbar: Self = Self(11);
78    /// 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.
79    #[doc(alias = "NSBezelStyleAccessoryBarAction")]
80    pub const AccessoryBarAction: Self = Self(12);
81    /// A bezel style that is suitable for accessory and scope bars. This style is typically used for buttons with togglable state.
82    #[doc(alias = "NSBezelStyleAccessoryBar")]
83    pub const AccessoryBar: Self = Self(13);
84    /// A bezeled variant of NSBezelStyleDisclosure.
85    #[doc(alias = "NSBezelStylePushDisclosure")]
86    pub const PushDisclosure: Self = Self(14);
87    /// A bezel style that is typically used in table rows to display information about the row, such as a count.
88    #[doc(alias = "NSBezelStyleBadge")]
89    pub const Badge: Self = Self(15);
90    /// A bezel style with a glass effect
91    #[doc(alias = "NSBezelStyleGlass")]
92    pub const Glass: Self = Self(16);
93    /// A bezel style with a glass effect
94    #[doc(alias = "NSBezelStyleShadowlessSquare")]
95    #[deprecated]
96    pub const ShadowlessSquare: Self = Self(6);
97    /// A bezel style with a glass effect
98    #[doc(alias = "NSBezelStyleTexturedSquare")]
99    #[deprecated]
100    pub const TexturedSquare: Self = Self(8);
101    /// A bezel style with a glass effect
102    #[doc(alias = "NSBezelStyleRounded")]
103    #[deprecated]
104    pub const Rounded: Self = Self(NSBezelStyle::Push.0);
105    /// A bezel style with a glass effect
106    #[doc(alias = "NSBezelStyleRegularSquare")]
107    #[deprecated]
108    pub const RegularSquare: Self = Self(NSBezelStyle::FlexiblePush.0);
109    /// A bezel style with a glass effect
110    #[doc(alias = "NSBezelStyleTexturedRounded")]
111    #[deprecated]
112    pub const TexturedRounded: Self = Self(NSBezelStyle::Toolbar.0);
113    /// A bezel style with a glass effect
114    #[doc(alias = "NSBezelStyleRoundRect")]
115    #[deprecated]
116    pub const RoundRect: Self = Self(NSBezelStyle::AccessoryBarAction.0);
117    /// A bezel style with a glass effect
118    #[doc(alias = "NSBezelStyleRecessed")]
119    #[deprecated]
120    pub const Recessed: Self = Self(NSBezelStyle::AccessoryBar.0);
121    /// A bezel style with a glass effect
122    #[doc(alias = "NSBezelStyleRoundedDisclosure")]
123    #[deprecated]
124    pub const RoundedDisclosure: Self = Self(NSBezelStyle::PushDisclosure.0);
125    /// A bezel style with a glass effect
126    #[doc(alias = "NSBezelStyleInline")]
127    #[deprecated]
128    pub const Inline: Self = Self(NSBezelStyle::Badge.0);
129}
130
131unsafe impl Encode for NSBezelStyle {
132    const ENCODING: Encoding = NSUInteger::ENCODING;
133}
134
135unsafe impl RefEncode for NSBezelStyle {
136    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
137}
138
139extern_class!(
140    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbuttoncell?language=objc)
141    #[unsafe(super(NSActionCell, NSCell, NSObject))]
142    #[derive(Debug, PartialEq, Eq, Hash)]
143    #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
144    pub struct NSButtonCell;
145);
146
147#[cfg(all(
148    feature = "NSAccessibilityProtocols",
149    feature = "NSActionCell",
150    feature = "NSCell"
151))]
152extern_conformance!(
153    unsafe impl NSAccessibility for NSButtonCell {}
154);
155
156#[cfg(all(
157    feature = "NSAccessibilityProtocols",
158    feature = "NSActionCell",
159    feature = "NSCell"
160))]
161extern_conformance!(
162    unsafe impl NSAccessibilityElementProtocol for NSButtonCell {}
163);
164
165#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
166extern_conformance!(
167    unsafe impl NSCoding for NSButtonCell {}
168);
169
170#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
171extern_conformance!(
172    unsafe impl NSCopying for NSButtonCell {}
173);
174
175#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
176unsafe impl CopyingHelper for NSButtonCell {
177    type Result = Self;
178}
179
180#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
181extern_conformance!(
182    unsafe impl NSObjectProtocol for NSButtonCell {}
183);
184
185#[cfg(all(
186    feature = "NSActionCell",
187    feature = "NSCell",
188    feature = "NSUserInterfaceItemIdentification"
189))]
190extern_conformance!(
191    unsafe impl NSUserInterfaceItemIdentification for NSButtonCell {}
192);
193
194#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
195impl NSButtonCell {
196    extern_methods!(
197        #[unsafe(method(initTextCell:))]
198        #[unsafe(method_family = init)]
199        pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
200
201        #[cfg(feature = "NSImage")]
202        #[unsafe(method(initImageCell:))]
203        #[unsafe(method_family = init)]
204        pub fn initImageCell(this: Allocated<Self>, image: Option<&NSImage>) -> Retained<Self>;
205
206        /// # Safety
207        ///
208        /// `coder` possibly has further requirements.
209        #[unsafe(method(initWithCoder:))]
210        #[unsafe(method_family = init)]
211        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
212
213        #[unsafe(method(bezelStyle))]
214        #[unsafe(method_family = none)]
215        pub fn bezelStyle(&self) -> NSBezelStyle;
216
217        /// Setter for [`bezelStyle`][Self::bezelStyle].
218        #[unsafe(method(setBezelStyle:))]
219        #[unsafe(method_family = none)]
220        pub fn setBezelStyle(&self, bezel_style: NSBezelStyle);
221
222        #[unsafe(method(setButtonType:))]
223        #[unsafe(method_family = none)]
224        pub fn setButtonType(&self, r#type: NSButtonType);
225
226        #[unsafe(method(highlightsBy))]
227        #[unsafe(method_family = none)]
228        pub fn highlightsBy(&self) -> NSCellStyleMask;
229
230        /// Setter for [`highlightsBy`][Self::highlightsBy].
231        #[unsafe(method(setHighlightsBy:))]
232        #[unsafe(method_family = none)]
233        pub fn setHighlightsBy(&self, highlights_by: NSCellStyleMask);
234
235        #[unsafe(method(showsStateBy))]
236        #[unsafe(method_family = none)]
237        pub fn showsStateBy(&self) -> NSCellStyleMask;
238
239        /// Setter for [`showsStateBy`][Self::showsStateBy].
240        #[unsafe(method(setShowsStateBy:))]
241        #[unsafe(method_family = none)]
242        pub fn setShowsStateBy(&self, shows_state_by: NSCellStyleMask);
243
244        #[unsafe(method(title))]
245        #[unsafe(method_family = none)]
246        pub fn title(&self) -> Retained<NSString>;
247
248        /// Setter for [`title`][Self::title].
249        ///
250        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
251        #[unsafe(method(setTitle:))]
252        #[unsafe(method_family = none)]
253        pub fn setTitle(&self, title: Option<&NSString>);
254
255        #[unsafe(method(attributedTitle))]
256        #[unsafe(method_family = none)]
257        pub fn attributedTitle(&self) -> Retained<NSAttributedString>;
258
259        /// Setter for [`attributedTitle`][Self::attributedTitle].
260        ///
261        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
262        #[unsafe(method(setAttributedTitle:))]
263        #[unsafe(method_family = none)]
264        pub fn setAttributedTitle(&self, attributed_title: &NSAttributedString);
265
266        #[unsafe(method(alternateTitle))]
267        #[unsafe(method_family = none)]
268        pub fn alternateTitle(&self) -> Retained<NSString>;
269
270        /// Setter for [`alternateTitle`][Self::alternateTitle].
271        ///
272        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
273        #[unsafe(method(setAlternateTitle:))]
274        #[unsafe(method_family = none)]
275        pub fn setAlternateTitle(&self, alternate_title: &NSString);
276
277        #[unsafe(method(attributedAlternateTitle))]
278        #[unsafe(method_family = none)]
279        pub fn attributedAlternateTitle(&self) -> Retained<NSAttributedString>;
280
281        /// Setter for [`attributedAlternateTitle`][Self::attributedAlternateTitle].
282        ///
283        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
284        #[unsafe(method(setAttributedAlternateTitle:))]
285        #[unsafe(method_family = none)]
286        pub fn setAttributedAlternateTitle(&self, attributed_alternate_title: &NSAttributedString);
287
288        #[cfg(feature = "NSImage")]
289        #[unsafe(method(alternateImage))]
290        #[unsafe(method_family = none)]
291        pub fn alternateImage(&self) -> Option<Retained<NSImage>>;
292
293        #[cfg(feature = "NSImage")]
294        /// Setter for [`alternateImage`][Self::alternateImage].
295        #[unsafe(method(setAlternateImage:))]
296        #[unsafe(method_family = none)]
297        pub fn setAlternateImage(&self, alternate_image: Option<&NSImage>);
298
299        #[unsafe(method(imagePosition))]
300        #[unsafe(method_family = none)]
301        pub fn imagePosition(&self) -> NSCellImagePosition;
302
303        /// Setter for [`imagePosition`][Self::imagePosition].
304        #[unsafe(method(setImagePosition:))]
305        #[unsafe(method_family = none)]
306        pub fn setImagePosition(&self, image_position: NSCellImagePosition);
307
308        #[unsafe(method(imageScaling))]
309        #[unsafe(method_family = none)]
310        pub fn imageScaling(&self) -> NSImageScaling;
311
312        /// Setter for [`imageScaling`][Self::imageScaling].
313        #[unsafe(method(setImageScaling:))]
314        #[unsafe(method_family = none)]
315        pub fn setImageScaling(&self, image_scaling: NSImageScaling);
316
317        #[unsafe(method(keyEquivalent))]
318        #[unsafe(method_family = none)]
319        pub fn keyEquivalent(&self) -> Retained<NSString>;
320
321        /// Setter for [`keyEquivalent`][Self::keyEquivalent].
322        ///
323        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
324        #[unsafe(method(setKeyEquivalent:))]
325        #[unsafe(method_family = none)]
326        pub fn setKeyEquivalent(&self, key_equivalent: &NSString);
327
328        #[cfg(feature = "NSEvent")]
329        #[unsafe(method(keyEquivalentModifierMask))]
330        #[unsafe(method_family = none)]
331        pub fn keyEquivalentModifierMask(&self) -> NSEventModifierFlags;
332
333        #[cfg(feature = "NSEvent")]
334        /// Setter for [`keyEquivalentModifierMask`][Self::keyEquivalentModifierMask].
335        #[unsafe(method(setKeyEquivalentModifierMask:))]
336        #[unsafe(method_family = none)]
337        pub fn setKeyEquivalentModifierMask(
338            &self,
339            key_equivalent_modifier_mask: NSEventModifierFlags,
340        );
341
342        #[unsafe(method(isTransparent))]
343        #[unsafe(method_family = none)]
344        pub fn isTransparent(&self) -> bool;
345
346        /// Setter for [`isTransparent`][Self::isTransparent].
347        #[unsafe(method(setTransparent:))]
348        #[unsafe(method_family = none)]
349        pub fn setTransparent(&self, transparent: bool);
350
351        #[unsafe(method(isOpaque))]
352        #[unsafe(method_family = none)]
353        pub fn isOpaque(&self) -> bool;
354
355        #[unsafe(method(imageDimsWhenDisabled))]
356        #[unsafe(method_family = none)]
357        pub fn imageDimsWhenDisabled(&self) -> bool;
358
359        /// Setter for [`imageDimsWhenDisabled`][Self::imageDimsWhenDisabled].
360        #[unsafe(method(setImageDimsWhenDisabled:))]
361        #[unsafe(method_family = none)]
362        pub fn setImageDimsWhenDisabled(&self, image_dims_when_disabled: bool);
363
364        #[unsafe(method(showsBorderOnlyWhileMouseInside))]
365        #[unsafe(method_family = none)]
366        pub fn showsBorderOnlyWhileMouseInside(&self) -> bool;
367
368        /// Setter for [`showsBorderOnlyWhileMouseInside`][Self::showsBorderOnlyWhileMouseInside].
369        #[unsafe(method(setShowsBorderOnlyWhileMouseInside:))]
370        #[unsafe(method_family = none)]
371        pub fn setShowsBorderOnlyWhileMouseInside(
372            &self,
373            shows_border_only_while_mouse_inside: bool,
374        );
375
376        #[cfg(feature = "NSSound")]
377        #[unsafe(method(sound))]
378        #[unsafe(method_family = none)]
379        pub fn sound(&self) -> Option<Retained<NSSound>>;
380
381        #[cfg(feature = "NSSound")]
382        /// Setter for [`sound`][Self::sound].
383        #[unsafe(method(setSound:))]
384        #[unsafe(method_family = none)]
385        pub fn setSound(&self, sound: Option<&NSSound>);
386
387        #[cfg(feature = "NSColor")]
388        #[unsafe(method(backgroundColor))]
389        #[unsafe(method_family = none)]
390        pub fn backgroundColor(&self) -> Option<Retained<NSColor>>;
391
392        #[cfg(feature = "NSColor")]
393        /// Setter for [`backgroundColor`][Self::backgroundColor].
394        ///
395        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
396        #[unsafe(method(setBackgroundColor:))]
397        #[unsafe(method_family = none)]
398        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
399
400        #[unsafe(method(setPeriodicDelay:interval:))]
401        #[unsafe(method_family = none)]
402        pub fn setPeriodicDelay_interval(&self, delay: c_float, interval: c_float);
403
404        /// # Safety
405        ///
406        /// - `delay` must be a valid pointer.
407        /// - `interval` must be a valid pointer.
408        #[unsafe(method(getPeriodicDelay:interval:))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn getPeriodicDelay_interval(
411            &self,
412            delay: NonNull<c_float>,
413            interval: NonNull<c_float>,
414        );
415
416        /// # Safety
417        ///
418        /// `sender` should be of the correct type.
419        #[unsafe(method(performClick:))]
420        #[unsafe(method_family = none)]
421        pub unsafe fn performClick(&self, sender: Option<&AnyObject>);
422
423        #[cfg(feature = "NSEvent")]
424        #[unsafe(method(mouseEntered:))]
425        #[unsafe(method_family = none)]
426        pub fn mouseEntered(&self, event: &NSEvent);
427
428        #[cfg(feature = "NSEvent")]
429        #[unsafe(method(mouseExited:))]
430        #[unsafe(method_family = none)]
431        pub fn mouseExited(&self, event: &NSEvent);
432
433        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
434        #[unsafe(method(drawBezelWithFrame:inView:))]
435        #[unsafe(method_family = none)]
436        pub fn drawBezelWithFrame_inView(&self, frame: NSRect, control_view: &NSView);
437
438        #[cfg(all(feature = "NSImage", feature = "NSResponder", feature = "NSView"))]
439        #[unsafe(method(drawImage:withFrame:inView:))]
440        #[unsafe(method_family = none)]
441        pub fn drawImage_withFrame_inView(
442            &self,
443            image: &NSImage,
444            frame: NSRect,
445            control_view: &NSView,
446        );
447
448        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
449        #[unsafe(method(drawTitle:withFrame:inView:))]
450        #[unsafe(method_family = none)]
451        pub fn drawTitle_withFrame_inView(
452            &self,
453            title: &NSAttributedString,
454            frame: NSRect,
455            control_view: &NSView,
456        ) -> NSRect;
457    );
458}
459
460/// Methods declared on superclass `NSCell`.
461#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
462impl NSButtonCell {
463    extern_methods!(
464        #[unsafe(method(init))]
465        #[unsafe(method_family = init)]
466        pub fn init(this: Allocated<Self>) -> Retained<Self>;
467    );
468}
469
470/// Methods declared on superclass `NSObject`.
471#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
472impl NSButtonCell {
473    extern_methods!(
474        #[unsafe(method(new))]
475        #[unsafe(method_family = new)]
476        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
477    );
478}
479
480/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsgradienttype?language=objc)
481// NS_ENUM
482#[deprecated]
483#[repr(transparent)]
484#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
485pub struct NSGradientType(pub NSUInteger);
486impl NSGradientType {
487    #[doc(alias = "NSGradientNone")]
488    #[deprecated]
489    pub const None: Self = Self(0);
490    #[doc(alias = "NSGradientConcaveWeak")]
491    #[deprecated]
492    pub const ConcaveWeak: Self = Self(1);
493    #[doc(alias = "NSGradientConcaveStrong")]
494    #[deprecated]
495    pub const ConcaveStrong: Self = Self(2);
496    #[doc(alias = "NSGradientConvexWeak")]
497    #[deprecated]
498    pub const ConvexWeak: Self = Self(3);
499    #[doc(alias = "NSGradientConvexStrong")]
500    #[deprecated]
501    pub const ConvexStrong: Self = Self(4);
502}
503
504unsafe impl Encode for NSGradientType {
505    const ENCODING: Encoding = NSUInteger::ENCODING;
506}
507
508unsafe impl RefEncode for NSGradientType {
509    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
510}
511
512/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarylightbutton?language=objc)
513#[deprecated]
514pub static NSMomentaryLightButton: NSButtonType = NSButtonType(NSButtonType::MomentaryLight.0);
515
516/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspushonpushoffbutton?language=objc)
517#[deprecated]
518pub static NSPushOnPushOffButton: NSButtonType = NSButtonType(NSButtonType::PushOnPushOff.0);
519
520/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstogglebutton?language=objc)
521#[deprecated]
522pub static NSToggleButton: NSButtonType = NSButtonType(NSButtonType::Toggle.0);
523
524/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsswitchbutton?language=objc)
525#[deprecated]
526pub static NSSwitchButton: NSButtonType = NSButtonType(NSButtonType::Switch.0);
527
528/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsradiobutton?language=objc)
529#[deprecated]
530pub static NSRadioButton: NSButtonType = NSButtonType(NSButtonType::Radio.0);
531
532/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarychangebutton?language=objc)
533#[deprecated]
534pub static NSMomentaryChangeButton: NSButtonType = NSButtonType(NSButtonType::MomentaryChange.0);
535
536/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsonoffbutton?language=objc)
537#[deprecated]
538pub static NSOnOffButton: NSButtonType = NSButtonType(NSButtonType::OnOff.0);
539
540/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarypushinbutton?language=objc)
541#[deprecated]
542pub static NSMomentaryPushInButton: NSButtonType = NSButtonType(NSButtonType::MomentaryPushIn.0);
543
544/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsacceleratorbutton?language=objc)
545#[deprecated]
546pub static NSAcceleratorButton: NSButtonType = NSButtonType(NSButtonType::Accelerator.0);
547
548/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmultilevelacceleratorbutton?language=objc)
549#[deprecated]
550pub static NSMultiLevelAcceleratorButton: NSButtonType =
551    NSButtonType(NSButtonType::MultiLevelAccelerator.0);
552
553/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarypushbutton?language=objc)
554#[deprecated = "This constant is misnamed and has the same effect as NSButtonTypeMomentaryLight. Use that name instead, or switch to NSButtonTypeMomentaryPushIn."]
555pub static NSMomentaryPushButton: NSButtonType = NSButtonType(NSButtonType::MomentaryLight.0);
556
557/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmomentarylight?language=objc)
558#[deprecated = "This constant is misnamed and has the same effect as NSButtonTypeMomentaryPushIn. Use that name instead, or switch to NSButtonTypeMomentaryLight."]
559pub static NSMomentaryLight: NSButtonType = NSButtonType(NSButtonType::MomentaryPushIn.0);
560
561/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundedbezelstyle?language=objc)
562#[deprecated]
563pub static NSRoundedBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Push.0);
564
565/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsregularsquarebezelstyle?language=objc)
566#[deprecated]
567pub static NSRegularSquareBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::FlexiblePush.0);
568
569/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdisclosurebezelstyle?language=objc)
570#[deprecated]
571pub static NSDisclosureBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Disclosure.0);
572
573/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshadowlesssquarebezelstyle?language=objc)
574#[deprecated]
575pub static NSShadowlessSquareBezelStyle: NSBezelStyle =
576    NSBezelStyle(NSBezelStyle::ShadowlessSquare.0);
577
578/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscircularbezelstyle?language=objc)
579#[deprecated]
580pub static NSCircularBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Circular.0);
581
582/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexturedsquarebezelstyle?language=objc)
583#[deprecated]
584pub static NSTexturedSquareBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::TexturedSquare.0);
585
586/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshelpbuttonbezelstyle?language=objc)
587#[deprecated]
588pub static NSHelpButtonBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::HelpButton.0);
589
590/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssmallsquarebezelstyle?language=objc)
591#[deprecated]
592pub static NSSmallSquareBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::SmallSquare.0);
593
594/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexturedroundedbezelstyle?language=objc)
595#[deprecated]
596pub static NSTexturedRoundedBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Toolbar.0);
597
598/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundrectbezelstyle?language=objc)
599#[deprecated]
600pub static NSRoundRectBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::AccessoryBarAction.0);
601
602/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrecessedbezelstyle?language=objc)
603#[deprecated]
604pub static NSRecessedBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::AccessoryBar.0);
605
606/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundeddisclosurebezelstyle?language=objc)
607#[deprecated]
608pub static NSRoundedDisclosureBezelStyle: NSBezelStyle =
609    NSBezelStyle(NSBezelStyle::PushDisclosure.0);
610
611/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinlinebezelstyle?language=objc)
612#[deprecated]
613pub static NSInlineBezelStyle: NSBezelStyle = NSBezelStyle(NSBezelStyle::Badge.0);
614
615/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssmalliconbuttonbezelstyle?language=objc)
616#[deprecated = "This bezel style is obsolete and should not be used."]
617pub static NSSmallIconButtonBezelStyle: NSBezelStyle = NSBezelStyle(2);
618
619/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsthicksquarebezelstyle?language=objc)
620#[deprecated]
621pub static NSThickSquareBezelStyle: NSBezelStyle = NSBezelStyle(3);
622
623/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsthickersquarebezelstyle?language=objc)
624#[deprecated]
625pub static NSThickerSquareBezelStyle: NSBezelStyle = NSBezelStyle(4);
626
627/// NSDeprecated.
628#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
629impl NSButtonCell {
630    extern_methods!(
631        #[deprecated = "The gradientType property is unused, and setting it has no effect."]
632        #[unsafe(method(gradientType))]
633        #[unsafe(method_family = none)]
634        pub fn gradientType(&self) -> NSGradientType;
635
636        /// Setter for [`gradientType`][Self::gradientType].
637        #[deprecated = "The gradientType property is unused, and setting it has no effect."]
638        #[unsafe(method(setGradientType:))]
639        #[unsafe(method_family = none)]
640        pub fn setGradientType(&self, gradient_type: NSGradientType);
641
642        /// # Safety
643        ///
644        /// `string_with_ampersand` might not allow `None`.
645        #[deprecated = "Mnemonics are not used on macOS. Set the title property directly instead."]
646        #[unsafe(method(setTitleWithMnemonic:))]
647        #[unsafe(method_family = none)]
648        pub unsafe fn setTitleWithMnemonic(&self, string_with_ampersand: Option<&NSString>);
649
650        /// # Safety
651        ///
652        /// `string_with_ampersand` might not allow `None`.
653        #[deprecated = "Mnemonics are not used on macOS. Set the alternateTitle property directly instead."]
654        #[unsafe(method(setAlternateTitleWithMnemonic:))]
655        #[unsafe(method_family = none)]
656        pub unsafe fn setAlternateTitleWithMnemonic(
657            &self,
658            string_with_ampersand: Option<&NSString>,
659        );
660
661        #[deprecated = "Mnemonics are not used on macOS. Calling this method has no effect."]
662        #[unsafe(method(setAlternateMnemonicLocation:))]
663        #[unsafe(method_family = none)]
664        pub fn setAlternateMnemonicLocation(&self, location: NSUInteger);
665
666        #[deprecated = "Mnemonics are not used on macOS. This property always returns NSNotFound."]
667        #[unsafe(method(alternateMnemonicLocation))]
668        #[unsafe(method_family = none)]
669        pub fn alternateMnemonicLocation(&self) -> NSUInteger;
670
671        #[deprecated = "Mnemonics are not used on macOS. This property always returns an empty string."]
672        #[unsafe(method(alternateMnemonic))]
673        #[unsafe(method_family = none)]
674        pub fn alternateMnemonic(&self) -> Option<Retained<NSString>>;
675
676        #[cfg(feature = "NSFont")]
677        #[deprecated = "The keyEquivalentFont property is no longer used. It always returns the NSButtonCell's font, and setting it has no effect."]
678        #[unsafe(method(keyEquivalentFont))]
679        #[unsafe(method_family = none)]
680        pub fn keyEquivalentFont(&self) -> Option<Retained<NSFont>>;
681
682        #[cfg(feature = "NSFont")]
683        /// Setter for [`keyEquivalentFont`][Self::keyEquivalentFont].
684        #[deprecated = "The keyEquivalentFont property is no longer used. It always returns the NSButtonCell's font, and setting it has no effect."]
685        #[unsafe(method(setKeyEquivalentFont:))]
686        #[unsafe(method_family = none)]
687        pub fn setKeyEquivalentFont(&self, key_equivalent_font: Option<&NSFont>);
688
689        #[cfg(feature = "objc2-core-foundation")]
690        #[deprecated = "The keyEquivalentFont property is no longer used. Setting it has no effect."]
691        #[unsafe(method(setKeyEquivalentFont:size:))]
692        #[unsafe(method_family = none)]
693        pub fn setKeyEquivalentFont_size(&self, font_name: &NSString, font_size: CGFloat);
694    );
695}