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
44extern_conformance!(
45 unsafe impl NSCoding for NSTableColumn {}
46);
47
48extern_conformance!(
49 unsafe impl NSObjectProtocol for NSTableColumn {}
50);
51
52#[cfg(feature = "NSUserInterfaceItemIdentification")]
53extern_conformance!(
54 unsafe impl NSUserInterfaceItemIdentification for NSTableColumn {}
55);
56
57impl NSTableColumn {
58 extern_methods!(
59 #[cfg(feature = "NSUserInterfaceItemIdentification")]
60 #[unsafe(method(initWithIdentifier:))]
61 #[unsafe(method_family = init)]
62 pub fn initWithIdentifier(
63 this: Allocated<Self>,
64 identifier: &NSUserInterfaceItemIdentifier,
65 ) -> Retained<Self>;
66
67 #[unsafe(method(initWithCoder:))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
73
74 #[cfg(feature = "NSUserInterfaceItemIdentification")]
75 #[unsafe(method(identifier))]
76 #[unsafe(method_family = none)]
77 pub fn identifier(&self) -> Retained<NSUserInterfaceItemIdentifier>;
78
79 #[cfg(feature = "NSUserInterfaceItemIdentification")]
80 #[unsafe(method(setIdentifier:))]
84 #[unsafe(method_family = none)]
85 pub fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);
86
87 #[cfg(all(
88 feature = "NSControl",
89 feature = "NSResponder",
90 feature = "NSTableView",
91 feature = "NSView"
92 ))]
93 #[unsafe(method(tableView))]
94 #[unsafe(method_family = none)]
95 pub fn tableView(&self) -> Option<Retained<NSTableView>>;
96
97 #[cfg(all(
98 feature = "NSControl",
99 feature = "NSResponder",
100 feature = "NSTableView",
101 feature = "NSView"
102 ))]
103 #[unsafe(method(setTableView:))]
107 #[unsafe(method_family = none)]
108 pub fn setTableView(&self, table_view: Option<&NSTableView>);
109
110 #[cfg(feature = "objc2-core-foundation")]
111 #[unsafe(method(width))]
112 #[unsafe(method_family = none)]
113 pub fn width(&self) -> CGFloat;
114
115 #[cfg(feature = "objc2-core-foundation")]
116 #[unsafe(method(setWidth:))]
118 #[unsafe(method_family = none)]
119 pub fn setWidth(&self, width: CGFloat);
120
121 #[cfg(feature = "objc2-core-foundation")]
122 #[unsafe(method(minWidth))]
123 #[unsafe(method_family = none)]
124 pub fn minWidth(&self) -> CGFloat;
125
126 #[cfg(feature = "objc2-core-foundation")]
127 #[unsafe(method(setMinWidth:))]
129 #[unsafe(method_family = none)]
130 pub fn setMinWidth(&self, min_width: CGFloat);
131
132 #[cfg(feature = "objc2-core-foundation")]
133 #[unsafe(method(maxWidth))]
134 #[unsafe(method_family = none)]
135 pub fn maxWidth(&self) -> CGFloat;
136
137 #[cfg(feature = "objc2-core-foundation")]
138 #[unsafe(method(setMaxWidth:))]
140 #[unsafe(method_family = none)]
141 pub fn setMaxWidth(&self, max_width: CGFloat);
142
143 #[unsafe(method(title))]
144 #[unsafe(method_family = none)]
145 pub fn title(&self) -> Retained<NSString>;
146
147 #[unsafe(method(setTitle:))]
151 #[unsafe(method_family = none)]
152 pub fn setTitle(&self, title: &NSString);
153
154 #[cfg(all(
155 feature = "NSActionCell",
156 feature = "NSCell",
157 feature = "NSTableHeaderCell",
158 feature = "NSTextFieldCell"
159 ))]
160 #[unsafe(method(headerCell))]
161 #[unsafe(method_family = none)]
162 pub fn headerCell(&self) -> Retained<NSTableHeaderCell>;
163
164 #[cfg(all(
165 feature = "NSActionCell",
166 feature = "NSCell",
167 feature = "NSTableHeaderCell",
168 feature = "NSTextFieldCell"
169 ))]
170 #[unsafe(method(setHeaderCell:))]
172 #[unsafe(method_family = none)]
173 pub fn setHeaderCell(&self, header_cell: &NSTableHeaderCell);
174
175 #[unsafe(method(isEditable))]
176 #[unsafe(method_family = none)]
177 pub fn isEditable(&self) -> bool;
178
179 #[unsafe(method(setEditable:))]
181 #[unsafe(method_family = none)]
182 pub fn setEditable(&self, editable: bool);
183
184 #[unsafe(method(sizeToFit))]
185 #[unsafe(method_family = none)]
186 pub fn sizeToFit(&self);
187
188 #[unsafe(method(sortDescriptorPrototype))]
189 #[unsafe(method_family = none)]
190 pub fn sortDescriptorPrototype(&self) -> Option<Retained<NSSortDescriptor>>;
191
192 #[unsafe(method(setSortDescriptorPrototype:))]
196 #[unsafe(method_family = none)]
197 pub fn setSortDescriptorPrototype(
198 &self,
199 sort_descriptor_prototype: Option<&NSSortDescriptor>,
200 );
201
202 #[unsafe(method(resizingMask))]
203 #[unsafe(method_family = none)]
204 pub fn resizingMask(&self) -> NSTableColumnResizingOptions;
205
206 #[unsafe(method(setResizingMask:))]
208 #[unsafe(method_family = none)]
209 pub fn setResizingMask(&self, resizing_mask: NSTableColumnResizingOptions);
210
211 #[unsafe(method(headerToolTip))]
212 #[unsafe(method_family = none)]
213 pub fn headerToolTip(&self) -> Option<Retained<NSString>>;
214
215 #[unsafe(method(setHeaderToolTip:))]
219 #[unsafe(method_family = none)]
220 pub fn setHeaderToolTip(&self, header_tool_tip: Option<&NSString>);
221
222 #[unsafe(method(isHidden))]
223 #[unsafe(method_family = none)]
224 pub fn isHidden(&self) -> bool;
225
226 #[unsafe(method(setHidden:))]
228 #[unsafe(method_family = none)]
229 pub fn setHidden(&self, hidden: bool);
230 );
231}
232
233impl NSTableColumn {
235 extern_methods!(
236 #[unsafe(method(init))]
237 #[unsafe(method_family = init)]
238 pub fn init(this: Allocated<Self>) -> Retained<Self>;
239
240 #[unsafe(method(new))]
241 #[unsafe(method_family = new)]
242 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
243 );
244}
245
246impl NSTableColumn {
248 extern_methods!(
249 #[deprecated]
250 #[unsafe(method(setResizable:))]
251 #[unsafe(method_family = none)]
252 pub fn setResizable(&self, flag: bool);
253
254 #[deprecated]
255 #[unsafe(method(isResizable))]
256 #[unsafe(method_family = none)]
257 pub fn isResizable(&self) -> bool;
258
259 #[unsafe(method(dataCell))]
260 #[unsafe(method_family = none)]
261 pub fn dataCell(&self) -> Retained<AnyObject>;
262
263 #[unsafe(method(setDataCell:))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn setDataCell(&self, data_cell: &AnyObject);
271
272 #[unsafe(method(dataCellForRow:))]
273 #[unsafe(method_family = none)]
274 pub fn dataCellForRow(&self, row: NSInteger) -> Retained<AnyObject>;
275 );
276}