//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSDatePickerStyle {
        NSDatePickerStyleTextFieldAndStepper = 0,
        NSDatePickerStyleClockAndCalendar = 1,
        NSDatePickerStyleTextField = 2,
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSDatePickerMode {
        NSDatePickerModeSingle = 0,
        NSDatePickerModeRange = 1,
    }
);

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSDatePickerElementFlags {
        NSDatePickerElementFlagHourMinute = 0x000c,
        NSDatePickerElementFlagHourMinuteSecond = 0x000e,
        NSDatePickerElementFlagTimeZone = 0x0010,
        NSDatePickerElementFlagYearMonth = 0x00c0,
        NSDatePickerElementFlagYearMonthDay = 0x00e0,
        NSDatePickerElementFlagEra = 0x0100,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AppKit_NSDatePickerCell")]
    pub struct NSDatePickerCell;

    #[cfg(feature = "AppKit_NSDatePickerCell")]
    unsafe impl ClassType for NSDatePickerCell {
        #[inherits(NSCell, NSObject)]
        type Super = NSActionCell;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "AppKit_NSDatePickerCell")]
unsafe impl NSAccessibility for NSDatePickerCell {}

#[cfg(feature = "AppKit_NSDatePickerCell")]
unsafe impl NSAccessibilityElementProtocol for NSDatePickerCell {}

#[cfg(feature = "AppKit_NSDatePickerCell")]
unsafe impl NSCoding for NSDatePickerCell {}

#[cfg(feature = "AppKit_NSDatePickerCell")]
unsafe impl NSCopying for NSDatePickerCell {}

#[cfg(feature = "AppKit_NSDatePickerCell")]
unsafe impl NSObjectProtocol for NSDatePickerCell {}

#[cfg(feature = "AppKit_NSDatePickerCell")]
unsafe impl NSUserInterfaceItemIdentification for NSDatePickerCell {}

