objc2_app_kit/generated/
NSCell.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/nscelltype?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSCellType(pub NSUInteger);
17impl NSCellType {
18    #[doc(alias = "NSNullCellType")]
19    pub const NullCellType: Self = Self(0);
20    #[doc(alias = "NSTextCellType")]
21    pub const TextCellType: Self = Self(1);
22    #[doc(alias = "NSImageCellType")]
23    pub const ImageCellType: Self = Self(2);
24}
25
26unsafe impl Encode for NSCellType {
27    const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSCellType {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscellattribute?language=objc)
35// NS_ENUM
36#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct NSCellAttribute(pub NSUInteger);
39impl NSCellAttribute {
40    #[doc(alias = "NSCellDisabled")]
41    pub const CellDisabled: Self = Self(0);
42    #[doc(alias = "NSCellState")]
43    pub const CellState: Self = Self(1);
44    #[doc(alias = "NSPushInCell")]
45    pub const PushInCell: Self = Self(2);
46    #[doc(alias = "NSCellEditable")]
47    pub const CellEditable: Self = Self(3);
48    #[doc(alias = "NSChangeGrayCell")]
49    pub const ChangeGrayCell: Self = Self(4);
50    #[doc(alias = "NSCellHighlighted")]
51    pub const CellHighlighted: Self = Self(5);
52    #[doc(alias = "NSCellLightsByContents")]
53    pub const CellLightsByContents: Self = Self(6);
54    #[doc(alias = "NSCellLightsByGray")]
55    pub const CellLightsByGray: Self = Self(7);
56    #[doc(alias = "NSChangeBackgroundCell")]
57    pub const ChangeBackgroundCell: Self = Self(8);
58    #[doc(alias = "NSCellLightsByBackground")]
59    pub const CellLightsByBackground: Self = Self(9);
60    #[doc(alias = "NSCellIsBordered")]
61    pub const CellIsBordered: Self = Self(10);
62    #[doc(alias = "NSCellHasOverlappingImage")]
63    pub const CellHasOverlappingImage: Self = Self(11);
64    #[doc(alias = "NSCellHasImageHorizontal")]
65    pub const CellHasImageHorizontal: Self = Self(12);
66    #[doc(alias = "NSCellHasImageOnLeftOrBottom")]
67    pub const CellHasImageOnLeftOrBottom: Self = Self(13);
68    #[doc(alias = "NSCellChangesContents")]
69    pub const CellChangesContents: Self = Self(14);
70    #[doc(alias = "NSCellIsInsetButton")]
71    pub const CellIsInsetButton: Self = Self(15);
72    #[doc(alias = "NSCellAllowsMixedState")]
73    pub const CellAllowsMixedState: Self = Self(16);
74}
75
76unsafe impl Encode for NSCellAttribute {
77    const ENCODING: Encoding = NSUInteger::ENCODING;
78}
79
80unsafe impl RefEncode for NSCellAttribute {
81    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
82}
83
84/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscellimageposition?language=objc)
85// NS_ENUM
86#[repr(transparent)]
87#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
88pub struct NSCellImagePosition(pub NSUInteger);
89impl NSCellImagePosition {
90    #[doc(alias = "NSNoImage")]
91    pub const NoImage: Self = Self(0);
92    #[doc(alias = "NSImageOnly")]
93    pub const ImageOnly: Self = Self(1);
94    #[doc(alias = "NSImageLeft")]
95    pub const ImageLeft: Self = Self(2);
96    #[doc(alias = "NSImageRight")]
97    pub const ImageRight: Self = Self(3);
98    #[doc(alias = "NSImageBelow")]
99    pub const ImageBelow: Self = Self(4);
100    #[doc(alias = "NSImageAbove")]
101    pub const ImageAbove: Self = Self(5);
102    #[doc(alias = "NSImageOverlaps")]
103    pub const ImageOverlaps: Self = Self(6);
104    #[doc(alias = "NSImageLeading")]
105    pub const ImageLeading: Self = Self(7);
106    #[doc(alias = "NSImageTrailing")]
107    pub const ImageTrailing: Self = Self(8);
108}
109
110unsafe impl Encode for NSCellImagePosition {
111    const ENCODING: Encoding = NSUInteger::ENCODING;
112}
113
114unsafe impl RefEncode for NSCellImagePosition {
115    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
116}
117
118/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagescaling?language=objc)
119// NS_ENUM
120#[repr(transparent)]
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
122pub struct NSImageScaling(pub NSUInteger);
123impl NSImageScaling {
124    #[doc(alias = "NSImageScaleProportionallyDown")]
125    pub const ScaleProportionallyDown: Self = Self(0);
126    #[doc(alias = "NSImageScaleAxesIndependently")]
127    pub const ScaleAxesIndependently: Self = Self(1);
128    #[doc(alias = "NSImageScaleNone")]
129    pub const ScaleNone: Self = Self(2);
130    #[doc(alias = "NSImageScaleProportionallyUpOrDown")]
131    pub const ScaleProportionallyUpOrDown: Self = Self(3);
132    #[deprecated = "Use NSImageScaleProportionallyDown instead"]
133    pub const NSScaleProportionally: Self = Self(0);
134    #[deprecated = "Use NSImageScaleAxesIndependently instead"]
135    pub const NSScaleToFit: Self = Self(1);
136    #[deprecated = "Use NSImageScaleNone instead"]
137    pub const NSScaleNone: Self = Self(2);
138}
139
140unsafe impl Encode for NSImageScaling {
141    const ENCODING: Encoding = NSUInteger::ENCODING;
142}
143
144unsafe impl RefEncode for NSImageScaling {
145    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
146}
147
148/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontrolstatevalue?language=objc)
149// NS_TYPED_EXTENSIBLE_ENUM
150pub type NSControlStateValue = NSInteger;
151
152/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontrolstatevaluemixed?language=objc)
153pub static NSControlStateValueMixed: NSControlStateValue = -1;
154
155/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontrolstatevalueoff?language=objc)
156pub static NSControlStateValueOff: NSControlStateValue = 0;
157
158/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontrolstatevalueon?language=objc)
159pub static NSControlStateValueOn: NSControlStateValue = 1;
160
161/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscellstylemask?language=objc)
162// NS_OPTIONS
163#[repr(transparent)]
164#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
165pub struct NSCellStyleMask(pub NSUInteger);
166bitflags::bitflags! {
167    impl NSCellStyleMask: NSUInteger {
168        #[doc(alias = "NSNoCellMask")]
169        const NoCellMask = 0;
170        #[doc(alias = "NSContentsCellMask")]
171        const ContentsCellMask = 1;
172        #[doc(alias = "NSPushInCellMask")]
173        const PushInCellMask = 2;
174        #[doc(alias = "NSChangeGrayCellMask")]
175        const ChangeGrayCellMask = 4;
176        #[doc(alias = "NSChangeBackgroundCellMask")]
177        const ChangeBackgroundCellMask = 8;
178    }
179}
180
181unsafe impl Encode for NSCellStyleMask {
182    const ENCODING: Encoding = NSUInteger::ENCODING;
183}
184
185unsafe impl RefEncode for NSCellStyleMask {
186    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
187}
188
189/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontroltint?language=objc)
190// NS_ENUM
191#[repr(transparent)]
192#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
193pub struct NSControlTint(pub NSUInteger);
194impl NSControlTint {
195    #[doc(alias = "NSDefaultControlTint")]
196    pub const DefaultControlTint: Self = Self(0);
197    #[doc(alias = "NSBlueControlTint")]
198    pub const BlueControlTint: Self = Self(1);
199    #[doc(alias = "NSGraphiteControlTint")]
200    pub const GraphiteControlTint: Self = Self(6);
201    #[doc(alias = "NSClearControlTint")]
202    pub const ClearControlTint: Self = Self(7);
203}
204
205unsafe impl Encode for NSControlTint {
206    const ENCODING: Encoding = NSUInteger::ENCODING;
207}
208
209unsafe impl RefEncode for NSControlTint {
210    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
211}
212
213/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontrolsize?language=objc)
214// NS_ENUM
215#[repr(transparent)]
216#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
217pub struct NSControlSize(pub NSUInteger);
218impl NSControlSize {
219    #[doc(alias = "NSControlSizeRegular")]
220    pub const Regular: Self = Self(0);
221    #[doc(alias = "NSControlSizeSmall")]
222    pub const Small: Self = Self(1);
223    #[doc(alias = "NSControlSizeMini")]
224    pub const Mini: Self = Self(2);
225    #[doc(alias = "NSControlSizeLarge")]
226    pub const Large: Self = Self(3);
227}
228
229unsafe impl Encode for NSControlSize {
230    const ENCODING: Encoding = NSUInteger::ENCODING;
231}
232
233unsafe impl RefEncode for NSControlSize {
234    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
235}
236
237extern_class!(
238    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscell?language=objc)
239    #[unsafe(super(NSObject))]
240    #[thread_kind = MainThreadOnly]
241    #[derive(Debug, PartialEq, Eq, Hash)]
242    pub struct NSCell;
243);
244
245#[cfg(feature = "NSAccessibilityProtocols")]
246extern_conformance!(
247    unsafe impl NSAccessibility for NSCell {}
248);
249
250#[cfg(feature = "NSAccessibilityProtocols")]
251extern_conformance!(
252    unsafe impl NSAccessibilityElementProtocol for NSCell {}
253);
254
255extern_conformance!(
256    unsafe impl NSCoding for NSCell {}
257);
258
259extern_conformance!(
260    unsafe impl NSCopying for NSCell {}
261);
262
263unsafe impl CopyingHelper for NSCell {
264    type Result = Self;
265}
266
267extern_conformance!(
268    unsafe impl NSObjectProtocol for NSCell {}
269);
270
271#[cfg(feature = "NSUserInterfaceItemIdentification")]
272extern_conformance!(
273    unsafe impl NSUserInterfaceItemIdentification for NSCell {}
274);
275
276impl NSCell {
277    extern_methods!(
278        #[unsafe(method(init))]
279        #[unsafe(method_family = init)]
280        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
281
282        #[unsafe(method(initTextCell:))]
283        #[unsafe(method_family = init)]
284        pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
285
286        #[cfg(feature = "NSImage")]
287        #[unsafe(method(initImageCell:))]
288        #[unsafe(method_family = init)]
289        pub unsafe fn initImageCell(
290            this: Allocated<Self>,
291            image: Option<&NSImage>,
292        ) -> Retained<Self>;
293
294        #[unsafe(method(initWithCoder:))]
295        #[unsafe(method_family = init)]
296        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
297
298        #[unsafe(method(prefersTrackingUntilMouseUp))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn prefersTrackingUntilMouseUp(mtm: MainThreadMarker) -> bool;
301
302        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
303        #[unsafe(method(controlView))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn controlView(&self) -> Option<Retained<NSView>>;
306
307        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
308        /// Setter for [`controlView`][Self::controlView].
309        #[unsafe(method(setControlView:))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn setControlView(&self, control_view: Option<&NSView>);
312
313        #[unsafe(method(type))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn r#type(&self) -> NSCellType;
316
317        /// Setter for [`type`][Self::type].
318        #[unsafe(method(setType:))]
319        #[unsafe(method_family = none)]
320        pub unsafe fn setType(&self, r#type: NSCellType);
321
322        #[unsafe(method(state))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn state(&self) -> NSControlStateValue;
325
326        /// Setter for [`state`][Self::state].
327        #[unsafe(method(setState:))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn setState(&self, state: NSControlStateValue);
330
331        #[unsafe(method(target))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
334
335        /// This is a [weak property][objc2::topics::weak_property].
336        /// Setter for [`target`][Self::target].
337        #[unsafe(method(setTarget:))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
340
341        #[unsafe(method(action))]
342        #[unsafe(method_family = none)]
343        pub unsafe fn action(&self) -> Option<Sel>;
344
345        /// Setter for [`action`][Self::action].
346        #[unsafe(method(setAction:))]
347        #[unsafe(method_family = none)]
348        pub unsafe fn setAction(&self, action: Option<Sel>);
349
350        #[unsafe(method(tag))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn tag(&self) -> NSInteger;
353
354        /// Setter for [`tag`][Self::tag].
355        #[unsafe(method(setTag:))]
356        #[unsafe(method_family = none)]
357        pub unsafe fn setTag(&self, tag: NSInteger);
358
359        #[unsafe(method(title))]
360        #[unsafe(method_family = none)]
361        pub unsafe fn title(&self) -> Retained<NSString>;
362
363        /// Setter for [`title`][Self::title].
364        #[unsafe(method(setTitle:))]
365        #[unsafe(method_family = none)]
366        pub unsafe fn setTitle(&self, title: &NSString);
367
368        #[unsafe(method(isOpaque))]
369        #[unsafe(method_family = none)]
370        pub unsafe fn isOpaque(&self) -> bool;
371
372        #[unsafe(method(isEnabled))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn isEnabled(&self) -> bool;
375
376        /// Setter for [`isEnabled`][Self::isEnabled].
377        #[unsafe(method(setEnabled:))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn setEnabled(&self, enabled: bool);
380
381        #[cfg(feature = "NSEvent")]
382        #[unsafe(method(sendActionOn:))]
383        #[unsafe(method_family = none)]
384        pub unsafe fn sendActionOn(&self, mask: NSEventMask) -> NSInteger;
385
386        #[unsafe(method(isContinuous))]
387        #[unsafe(method_family = none)]
388        pub unsafe fn isContinuous(&self) -> bool;
389
390        /// Setter for [`isContinuous`][Self::isContinuous].
391        #[unsafe(method(setContinuous:))]
392        #[unsafe(method_family = none)]
393        pub unsafe fn setContinuous(&self, continuous: bool);
394
395        #[unsafe(method(isEditable))]
396        #[unsafe(method_family = none)]
397        pub unsafe fn isEditable(&self) -> bool;
398
399        /// Setter for [`isEditable`][Self::isEditable].
400        #[unsafe(method(setEditable:))]
401        #[unsafe(method_family = none)]
402        pub unsafe fn setEditable(&self, editable: bool);
403
404        #[unsafe(method(isSelectable))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn isSelectable(&self) -> bool;
407
408        /// Setter for [`isSelectable`][Self::isSelectable].
409        #[unsafe(method(setSelectable:))]
410        #[unsafe(method_family = none)]
411        pub unsafe fn setSelectable(&self, selectable: bool);
412
413        #[unsafe(method(isBordered))]
414        #[unsafe(method_family = none)]
415        pub unsafe fn isBordered(&self) -> bool;
416
417        /// Setter for [`isBordered`][Self::isBordered].
418        #[unsafe(method(setBordered:))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn setBordered(&self, bordered: bool);
421
422        #[unsafe(method(isBezeled))]
423        #[unsafe(method_family = none)]
424        pub unsafe fn isBezeled(&self) -> bool;
425
426        /// Setter for [`isBezeled`][Self::isBezeled].
427        #[unsafe(method(setBezeled:))]
428        #[unsafe(method_family = none)]
429        pub unsafe fn setBezeled(&self, bezeled: bool);
430
431        #[unsafe(method(isScrollable))]
432        #[unsafe(method_family = none)]
433        pub unsafe fn isScrollable(&self) -> bool;
434
435        /// Setter for [`isScrollable`][Self::isScrollable].
436        #[unsafe(method(setScrollable:))]
437        #[unsafe(method_family = none)]
438        pub unsafe fn setScrollable(&self, scrollable: bool);
439
440        #[unsafe(method(isHighlighted))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn isHighlighted(&self) -> bool;
443
444        /// Setter for [`isHighlighted`][Self::isHighlighted].
445        #[unsafe(method(setHighlighted:))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn setHighlighted(&self, highlighted: bool);
448
449        #[cfg(feature = "NSText")]
450        #[unsafe(method(alignment))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn alignment(&self) -> NSTextAlignment;
453
454        #[cfg(feature = "NSText")]
455        /// Setter for [`alignment`][Self::alignment].
456        #[unsafe(method(setAlignment:))]
457        #[unsafe(method_family = none)]
458        pub unsafe fn setAlignment(&self, alignment: NSTextAlignment);
459
460        #[unsafe(method(wraps))]
461        #[unsafe(method_family = none)]
462        pub unsafe fn wraps(&self) -> bool;
463
464        /// Setter for [`wraps`][Self::wraps].
465        #[unsafe(method(setWraps:))]
466        #[unsafe(method_family = none)]
467        pub unsafe fn setWraps(&self, wraps: bool);
468
469        #[cfg(feature = "NSFont")]
470        #[unsafe(method(font))]
471        #[unsafe(method_family = none)]
472        pub unsafe fn font(&self) -> Option<Retained<NSFont>>;
473
474        #[cfg(feature = "NSFont")]
475        /// Setter for [`font`][Self::font].
476        #[unsafe(method(setFont:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn setFont(&self, font: Option<&NSFont>);
479
480        #[unsafe(method(keyEquivalent))]
481        #[unsafe(method_family = none)]
482        pub unsafe fn keyEquivalent(&self) -> Retained<NSString>;
483
484        #[unsafe(method(formatter))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn formatter(&self) -> Option<Retained<NSFormatter>>;
487
488        /// Setter for [`formatter`][Self::formatter].
489        #[unsafe(method(setFormatter:))]
490        #[unsafe(method_family = none)]
491        pub unsafe fn setFormatter(&self, formatter: Option<&NSFormatter>);
492
493        #[unsafe(method(objectValue))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn objectValue(&self) -> Option<Retained<AnyObject>>;
496
497        /// Setter for [`objectValue`][Self::objectValue].
498        #[unsafe(method(setObjectValue:))]
499        #[unsafe(method_family = none)]
500        pub unsafe fn setObjectValue(&self, object_value: Option<&AnyObject>);
501
502        #[unsafe(method(hasValidObjectValue))]
503        #[unsafe(method_family = none)]
504        pub unsafe fn hasValidObjectValue(&self) -> bool;
505
506        #[unsafe(method(stringValue))]
507        #[unsafe(method_family = none)]
508        pub unsafe fn stringValue(&self) -> Retained<NSString>;
509
510        /// Setter for [`stringValue`][Self::stringValue].
511        #[unsafe(method(setStringValue:))]
512        #[unsafe(method_family = none)]
513        pub unsafe fn setStringValue(&self, string_value: &NSString);
514
515        #[unsafe(method(compare:))]
516        #[unsafe(method_family = none)]
517        pub unsafe fn compare(&self, other_cell: &AnyObject) -> NSComparisonResult;
518
519        #[unsafe(method(intValue))]
520        #[unsafe(method_family = none)]
521        pub unsafe fn intValue(&self) -> c_int;
522
523        /// Setter for [`intValue`][Self::intValue].
524        #[unsafe(method(setIntValue:))]
525        #[unsafe(method_family = none)]
526        pub unsafe fn setIntValue(&self, int_value: c_int);
527
528        #[unsafe(method(floatValue))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn floatValue(&self) -> c_float;
531
532        /// Setter for [`floatValue`][Self::floatValue].
533        #[unsafe(method(setFloatValue:))]
534        #[unsafe(method_family = none)]
535        pub unsafe fn setFloatValue(&self, float_value: c_float);
536
537        #[unsafe(method(doubleValue))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn doubleValue(&self) -> c_double;
540
541        /// Setter for [`doubleValue`][Self::doubleValue].
542        #[unsafe(method(setDoubleValue:))]
543        #[unsafe(method_family = none)]
544        pub unsafe fn setDoubleValue(&self, double_value: c_double);
545
546        #[unsafe(method(integerValue))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn integerValue(&self) -> NSInteger;
549
550        /// Setter for [`integerValue`][Self::integerValue].
551        #[unsafe(method(setIntegerValue:))]
552        #[unsafe(method_family = none)]
553        pub unsafe fn setIntegerValue(&self, integer_value: NSInteger);
554
555        #[unsafe(method(takeIntValueFrom:))]
556        #[unsafe(method_family = none)]
557        pub unsafe fn takeIntValueFrom(&self, sender: Option<&AnyObject>);
558
559        #[unsafe(method(takeFloatValueFrom:))]
560        #[unsafe(method_family = none)]
561        pub unsafe fn takeFloatValueFrom(&self, sender: Option<&AnyObject>);
562
563        #[unsafe(method(takeDoubleValueFrom:))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn takeDoubleValueFrom(&self, sender: Option<&AnyObject>);
566
567        #[unsafe(method(takeStringValueFrom:))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn takeStringValueFrom(&self, sender: Option<&AnyObject>);
570
571        #[unsafe(method(takeObjectValueFrom:))]
572        #[unsafe(method_family = none)]
573        pub unsafe fn takeObjectValueFrom(&self, sender: Option<&AnyObject>);
574
575        #[unsafe(method(takeIntegerValueFrom:))]
576        #[unsafe(method_family = none)]
577        pub unsafe fn takeIntegerValueFrom(&self, sender: Option<&AnyObject>);
578
579        #[cfg(feature = "NSImage")]
580        #[unsafe(method(image))]
581        #[unsafe(method_family = none)]
582        pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
583
584        #[cfg(feature = "NSImage")]
585        /// Setter for [`image`][Self::image].
586        #[unsafe(method(setImage:))]
587        #[unsafe(method_family = none)]
588        pub unsafe fn setImage(&self, image: Option<&NSImage>);
589
590        #[unsafe(method(controlSize))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn controlSize(&self) -> NSControlSize;
593
594        /// Setter for [`controlSize`][Self::controlSize].
595        #[unsafe(method(setControlSize:))]
596        #[unsafe(method_family = none)]
597        pub unsafe fn setControlSize(&self, control_size: NSControlSize);
598
599        #[unsafe(method(representedObject))]
600        #[unsafe(method_family = none)]
601        pub unsafe fn representedObject(&self) -> Option<Retained<AnyObject>>;
602
603        /// Setter for [`representedObject`][Self::representedObject].
604        #[unsafe(method(setRepresentedObject:))]
605        #[unsafe(method_family = none)]
606        pub unsafe fn setRepresentedObject(&self, represented_object: Option<&AnyObject>);
607
608        #[unsafe(method(cellAttribute:))]
609        #[unsafe(method_family = none)]
610        pub unsafe fn cellAttribute(&self, parameter: NSCellAttribute) -> NSInteger;
611
612        #[unsafe(method(setCellAttribute:to:))]
613        #[unsafe(method_family = none)]
614        pub unsafe fn setCellAttribute_to(&self, parameter: NSCellAttribute, value: NSInteger);
615
616        #[unsafe(method(imageRectForBounds:))]
617        #[unsafe(method_family = none)]
618        pub unsafe fn imageRectForBounds(&self, rect: NSRect) -> NSRect;
619
620        #[unsafe(method(titleRectForBounds:))]
621        #[unsafe(method_family = none)]
622        pub unsafe fn titleRectForBounds(&self, rect: NSRect) -> NSRect;
623
624        #[unsafe(method(drawingRectForBounds:))]
625        #[unsafe(method_family = none)]
626        pub unsafe fn drawingRectForBounds(&self, rect: NSRect) -> NSRect;
627
628        #[unsafe(method(cellSize))]
629        #[unsafe(method_family = none)]
630        pub unsafe fn cellSize(&self) -> NSSize;
631
632        #[unsafe(method(cellSizeForBounds:))]
633        #[unsafe(method_family = none)]
634        pub unsafe fn cellSizeForBounds(&self, rect: NSRect) -> NSSize;
635
636        #[cfg(all(feature = "NSColor", feature = "NSResponder", feature = "NSView"))]
637        #[unsafe(method(highlightColorWithFrame:inView:))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn highlightColorWithFrame_inView(
640            &self,
641            cell_frame: NSRect,
642            control_view: &NSView,
643        ) -> Option<Retained<NSColor>>;
644
645        #[unsafe(method(calcDrawInfo:))]
646        #[unsafe(method_family = none)]
647        pub unsafe fn calcDrawInfo(&self, rect: NSRect);
648
649        #[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
650        #[unsafe(method(setUpFieldEditorAttributes:))]
651        #[unsafe(method_family = none)]
652        pub unsafe fn setUpFieldEditorAttributes(&self, text_obj: &NSText) -> Retained<NSText>;
653
654        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
655        #[unsafe(method(drawInteriorWithFrame:inView:))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn drawInteriorWithFrame_inView(
658            &self,
659            cell_frame: NSRect,
660            control_view: &NSView,
661        );
662
663        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
664        #[unsafe(method(drawWithFrame:inView:))]
665        #[unsafe(method_family = none)]
666        pub unsafe fn drawWithFrame_inView(&self, cell_frame: NSRect, control_view: &NSView);
667
668        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
669        #[unsafe(method(highlight:withFrame:inView:))]
670        #[unsafe(method_family = none)]
671        pub unsafe fn highlight_withFrame_inView(
672            &self,
673            flag: bool,
674            cell_frame: NSRect,
675            control_view: &NSView,
676        );
677
678        #[unsafe(method(mouseDownFlags))]
679        #[unsafe(method_family = none)]
680        pub unsafe fn mouseDownFlags(&self) -> NSInteger;
681
682        #[unsafe(method(getPeriodicDelay:interval:))]
683        #[unsafe(method_family = none)]
684        pub unsafe fn getPeriodicDelay_interval(
685            &self,
686            delay: NonNull<c_float>,
687            interval: NonNull<c_float>,
688        );
689
690        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
691        #[unsafe(method(startTrackingAt:inView:))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn startTrackingAt_inView(
694            &self,
695            start_point: NSPoint,
696            control_view: &NSView,
697        ) -> bool;
698
699        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
700        #[unsafe(method(continueTracking:at:inView:))]
701        #[unsafe(method_family = none)]
702        pub unsafe fn continueTracking_at_inView(
703            &self,
704            last_point: NSPoint,
705            current_point: NSPoint,
706            control_view: &NSView,
707        ) -> bool;
708
709        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
710        #[unsafe(method(stopTracking:at:inView:mouseIsUp:))]
711        #[unsafe(method_family = none)]
712        pub unsafe fn stopTracking_at_inView_mouseIsUp(
713            &self,
714            last_point: NSPoint,
715            stop_point: NSPoint,
716            control_view: &NSView,
717            flag: bool,
718        );
719
720        #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
721        #[unsafe(method(trackMouse:inRect:ofView:untilMouseUp:))]
722        #[unsafe(method_family = none)]
723        pub unsafe fn trackMouse_inRect_ofView_untilMouseUp(
724            &self,
725            event: &NSEvent,
726            cell_frame: NSRect,
727            control_view: &NSView,
728            flag: bool,
729        ) -> bool;
730
731        #[cfg(all(
732            feature = "NSEvent",
733            feature = "NSResponder",
734            feature = "NSText",
735            feature = "NSView"
736        ))]
737        #[unsafe(method(editWithFrame:inView:editor:delegate:event:))]
738        #[unsafe(method_family = none)]
739        pub unsafe fn editWithFrame_inView_editor_delegate_event(
740            &self,
741            rect: NSRect,
742            control_view: &NSView,
743            text_obj: &NSText,
744            delegate: Option<&AnyObject>,
745            event: Option<&NSEvent>,
746        );
747
748        #[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
749        #[unsafe(method(selectWithFrame:inView:editor:delegate:start:length:))]
750        #[unsafe(method_family = none)]
751        pub unsafe fn selectWithFrame_inView_editor_delegate_start_length(
752            &self,
753            rect: NSRect,
754            control_view: &NSView,
755            text_obj: &NSText,
756            delegate: Option<&AnyObject>,
757            sel_start: NSInteger,
758            sel_length: NSInteger,
759        );
760
761        #[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
762        #[unsafe(method(endEditing:))]
763        #[unsafe(method_family = none)]
764        pub unsafe fn endEditing(&self, text_obj: &NSText);
765
766        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
767        #[unsafe(method(resetCursorRect:inView:))]
768        #[unsafe(method_family = none)]
769        pub unsafe fn resetCursorRect_inView(&self, cell_frame: NSRect, control_view: &NSView);
770
771        #[cfg(feature = "NSMenu")]
772        #[unsafe(method(menu))]
773        #[unsafe(method_family = none)]
774        pub unsafe fn menu(&self) -> Option<Retained<NSMenu>>;
775
776        #[cfg(feature = "NSMenu")]
777        /// Setter for [`menu`][Self::menu].
778        #[unsafe(method(setMenu:))]
779        #[unsafe(method_family = none)]
780        pub unsafe fn setMenu(&self, menu: Option<&NSMenu>);
781
782        #[cfg(all(
783            feature = "NSEvent",
784            feature = "NSMenu",
785            feature = "NSResponder",
786            feature = "NSView"
787        ))]
788        #[unsafe(method(menuForEvent:inRect:ofView:))]
789        #[unsafe(method_family = none)]
790        pub unsafe fn menuForEvent_inRect_ofView(
791            &self,
792            event: &NSEvent,
793            cell_frame: NSRect,
794            view: &NSView,
795        ) -> Option<Retained<NSMenu>>;
796
797        #[cfg(feature = "NSMenu")]
798        #[unsafe(method(defaultMenu))]
799        #[unsafe(method_family = none)]
800        pub unsafe fn defaultMenu(mtm: MainThreadMarker) -> Option<Retained<NSMenu>>;
801
802        #[unsafe(method(sendsActionOnEndEditing))]
803        #[unsafe(method_family = none)]
804        pub unsafe fn sendsActionOnEndEditing(&self) -> bool;
805
806        /// Setter for [`sendsActionOnEndEditing`][Self::sendsActionOnEndEditing].
807        #[unsafe(method(setSendsActionOnEndEditing:))]
808        #[unsafe(method_family = none)]
809        pub unsafe fn setSendsActionOnEndEditing(&self, sends_action_on_end_editing: bool);
810
811        #[cfg(feature = "NSText")]
812        #[unsafe(method(baseWritingDirection))]
813        #[unsafe(method_family = none)]
814        pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection;
815
816        #[cfg(feature = "NSText")]
817        /// Setter for [`baseWritingDirection`][Self::baseWritingDirection].
818        #[unsafe(method(setBaseWritingDirection:))]
819        #[unsafe(method_family = none)]
820        pub unsafe fn setBaseWritingDirection(&self, base_writing_direction: NSWritingDirection);
821
822        #[cfg(feature = "NSParagraphStyle")]
823        #[unsafe(method(lineBreakMode))]
824        #[unsafe(method_family = none)]
825        pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
826
827        #[cfg(feature = "NSParagraphStyle")]
828        /// Setter for [`lineBreakMode`][Self::lineBreakMode].
829        #[unsafe(method(setLineBreakMode:))]
830        #[unsafe(method_family = none)]
831        pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
832
833        #[unsafe(method(allowsUndo))]
834        #[unsafe(method_family = none)]
835        pub unsafe fn allowsUndo(&self) -> bool;
836
837        /// Setter for [`allowsUndo`][Self::allowsUndo].
838        #[unsafe(method(setAllowsUndo:))]
839        #[unsafe(method_family = none)]
840        pub unsafe fn setAllowsUndo(&self, allows_undo: bool);
841
842        #[unsafe(method(truncatesLastVisibleLine))]
843        #[unsafe(method_family = none)]
844        pub unsafe fn truncatesLastVisibleLine(&self) -> bool;
845
846        /// Setter for [`truncatesLastVisibleLine`][Self::truncatesLastVisibleLine].
847        #[unsafe(method(setTruncatesLastVisibleLine:))]
848        #[unsafe(method_family = none)]
849        pub unsafe fn setTruncatesLastVisibleLine(&self, truncates_last_visible_line: bool);
850
851        #[cfg(feature = "NSUserInterfaceLayout")]
852        #[unsafe(method(userInterfaceLayoutDirection))]
853        #[unsafe(method_family = none)]
854        pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
855
856        #[cfg(feature = "NSUserInterfaceLayout")]
857        /// Setter for [`userInterfaceLayoutDirection`][Self::userInterfaceLayoutDirection].
858        #[unsafe(method(setUserInterfaceLayoutDirection:))]
859        #[unsafe(method_family = none)]
860        pub unsafe fn setUserInterfaceLayoutDirection(
861            &self,
862            user_interface_layout_direction: NSUserInterfaceLayoutDirection,
863        );
864
865        #[cfg(all(
866            feature = "NSResponder",
867            feature = "NSText",
868            feature = "NSTextView",
869            feature = "NSView"
870        ))]
871        #[unsafe(method(fieldEditorForView:))]
872        #[unsafe(method_family = none)]
873        pub unsafe fn fieldEditorForView(
874            &self,
875            control_view: &NSView,
876        ) -> Option<Retained<NSTextView>>;
877
878        #[unsafe(method(usesSingleLineMode))]
879        #[unsafe(method_family = none)]
880        pub unsafe fn usesSingleLineMode(&self) -> bool;
881
882        /// Setter for [`usesSingleLineMode`][Self::usesSingleLineMode].
883        #[unsafe(method(setUsesSingleLineMode:))]
884        #[unsafe(method_family = none)]
885        pub unsafe fn setUsesSingleLineMode(&self, uses_single_line_mode: bool);
886
887        #[cfg(all(
888            feature = "NSDraggingItem",
889            feature = "NSResponder",
890            feature = "NSView"
891        ))]
892        #[unsafe(method(draggingImageComponentsWithFrame:inView:))]
893        #[unsafe(method_family = none)]
894        pub unsafe fn draggingImageComponentsWithFrame_inView(
895            &self,
896            frame: NSRect,
897            view: &NSView,
898        ) -> Retained<NSArray<NSDraggingImageComponent>>;
899    );
900}
901
902/// Methods declared on superclass `NSObject`.
903impl NSCell {
904    extern_methods!(
905        #[unsafe(method(new))]
906        #[unsafe(method_family = new)]
907        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
908    );
909}
910
911/// NSKeyboardUI.
912impl NSCell {
913    extern_methods!(
914        #[unsafe(method(refusesFirstResponder))]
915        #[unsafe(method_family = none)]
916        pub unsafe fn refusesFirstResponder(&self) -> bool;
917
918        /// Setter for [`refusesFirstResponder`][Self::refusesFirstResponder].
919        #[unsafe(method(setRefusesFirstResponder:))]
920        #[unsafe(method_family = none)]
921        pub unsafe fn setRefusesFirstResponder(&self, refuses_first_responder: bool);
922
923        #[unsafe(method(acceptsFirstResponder))]
924        #[unsafe(method_family = none)]
925        pub unsafe fn acceptsFirstResponder(&self) -> bool;
926
927        #[unsafe(method(showsFirstResponder))]
928        #[unsafe(method_family = none)]
929        pub unsafe fn showsFirstResponder(&self) -> bool;
930
931        /// Setter for [`showsFirstResponder`][Self::showsFirstResponder].
932        #[unsafe(method(setShowsFirstResponder:))]
933        #[unsafe(method_family = none)]
934        pub unsafe fn setShowsFirstResponder(&self, shows_first_responder: bool);
935
936        #[unsafe(method(performClick:))]
937        #[unsafe(method_family = none)]
938        pub unsafe fn performClick(&self, sender: Option<&AnyObject>);
939
940        #[cfg(feature = "NSGraphics")]
941        #[unsafe(method(focusRingType))]
942        #[unsafe(method_family = none)]
943        pub unsafe fn focusRingType(&self) -> NSFocusRingType;
944
945        #[cfg(feature = "NSGraphics")]
946        /// Setter for [`focusRingType`][Self::focusRingType].
947        #[unsafe(method(setFocusRingType:))]
948        #[unsafe(method_family = none)]
949        pub unsafe fn setFocusRingType(&self, focus_ring_type: NSFocusRingType);
950
951        #[cfg(feature = "NSGraphics")]
952        #[unsafe(method(defaultFocusRingType))]
953        #[unsafe(method_family = none)]
954        pub unsafe fn defaultFocusRingType(mtm: MainThreadMarker) -> NSFocusRingType;
955
956        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
957        #[unsafe(method(drawFocusRingMaskWithFrame:inView:))]
958        #[unsafe(method_family = none)]
959        pub unsafe fn drawFocusRingMaskWithFrame_inView(
960            &self,
961            cell_frame: NSRect,
962            control_view: &NSView,
963        );
964
965        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
966        #[unsafe(method(focusRingMaskBoundsForFrame:inView:))]
967        #[unsafe(method_family = none)]
968        pub unsafe fn focusRingMaskBoundsForFrame_inView(
969            &self,
970            cell_frame: NSRect,
971            control_view: &NSView,
972        ) -> NSRect;
973
974        #[unsafe(method(wantsNotificationForMarkedText))]
975        #[unsafe(method_family = none)]
976        pub unsafe fn wantsNotificationForMarkedText(&self) -> bool;
977    );
978}
979
980/// NSCellAttributedStringMethods.
981impl NSCell {
982    extern_methods!(
983        #[unsafe(method(attributedStringValue))]
984        #[unsafe(method_family = none)]
985        pub unsafe fn attributedStringValue(&self) -> Retained<NSAttributedString>;
986
987        /// Setter for [`attributedStringValue`][Self::attributedStringValue].
988        #[unsafe(method(setAttributedStringValue:))]
989        #[unsafe(method_family = none)]
990        pub unsafe fn setAttributedStringValue(&self, attributed_string_value: &NSAttributedString);
991
992        #[unsafe(method(allowsEditingTextAttributes))]
993        #[unsafe(method_family = none)]
994        pub unsafe fn allowsEditingTextAttributes(&self) -> bool;
995
996        /// Setter for [`allowsEditingTextAttributes`][Self::allowsEditingTextAttributes].
997        #[unsafe(method(setAllowsEditingTextAttributes:))]
998        #[unsafe(method_family = none)]
999        pub unsafe fn setAllowsEditingTextAttributes(&self, allows_editing_text_attributes: bool);
1000
1001        #[unsafe(method(importsGraphics))]
1002        #[unsafe(method_family = none)]
1003        pub unsafe fn importsGraphics(&self) -> bool;
1004
1005        /// Setter for [`importsGraphics`][Self::importsGraphics].
1006        #[unsafe(method(setImportsGraphics:))]
1007        #[unsafe(method_family = none)]
1008        pub unsafe fn setImportsGraphics(&self, imports_graphics: bool);
1009    );
1010}
1011
1012/// NSCellMixedState.
1013impl NSCell {
1014    extern_methods!(
1015        #[unsafe(method(allowsMixedState))]
1016        #[unsafe(method_family = none)]
1017        pub unsafe fn allowsMixedState(&self) -> bool;
1018
1019        /// Setter for [`allowsMixedState`][Self::allowsMixedState].
1020        #[unsafe(method(setAllowsMixedState:))]
1021        #[unsafe(method_family = none)]
1022        pub unsafe fn setAllowsMixedState(&self, allows_mixed_state: bool);
1023
1024        #[unsafe(method(nextState))]
1025        #[unsafe(method_family = none)]
1026        pub unsafe fn nextState(&self) -> NSInteger;
1027
1028        #[unsafe(method(setNextState))]
1029        #[unsafe(method_family = none)]
1030        pub unsafe fn setNextState(&self);
1031    );
1032}
1033
1034/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscellhitresult?language=objc)
1035// NS_OPTIONS
1036#[repr(transparent)]
1037#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1038pub struct NSCellHitResult(pub NSUInteger);
1039bitflags::bitflags! {
1040    impl NSCellHitResult: NSUInteger {
1041        #[doc(alias = "NSCellHitNone")]
1042        const None = 0;
1043        #[doc(alias = "NSCellHitContentArea")]
1044        const ContentArea = 1<<0;
1045        #[doc(alias = "NSCellHitEditableTextArea")]
1046        const EditableTextArea = 1<<1;
1047        #[doc(alias = "NSCellHitTrackableArea")]
1048        const TrackableArea = 1<<2;
1049    }
1050}
1051
1052unsafe impl Encode for NSCellHitResult {
1053    const ENCODING: Encoding = NSUInteger::ENCODING;
1054}
1055
1056unsafe impl RefEncode for NSCellHitResult {
1057    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1058}
1059
1060/// NSCellHitTest.
1061impl NSCell {
1062    extern_methods!(
1063        #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
1064        #[unsafe(method(hitTestForEvent:inRect:ofView:))]
1065        #[unsafe(method_family = none)]
1066        pub unsafe fn hitTestForEvent_inRect_ofView(
1067            &self,
1068            event: &NSEvent,
1069            cell_frame: NSRect,
1070            control_view: &NSView,
1071        ) -> NSCellHitResult;
1072    );
1073}
1074
1075/// NSCellExpansion.
1076impl NSCell {
1077    extern_methods!(
1078        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1079        #[unsafe(method(expansionFrameWithFrame:inView:))]
1080        #[unsafe(method_family = none)]
1081        pub unsafe fn expansionFrameWithFrame_inView(
1082            &self,
1083            cell_frame: NSRect,
1084            view: &NSView,
1085        ) -> NSRect;
1086
1087        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1088        #[unsafe(method(drawWithExpansionFrame:inView:))]
1089        #[unsafe(method_family = none)]
1090        pub unsafe fn drawWithExpansionFrame_inView(&self, cell_frame: NSRect, view: &NSView);
1091    );
1092}
1093
1094/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundstyle?language=objc)
1095// NS_ENUM
1096#[repr(transparent)]
1097#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1098pub struct NSBackgroundStyle(pub NSInteger);
1099impl NSBackgroundStyle {
1100    #[doc(alias = "NSBackgroundStyleNormal")]
1101    pub const Normal: Self = Self(0);
1102    #[doc(alias = "NSBackgroundStyleEmphasized")]
1103    pub const Emphasized: Self = Self(1);
1104    #[doc(alias = "NSBackgroundStyleRaised")]
1105    pub const Raised: Self = Self(2);
1106    #[doc(alias = "NSBackgroundStyleLowered")]
1107    pub const Lowered: Self = Self(3);
1108}
1109
1110unsafe impl Encode for NSBackgroundStyle {
1111    const ENCODING: Encoding = NSInteger::ENCODING;
1112}
1113
1114unsafe impl RefEncode for NSBackgroundStyle {
1115    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1116}
1117
1118/// NSCellBackgroundStyle.
1119impl NSCell {
1120    extern_methods!(
1121        #[unsafe(method(backgroundStyle))]
1122        #[unsafe(method_family = none)]
1123        pub unsafe fn backgroundStyle(&self) -> NSBackgroundStyle;
1124
1125        /// Setter for [`backgroundStyle`][Self::backgroundStyle].
1126        #[unsafe(method(setBackgroundStyle:))]
1127        #[unsafe(method_family = none)]
1128        pub unsafe fn setBackgroundStyle(&self, background_style: NSBackgroundStyle);
1129
1130        #[unsafe(method(interiorBackgroundStyle))]
1131        #[unsafe(method_family = none)]
1132        pub unsafe fn interiorBackgroundStyle(&self) -> NSBackgroundStyle;
1133    );
1134}
1135
1136#[cfg(all(
1137    feature = "NSGraphics",
1138    feature = "NSImage",
1139    feature = "objc2-core-foundation"
1140))]
1141#[inline]
1142pub unsafe extern "C-unwind" fn NSDrawThreePartImage(
1143    frame: NSRect,
1144    start_cap: Option<&NSImage>,
1145    center_fill: Option<&NSImage>,
1146    end_cap: Option<&NSImage>,
1147    vertical: bool,
1148    op: NSCompositingOperation,
1149    alpha_fraction: CGFloat,
1150    flipped: bool,
1151) {
1152    extern "C-unwind" {
1153        fn NSDrawThreePartImage(
1154            frame: NSRect,
1155            start_cap: Option<&NSImage>,
1156            center_fill: Option<&NSImage>,
1157            end_cap: Option<&NSImage>,
1158            vertical: Bool,
1159            op: NSCompositingOperation,
1160            alpha_fraction: CGFloat,
1161            flipped: Bool,
1162        );
1163    }
1164    unsafe {
1165        NSDrawThreePartImage(
1166            frame,
1167            start_cap,
1168            center_fill,
1169            end_cap,
1170            Bool::new(vertical),
1171            op,
1172            alpha_fraction,
1173            Bool::new(flipped),
1174        )
1175    }
1176}
1177
1178#[cfg(all(
1179    feature = "NSGraphics",
1180    feature = "NSImage",
1181    feature = "objc2-core-foundation"
1182))]
1183#[inline]
1184pub unsafe extern "C-unwind" fn NSDrawNinePartImage(
1185    frame: NSRect,
1186    top_left_corner: Option<&NSImage>,
1187    top_edge_fill: Option<&NSImage>,
1188    top_right_corner: Option<&NSImage>,
1189    left_edge_fill: Option<&NSImage>,
1190    center_fill: Option<&NSImage>,
1191    right_edge_fill: Option<&NSImage>,
1192    bottom_left_corner: Option<&NSImage>,
1193    bottom_edge_fill: Option<&NSImage>,
1194    bottom_right_corner: Option<&NSImage>,
1195    op: NSCompositingOperation,
1196    alpha_fraction: CGFloat,
1197    flipped: bool,
1198) {
1199    extern "C-unwind" {
1200        fn NSDrawNinePartImage(
1201            frame: NSRect,
1202            top_left_corner: Option<&NSImage>,
1203            top_edge_fill: Option<&NSImage>,
1204            top_right_corner: Option<&NSImage>,
1205            left_edge_fill: Option<&NSImage>,
1206            center_fill: Option<&NSImage>,
1207            right_edge_fill: Option<&NSImage>,
1208            bottom_left_corner: Option<&NSImage>,
1209            bottom_edge_fill: Option<&NSImage>,
1210            bottom_right_corner: Option<&NSImage>,
1211            op: NSCompositingOperation,
1212            alpha_fraction: CGFloat,
1213            flipped: Bool,
1214        );
1215    }
1216    unsafe {
1217        NSDrawNinePartImage(
1218            frame,
1219            top_left_corner,
1220            top_edge_fill,
1221            top_right_corner,
1222            left_edge_fill,
1223            center_fill,
1224            right_edge_fill,
1225            bottom_left_corner,
1226            bottom_edge_fill,
1227            bottom_right_corner,
1228            op,
1229            alpha_fraction,
1230            Bool::new(flipped),
1231        )
1232    }
1233}
1234
1235/// NSDeprecated.
1236impl NSCell {
1237    extern_methods!(
1238        #[deprecated = "The controlTint property is not respected on 10.14 and later. For custom cells, use +[NSColor controlAccentColor] to respect the user's preferred accent color when drawing."]
1239        #[unsafe(method(controlTint))]
1240        #[unsafe(method_family = none)]
1241        pub unsafe fn controlTint(&self) -> NSControlTint;
1242
1243        /// Setter for [`controlTint`][Self::controlTint].
1244        #[deprecated = "The controlTint property is not respected on 10.14 and later. For custom cells, use +[NSColor controlAccentColor] to respect the user's preferred accent color when drawing."]
1245        #[unsafe(method(setControlTint:))]
1246        #[unsafe(method_family = none)]
1247        pub unsafe fn setControlTint(&self, control_tint: NSControlTint);
1248
1249        #[deprecated]
1250        #[unsafe(method(entryType))]
1251        #[unsafe(method_family = none)]
1252        pub unsafe fn entryType(&self) -> NSInteger;
1253
1254        #[deprecated]
1255        #[unsafe(method(setEntryType:))]
1256        #[unsafe(method_family = none)]
1257        pub unsafe fn setEntryType(&self, r#type: NSInteger);
1258
1259        #[deprecated]
1260        #[unsafe(method(isEntryAcceptable:))]
1261        #[unsafe(method_family = none)]
1262        pub unsafe fn isEntryAcceptable(&self, string: &NSString) -> bool;
1263
1264        #[deprecated]
1265        #[unsafe(method(setFloatingPointFormat:left:right:))]
1266        #[unsafe(method_family = none)]
1267        pub unsafe fn setFloatingPointFormat_left_right(
1268            &self,
1269            auto_range: bool,
1270            left_digits: NSUInteger,
1271            right_digits: NSUInteger,
1272        );
1273
1274        #[deprecated]
1275        #[unsafe(method(setMnemonicLocation:))]
1276        #[unsafe(method_family = none)]
1277        pub unsafe fn setMnemonicLocation(&self, location: NSUInteger);
1278
1279        #[deprecated]
1280        #[unsafe(method(mnemonicLocation))]
1281        #[unsafe(method_family = none)]
1282        pub unsafe fn mnemonicLocation(&self) -> NSUInteger;
1283
1284        #[deprecated]
1285        #[unsafe(method(mnemonic))]
1286        #[unsafe(method_family = none)]
1287        pub unsafe fn mnemonic(&self) -> Retained<NSString>;
1288
1289        #[deprecated]
1290        #[unsafe(method(setTitleWithMnemonic:))]
1291        #[unsafe(method_family = none)]
1292        pub unsafe fn setTitleWithMnemonic(&self, string_with_ampersand: &NSString);
1293    );
1294}
1295
1296/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundstylelight?language=objc)
1297pub static NSBackgroundStyleLight: NSBackgroundStyle =
1298    NSBackgroundStyle(NSBackgroundStyle::Normal.0);
1299
1300/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundstyledark?language=objc)
1301pub static NSBackgroundStyleDark: NSBackgroundStyle =
1302    NSBackgroundStyle(NSBackgroundStyle::Emphasized.0);
1303
1304/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscellstatevalue?language=objc)
1305pub type NSCellStateValue = NSControlStateValue;
1306
1307/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmixedstate?language=objc)
1308pub static NSMixedState: NSControlStateValue = NSControlStateValueMixed;
1309
1310/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoffstate?language=objc)
1311pub static NSOffState: NSControlStateValue = NSControlStateValueOff;
1312
1313/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsonstate?language=objc)
1314pub static NSOnState: NSControlStateValue = NSControlStateValueOn;
1315
1316/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsregularcontrolsize?language=objc)
1317pub static NSRegularControlSize: NSControlSize = NSControlSize(NSControlSize::Regular.0);
1318
1319/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssmallcontrolsize?language=objc)
1320pub static NSSmallControlSize: NSControlSize = NSControlSize(NSControlSize::Small.0);
1321
1322/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsminicontrolsize?language=objc)
1323pub static NSMiniControlSize: NSControlSize = NSControlSize(NSControlSize::Mini.0);
1324
1325extern "C" {
1326    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontroltintdidchangenotification?language=objc)
1327    pub static NSControlTintDidChangeNotification: &'static NSNotificationName;
1328}
1329
1330/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsanytype?language=objc)
1331#[deprecated = "Use formatters instead"]
1332pub const NSAnyType: c_uint = 0;
1333/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinttype?language=objc)
1334#[deprecated = "Use formatters instead"]
1335pub const NSIntType: c_uint = 1;
1336/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspositiveinttype?language=objc)
1337#[deprecated = "Use formatters instead"]
1338pub const NSPositiveIntType: c_uint = 2;
1339/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfloattype?language=objc)
1340#[deprecated = "Use formatters instead"]
1341pub const NSFloatType: c_uint = 3;
1342/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspositivefloattype?language=objc)
1343#[deprecated = "Use formatters instead"]
1344pub const NSPositiveFloatType: c_uint = 4;
1345/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdoubletype?language=objc)
1346#[deprecated = "Use formatters instead"]
1347pub const NSDoubleType: c_uint = 6;
1348/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspositivedoubletype?language=objc)
1349#[deprecated = "Use formatters instead"]
1350pub const NSPositiveDoubleType: c_uint = 7;