use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type NSColorListName = NSString;
pub type NSColorName = NSString;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSColorList;
unsafe impl ClassType for NSColorList {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSColorList {}
unsafe impl NSObjectProtocol for NSColorList {}
unsafe impl NSSecureCoding for NSColorList {}
extern_methods!(
unsafe impl NSColorList {
#[method_id(@__retain_semantics Other availableColorLists)]
pub unsafe fn availableColorLists() -> Retained<NSArray<NSColorList>>;
#[method_id(@__retain_semantics Other colorListNamed:)]
pub unsafe fn colorListNamed(name: &NSColorListName) -> Option<Retained<NSColorList>>;
#[method_id(@__retain_semantics Init initWithName:)]
pub unsafe fn initWithName(this: Allocated<Self>, name: &NSColorListName)
-> Retained<Self>;
#[method_id(@__retain_semantics Init initWithName:fromFile:)]
pub unsafe fn initWithName_fromFile(
this: Allocated<Self>,
name: &NSColorListName,
path: Option<&NSString>,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Option<Retained<NSColorListName>>;
#[cfg(feature = "NSColor")]
#[method(setColor:forKey:)]
pub unsafe fn setColor_forKey(&self, color: &NSColor, key: &NSColorName);
#[cfg(feature = "NSColor")]
#[method(insertColor:key:atIndex:)]
pub unsafe fn insertColor_key_atIndex(
&self,
color: &NSColor,
key: &NSColorName,
loc: NSUInteger,
);
#[method(removeColorWithKey:)]
pub unsafe fn removeColorWithKey(&self, key: &NSColorName);
#[cfg(feature = "NSColor")]
#[method_id(@__retain_semantics Other colorWithKey:)]
pub unsafe fn colorWithKey(&self, key: &NSColorName) -> Option<Retained<NSColor>>;
#[method_id(@__retain_semantics Other allKeys)]
pub unsafe fn allKeys(&self) -> Retained<NSArray<NSColorName>>;
#[method(isEditable)]
pub unsafe fn isEditable(&self) -> bool;
#[method(writeToURL:error:_)]
pub unsafe fn writeToURL_error(&self, url: Option<&NSURL>)
-> Result<(), Retained<NSError>>;
#[deprecated = "Use -writeToURL:error: instead"]
#[method(writeToFile:)]
pub unsafe fn writeToFile(&self, path: Option<&NSString>) -> bool;
#[method(removeFile)]
pub unsafe fn removeFile(&self);
}
);
extern_methods!(
unsafe impl NSColorList {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern "C" {
pub static NSColorListDidChangeNotification: &'static NSNotificationName;
}