//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorlistname?language=objc)
pub type NSColorListName = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorname?language=objc)
pub type NSColorName = NSString;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorlist?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSColorList;
);

unsafe impl NSCoding for NSColorList {}

unsafe impl NSObjectProtocol for NSColorList {}

unsafe impl NSSecureCoding for NSColorList {}

impl NSColorList {
    extern_methods!(
        #[unsafe(method(availableColorLists))]
        #[unsafe(method_family = none)]
        pub unsafe fn availableColorLists() -> Retained<NSArray<NSColorList>>;

        #[unsafe(method(colorListNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorListNamed(name: &NSColorListName) -> Option<Retained<NSColorList>>;

        #[unsafe(method(initWithName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithName(this: Allocated<Self>, name: &NSColorListName)
            -> Retained<Self>;

        #[unsafe(method(initWithName:fromFile:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithName_fromFile(
            this: Allocated<Self>,
            name: &NSColorListName,
            path: Option<&NSString>,
        ) -> Option<Retained<Self>>;

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

        #[cfg(feature = "NSColor")]
        #[unsafe(method(setColor:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setColor_forKey(&self, color: &NSColor, key: &NSColorName);

        #[cfg(feature = "NSColor")]
        #[unsafe(method(insertColor:key:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertColor_key_atIndex(
            &self,
            color: &NSColor,
            key: &NSColorName,
            loc: NSUInteger,
        );

        #[unsafe(method(removeColorWithKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeColorWithKey(&self, key: &NSColorName);

        #[cfg(feature = "NSColor")]
        #[unsafe(method(colorWithKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithKey(&self, key: &NSColorName) -> Option<Retained<NSColor>>;

        #[unsafe(method(allKeys))]
        #[unsafe(method_family = none)]
        pub unsafe fn allKeys(&self) -> Retained<NSArray<NSColorName>>;

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

        #[unsafe(method(writeToURL:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn writeToURL_error(&self, url: Option<&NSURL>)
            -> Result<(), Retained<NSError>>;

        #[deprecated = "Use -writeToURL:error: instead"]
        #[unsafe(method(writeToFile:))]
        #[unsafe(method_family = none)]
        pub unsafe fn writeToFile(&self, path: Option<&NSString>) -> bool;

        #[unsafe(method(removeFile))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeFile(&self);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSColorList {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorlistdidchangenotification?language=objc)
    pub static NSColorListDidChangeNotification: &'static NSNotificationName;
}