extern_methods!(
    #[cfg(feature = "AppKit_NSDatePickerCell")]
    unsafe impl NSDatePickerCell {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initTextCell:)]
        pub unsafe fn initTextCell(this: Option<Allocated<Self>>, string: &NSString) -> Id<Self>;

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Option<Allocated<Self>>, coder: &NSCoder) -> Id<Self>;

        #[cfg(feature = "AppKit_NSImage")]
        #[method_id(@__retain_semantics Init initImageCell:)]
        pub unsafe fn initImageCell(
            this: Option<Allocated<Self>>,
            image: Option<&NSImage>,
        ) -> Id<Self>;

        #[method(datePickerStyle)]
        pub unsafe fn datePickerStyle(&self) -> NSDatePickerStyle;

        #[method(setDatePickerStyle:)]
        pub unsafe fn setDatePickerStyle(&self, date_picker_style: NSDatePickerStyle);

        #[method(drawsBackground)]
        pub unsafe fn drawsBackground(&self) -> bool;

        #[method(setDrawsBackground:)]
        pub unsafe fn setDrawsBackground(&self, draws_background: bool);

        #[cfg(feature = "AppKit_NSColor")]
        #[method_id(@__retain_semantics Other backgroundColor)]
        pub unsafe fn backgroundColor(&self) -> Id<NSColor>;

        #[cfg(feature = "AppKit_NSColor")]
        #[method(setBackgroundColor:)]
        pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);

        #[cfg(feature = "AppKit_NSColor")]
        #[method_id(@__retain_semantics Other textColor)]
        pub unsafe fn textColor(&self) -> Id<NSColor>;

        #[cfg(feature = "AppKit_NSColor")]
        #[method(setTextColor:)]
        pub unsafe fn setTextColor(&self, text_color: &NSColor);

        #[method(datePickerMode)]
        pub unsafe fn datePickerMode(&self) -> NSDatePickerMode;

        #[method(setDatePickerMode:)]
        pub unsafe fn setDatePickerMode(&self, date_picker_mode: NSDatePickerMode);

        #[method(datePickerElements)]
        pub unsafe fn datePickerElements(&self) -> NSDatePickerElementFlags;

        #[method(setDatePickerElements:)]
        pub unsafe fn setDatePickerElements(&self, date_picker_elements: NSDatePickerElementFlags);

        #[cfg(feature = "Foundation_NSCalendar")]
        #[method_id(@__retain_semantics Other calendar)]
        pub unsafe fn calendar(&self) -> Option<Id<NSCalendar>>;

        #[cfg(feature = "Foundation_NSCalendar")]
        #[method(setCalendar:)]
        pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>);

        #[cfg(feature = "Foundation_NSLocale")]
        #[method_id(@__retain_semantics Other locale)]
        pub unsafe fn locale(&self) -> Option<Id<NSLocale>>;

        #[cfg(feature = "Foundation_NSLocale")]
        #[method(setLocale:)]
        pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);

        #[cfg(feature = "Foundation_NSTimeZone")]
        #[method_id(@__retain_semantics Other timeZone)]
        pub unsafe fn timeZone(&self) -> Option<Id<NSTimeZone>>;

        #[cfg(feature = "Foundation_NSTimeZone")]
        #[method(setTimeZone:)]
        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);

        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other dateValue)]
        pub unsafe fn dateValue(&self) -> Id<NSDate>;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(setDateValue:)]
        pub unsafe fn setDateValue(&self, date_value: &NSDate);

        #[method(timeInterval)]
        pub unsafe fn timeInterval(&self) -> NSTimeInterval;

        #[method(setTimeInterval:)]
        pub unsafe fn setTimeInterval(&self, time_interval: NSTimeInterval);

        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other minDate)]
        pub unsafe fn minDate(&self) -> Option<Id<NSDate>>;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(setMinDate:)]
        pub unsafe fn setMinDate(&self, min_date: Option<&NSDate>);

        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other maxDate)]
        pub unsafe fn maxDate(&self) -> Option<Id<NSDate>>;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(setMaxDate:)]
        pub unsafe fn setMaxDate(&self, max_date: Option<&NSDate>);

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(&self) -> Option<Id<ProtocolObject<dyn NSDatePickerCellDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn NSDatePickerCellDelegate>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSCell`
    #[cfg(feature = "AppKit_NSDatePickerCell")]
    unsafe impl NSDatePickerCell {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "AppKit_NSDatePickerCell")]
    unsafe impl NSDatePickerCell {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_protocol!(
    pub unsafe trait NSDatePickerCellDelegate: NSObjectProtocol {
        #[cfg(all(feature = "AppKit_NSDatePickerCell", feature = "Foundation_NSDate"))]
        #[optional]
        #[method(datePickerCell:validateProposedDateValue:timeInterval:)]
        unsafe fn datePickerCell_validateProposedDateValue_timeInterval(
            &self,
            date_picker_cell: &NSDatePickerCell,
            proposed_date_value: &mut Id<NSDate>,
            proposed_time_interval: *mut NSTimeInterval,
        );
    }

    unsafe impl ProtocolType for dyn NSDatePickerCellDelegate {}
);

extern_static!(
    NSTextFieldAndStepperDatePickerStyle: NSDatePickerStyle = NSDatePickerStyleTextFieldAndStepper
);

extern_static!(
    NSClockAndCalendarDatePickerStyle: NSDatePickerStyle = NSDatePickerStyleClockAndCalendar
);

extern_static!(NSTextFieldDatePickerStyle: NSDatePickerStyle = NSDatePickerStyleTextField);

extern_static!(NSSingleDateMode: NSDatePickerMode = NSDatePickerModeSingle);

extern_static!(NSRangeDateMode: NSDatePickerMode = NSDatePickerModeRange);

extern_static!(
    NSHourMinuteDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagHourMinute
);

extern_static!(
    NSHourMinuteSecondDatePickerElementFlag: NSDatePickerElementFlags =
        NSDatePickerElementFlagHourMinuteSecond
);

extern_static!(
    NSTimeZoneDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagTimeZone
);

extern_static!(
    NSYearMonthDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagYearMonth
);

extern_static!(
    NSYearMonthDayDatePickerElementFlag: NSDatePickerElementFlags =
        NSDatePickerElementFlagYearMonthDay
);

extern_static!(NSEraDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagEra);
