//! 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_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorpickingdefault?language=objc)
    pub unsafe trait NSColorPickingDefault: MainThreadOnly {
        #[cfg(all(
            feature = "NSColorPanel",
            feature = "NSPanel",
            feature = "NSResponder",
            feature = "NSWindow"
        ))]
        #[unsafe(method(initWithPickerMask:colorPanel:))]
        #[unsafe(method_family = init)]
        fn initWithPickerMask_colorPanel(
            this: Allocated<Self>,
            mask: NSUInteger,
            owning_color_panel: &NSColorPanel,
        ) -> Option<Retained<Self>>;

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

        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSButtonCell",
            feature = "NSCell",
            feature = "NSImage"
        ))]
        #[unsafe(method(insertNewButtonImage:in:))]
        #[unsafe(method_family = none)]
        fn insertNewButtonImage_in(&self, new_button_image: &NSImage, button_cell: &NSButtonCell);

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

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

        #[cfg(feature = "NSColorList")]
        #[unsafe(method(attachColorList:))]
        #[unsafe(method_family = none)]
        fn attachColorList(&self, color_list: &NSColorList);

        #[cfg(feature = "NSColorList")]
        #[unsafe(method(detachColorList:))]
        #[unsafe(method_family = none)]
        fn detachColorList(&self, color_list: &NSColorList);

        #[cfg(feature = "NSColorPanel")]
        #[unsafe(method(setMode:))]
        #[unsafe(method_family = none)]
        fn setMode(&self, mode: NSColorPanelMode);

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

        #[unsafe(method(minContentSize))]
        #[unsafe(method_family = none)]
        fn minContentSize(&self) -> NSSize;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorpickingcustom?language=objc)
    pub unsafe trait NSColorPickingCustom: NSColorPickingDefault + MainThreadOnly {
        #[cfg(feature = "NSColorPanel")]
        #[unsafe(method(supportsMode:))]
        #[unsafe(method_family = none)]
        fn supportsMode(&self, mode: NSColorPanelMode) -> bool;

        #[cfg(feature = "NSColorPanel")]
        #[unsafe(method(currentMode))]
        #[unsafe(method_family = none)]
        fn currentMode(&self) -> NSColorPanelMode;

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(provideNewView:))]
        #[unsafe(method_family = none)]
        fn provideNewView(&self, initial_request: bool) -> Retained<NSView>;

        #[cfg(feature = "NSColor")]
        #[unsafe(method(setColor:))]
        #[unsafe(method_family = none)]
        fn setColor(&self, new_color: &NSColor);
    }
);
