objc2_app_kit/generated/
NSTableColumn.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSTableColumnResizingOptions(pub NSUInteger);
17bitflags::bitflags! {
18 impl NSTableColumnResizingOptions: NSUInteger {
19 #[doc(alias = "NSTableColumnNoResizing")]
20 const NoResizing = 0;
21 #[doc(alias = "NSTableColumnAutoresizingMask")]
22 const AutoresizingMask = 1<<0;
23 #[doc(alias = "NSTableColumnUserResizingMask")]
24 const UserResizingMask = 1<<1;
25 }
26}
27
28unsafe impl Encode for NSTableColumnResizingOptions {
29 const ENCODING: Encoding = NSUInteger::ENCODING;
30}
31
32unsafe impl RefEncode for NSTableColumnResizingOptions {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37 #[unsafe(super(NSObject))]
39 #[thread_kind = MainThreadOnly]
40 #[derive(Debug, PartialEq, Eq, Hash)]
41 pub struct NSTableColumn;
42);
43
44unsafe impl NSCoding for NSTableColumn {}
45
46unsafe impl NSObjectProtocol for NSTableColumn {}
47
48#[cfg(feature = "NSUserInterfaceItemIdentification")]
49unsafe impl NSUserInterfaceItemIdentification for NSTableColumn {}
50
51impl NSTableColumn {
52 extern_methods!(
53 #[cfg(feature = "NSUserInterfaceItemIdentification")]
54 #[unsafe(method(initWithIdentifier:))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn initWithIdentifier(
57 this: Allocated<Self>,
58 identifier: &NSUserInterfaceItemIdentifier,
59 ) -> Retained<Self>;
60
61 #[unsafe(method(initWithCoder:))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
64
65 #[cfg(feature = "NSUserInterfaceItemIdentification")]
66 #[unsafe(method(identifier))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn identifier(&self) -> Retained<NSUserInterfaceItemIdentifier>;
69
70 #[cfg(feature = "NSUserInterfaceItemIdentification")]
71 #[unsafe(method(setIdentifier:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);
75
76 #[cfg(all(
77 feature = "NSControl",
78 feature = "NSResponder",
79 feature = "NSTableView",
80 feature = "NSView"
81 ))]
82 #[unsafe(method(tableView))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn tableView(&self) -> Option<Retained<NSTableView>>;
85
86 #[cfg(all(
87 feature = "NSControl",
88 feature = "NSResponder",
89 feature = "NSTableView",
90 feature = "NSView"
91 ))]
92 #[unsafe(method(setTableView:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setTableView(&self, table_view: Option<&NSTableView>);
97
98 #[cfg(feature = "objc2-core-foundation")]
99 #[unsafe(method(width))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn width(&self) -> CGFloat;
102
103 #[cfg(feature = "objc2-core-foundation")]
104 #[unsafe(method(setWidth:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setWidth(&self, width: CGFloat);
108
109 #[cfg(feature = "objc2-core-foundation")]
110 #[unsafe(method(minWidth))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn minWidth(&self) -> CGFloat;
113
114 #[cfg(feature = "objc2-core-foundation")]
115 #[unsafe(method(setMinWidth:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn setMinWidth(&self, min_width: CGFloat);
119
120 #[cfg(feature = "objc2-core-foundation")]
121 #[unsafe(method(maxWidth))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn maxWidth(&self) -> CGFloat;
124
125 #[cfg(feature = "objc2-core-foundation")]
126 #[unsafe(method(setMaxWidth:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn setMaxWidth(&self, max_width: CGFloat);
130
131 #[unsafe(method(title))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn title(&self) -> Retained<NSString>;
134
135 #[unsafe(method(setTitle:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn setTitle(&self, title: &NSString);
139
140 #[cfg(all(
141 feature = "NSActionCell",
142 feature = "NSCell",
143 feature = "NSTableHeaderCell",
144 feature = "NSTextFieldCell"
145 ))]
146 #[unsafe(method(headerCell))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn headerCell(&self) -> Retained<NSTableHeaderCell>;
149
150 #[cfg(all(
151 feature = "NSActionCell",
152 feature = "NSCell",
153 feature = "NSTableHeaderCell",
154 feature = "NSTextFieldCell"
155 ))]
156 #[unsafe(method(setHeaderCell:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setHeaderCell(&self, header_cell: &NSTableHeaderCell);
160
161 #[unsafe(method(isEditable))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn isEditable(&self) -> bool;
164
165 #[unsafe(method(setEditable:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn setEditable(&self, editable: bool);
169
170 #[unsafe(method(sizeToFit))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn sizeToFit(&self);
173
174 #[unsafe(method(sortDescriptorPrototype))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn sortDescriptorPrototype(&self) -> Option<Retained<NSSortDescriptor>>;
177
178 #[unsafe(method(setSortDescriptorPrototype:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn setSortDescriptorPrototype(
182 &self,
183 sort_descriptor_prototype: Option<&NSSortDescriptor>,
184 );
185
186 #[unsafe(method(resizingMask))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn resizingMask(&self) -> NSTableColumnResizingOptions;
189
190 #[unsafe(method(setResizingMask:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn setResizingMask(&self, resizing_mask: NSTableColumnResizingOptions);
194
195 #[unsafe(method(headerToolTip))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn headerToolTip(&self) -> Option<Retained<NSString>>;
198
199 #[unsafe(method(setHeaderToolTip:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn setHeaderToolTip(&self, header_tool_tip: Option<&NSString>);
203
204 #[unsafe(method(isHidden))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn isHidden(&self) -> bool;
207
208 #[unsafe(method(setHidden:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn setHidden(&self, hidden: bool);
212 );
213}
214
215impl NSTableColumn {
217 extern_methods!(
218 #[unsafe(method(init))]
219 #[unsafe(method_family = init)]
220 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
221
222 #[unsafe(method(new))]
223 #[unsafe(method_family = new)]
224 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
225 );
226}
227
228impl NSTableColumn {
230 extern_methods!(
231 #[deprecated]
232 #[unsafe(method(setResizable:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setResizable(&self, flag: bool);
235
236 #[deprecated]
237 #[unsafe(method(isResizable))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn isResizable(&self) -> bool;
240
241 #[unsafe(method(dataCell))]
242 #[unsafe(method_family = none)]
243 pub unsafe fn dataCell(&self) -> Retained<AnyObject>;
244
245 #[unsafe(method(setDataCell:))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn setDataCell(&self, data_cell: &AnyObject);
249
250 #[unsafe(method(dataCellForRow:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn dataCellForRow(&self, row: NSInteger) -> Retained<AnyObject>;
253 );
254}