icrate/generated/AppKit/
NSColorList.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8pub type NSColorListName = NSString;
9
10pub type NSColorName = NSString;
11
12extern_class!(
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "AppKit_NSColorList")]
15 pub struct NSColorList;
16
17 #[cfg(feature = "AppKit_NSColorList")]
18 unsafe impl ClassType for NSColorList {
19 type Super = NSObject;
20 type Mutability = InteriorMutable;
21 }
22);
23
24#[cfg(feature = "AppKit_NSColorList")]
25unsafe impl NSCoding for NSColorList {}
26
27#[cfg(feature = "AppKit_NSColorList")]
28unsafe impl NSObjectProtocol for NSColorList {}
29
30#[cfg(feature = "AppKit_NSColorList")]
31unsafe impl NSSecureCoding for NSColorList {}
32
33extern_methods!(
34 #[cfg(feature = "AppKit_NSColorList")]
35 unsafe impl NSColorList {
36 #[cfg(feature = "Foundation_NSArray")]
37 #[method_id(@__retain_semantics Other availableColorLists)]
38 pub unsafe fn availableColorLists() -> Id<NSArray<NSColorList>>;
39
40 #[method_id(@__retain_semantics Other colorListNamed:)]
41 pub unsafe fn colorListNamed(name: &NSColorListName) -> Option<Id<NSColorList>>;
42
43 #[method_id(@__retain_semantics Init initWithName:)]
44 pub unsafe fn initWithName(this: Allocated<Self>, name: &NSColorListName) -> Id<Self>;
45
46 #[cfg(feature = "Foundation_NSString")]
47 #[method_id(@__retain_semantics Init initWithName:fromFile:)]
48 pub unsafe fn initWithName_fromFile(
49 this: Allocated<Self>,
50 name: &NSColorListName,
51 path: Option<&NSString>,
52 ) -> Option<Id<Self>>;
53
54 #[method_id(@__retain_semantics Other name)]
55 pub unsafe fn name(&self) -> Option<Id<NSColorListName>>;
56
57 #[cfg(feature = "AppKit_NSColor")]
58 #[method(setColor:forKey:)]
59 pub unsafe fn setColor_forKey(&self, color: &NSColor, key: &NSColorName);
60
61 #[cfg(feature = "AppKit_NSColor")]
62 #[method(insertColor:key:atIndex:)]
63 pub unsafe fn insertColor_key_atIndex(
64 &self,
65 color: &NSColor,
66 key: &NSColorName,
67 loc: NSUInteger,
68 );
69
70 #[method(removeColorWithKey:)]
71 pub unsafe fn removeColorWithKey(&self, key: &NSColorName);
72
73 #[cfg(feature = "AppKit_NSColor")]
74 #[method_id(@__retain_semantics Other colorWithKey:)]
75 pub unsafe fn colorWithKey(&self, key: &NSColorName) -> Option<Id<NSColor>>;
76
77 #[cfg(feature = "Foundation_NSArray")]
78 #[method_id(@__retain_semantics Other allKeys)]
79 pub unsafe fn allKeys(&self) -> Id<NSArray<NSColorName>>;
80
81 #[method(isEditable)]
82 pub unsafe fn isEditable(&self) -> bool;
83
84 #[cfg(all(feature = "Foundation_NSError", feature = "Foundation_NSURL"))]
85 #[method(writeToURL:error:_)]
86 pub unsafe fn writeToURL_error(&self, url: Option<&NSURL>) -> Result<(), Id<NSError>>;
87
88 #[cfg(feature = "Foundation_NSString")]
89 #[deprecated = "Use -writeToURL:error: instead"]
90 #[method(writeToFile:)]
91 pub unsafe fn writeToFile(&self, path: Option<&NSString>) -> bool;
92
93 #[method(removeFile)]
94 pub unsafe fn removeFile(&self);
95 }
96);
97
98extern_methods!(
99 #[cfg(feature = "AppKit_NSColorList")]
101 unsafe impl NSColorList {
102 #[method_id(@__retain_semantics Init init)]
103 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
104
105 #[method_id(@__retain_semantics New new)]
106 pub unsafe fn new() -> Id<Self>;
107 }
108);
109
110extern_static!(NSColorListDidChangeNotification: &'static NSNotificationName);