objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

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

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibility for NSDatePicker {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for NSDatePicker {}
);

#[cfg(all(
    feature = "NSAnimation",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for NSDatePicker {}
);

#[cfg(all(
    feature = "NSAppearance",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAppearanceCustomization for NSDatePicker {}
);

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSCoding for NSDatePicker {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSDragging",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSDraggingDestination for NSDatePicker {}
);

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSDatePicker {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for NSDatePicker {}
);

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSDatePicker {
    extern_methods!(
        #[cfg(feature = "NSDatePickerCell")]
        #[unsafe(method(datePickerStyle))]
        #[unsafe(method_family = none)]
        pub fn datePickerStyle(&self) -> NSDatePickerStyle;

        #[cfg(feature = "NSDatePickerCell")]
        /// Setter for [`datePickerStyle`][Self::datePickerStyle].
        #[unsafe(method(setDatePickerStyle:))]
        #[unsafe(method_family = none)]
        pub fn setDatePickerStyle(&self, date_picker_style: NSDatePickerStyle);

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "NSColor")]
        /// Setter for [`textColor`][Self::textColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTextColor:))]
        #[unsafe(method_family = none)]
        pub fn setTextColor(&self, text_color: &NSColor);

        #[cfg(feature = "NSDatePickerCell")]
        #[unsafe(method(datePickerMode))]
        #[unsafe(method_family = none)]
        pub fn datePickerMode(&self) -> NSDatePickerMode;

        #[cfg(feature = "NSDatePickerCell")]
        /// Setter for [`datePickerMode`][Self::datePickerMode].
        #[unsafe(method(setDatePickerMode:))]
        #[unsafe(method_family = none)]
        pub fn setDatePickerMode(&self, date_picker_mode: NSDatePickerMode);

        #[cfg(feature = "NSDatePickerCell")]
        #[unsafe(method(datePickerElements))]
        #[unsafe(method_family = none)]
        pub fn datePickerElements(&self) -> NSDatePickerElementFlags;

        #[cfg(feature = "NSDatePickerCell")]
        /// Setter for [`datePickerElements`][Self::datePickerElements].
        #[unsafe(method(setDatePickerElements:))]
        #[unsafe(method_family = none)]
        pub fn setDatePickerElements(&self, date_picker_elements: NSDatePickerElementFlags);

        #[unsafe(method(calendar))]
        #[unsafe(method_family = none)]
        pub fn calendar(&self) -> Option<Retained<NSCalendar>>;

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

        #[unsafe(method(locale))]
        #[unsafe(method_family = none)]
        pub fn locale(&self) -> Option<Retained<NSLocale>>;

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

        #[unsafe(method(timeZone))]
        #[unsafe(method_family = none)]
        pub fn timeZone(&self) -> Option<Retained<NSTimeZone>>;

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

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

        /// Setter for [`dateValue`][Self::dateValue].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDateValue:))]
        #[unsafe(method_family = none)]
        pub fn setDateValue(&self, date_value: &NSDate);

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

        /// Setter for [`timeInterval`][Self::timeInterval].
        #[unsafe(method(setTimeInterval:))]
        #[unsafe(method_family = none)]
        pub fn setTimeInterval(&self, time_interval: NSTimeInterval);

        #[unsafe(method(minDate))]
        #[unsafe(method_family = none)]
        pub fn minDate(&self) -> Option<Retained<NSDate>>;

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

        #[unsafe(method(maxDate))]
        #[unsafe(method_family = none)]
        pub fn maxDate(&self) -> Option<Retained<NSDate>>;

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

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

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

        #[cfg(feature = "NSDatePickerCell")]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSDatePickerCellDelegate>>>;

        #[cfg(feature = "NSDatePickerCell")]
        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSDatePickerCellDelegate>>);
    );
}

/// Methods declared on superclass `NSControl`.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSDatePicker {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

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

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

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