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 unsafe fn initWithIdentifier(
63 this: Allocated<Self>,
64 identifier: &NSUserInterfaceItemIdentifier,
65 ) -> Retained<Self>;
66
67 #[unsafe(method(initWithCoder:))]
68 #[unsafe(method_family = init)]
69 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
70
71 #[cfg(feature = "NSUserInterfaceItemIdentification")]
72 #[unsafe(method(identifier))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn identifier(&self) -> Retained<NSUserInterfaceItemIdentifier>;
75
76 #[cfg(feature = "NSUserInterfaceItemIdentification")]
77 #[unsafe(method(setIdentifier:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);
81
82 #[cfg(all(
83 feature = "NSControl",
84 feature = "NSResponder",
85 feature = "NSTableView",
86 feature = "NSView"
87 ))]
88 #[unsafe(method(tableView))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn tableView(&self) -> Option<Retained<NSTableView>>;
91
92 #[cfg(all(
93 feature = "NSControl",
94 feature = "NSResponder",
95 feature = "NSTableView",
96 feature = "NSView"
97 ))]
98 #[unsafe(method(setTableView:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setTableView(&self, table_view: Option<&NSTableView>);
103
104 #[cfg(feature = "objc2-core-foundation")]
105 #[unsafe(method(width))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn width(&self) -> CGFloat;
108
109 #[cfg(feature = "objc2-core-foundation")]
110 #[unsafe(method(setWidth:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setWidth(&self, width: CGFloat);
114
115 #[cfg(feature = "objc2-core-foundation")]
116 #[unsafe(method(minWidth))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn minWidth(&self) -> CGFloat;
119
120 #[cfg(feature = "objc2-core-foundation")]
121 #[unsafe(method(setMinWidth:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn setMinWidth(&self, min_width: CGFloat);
125
126 #[cfg(feature = "objc2-core-foundation")]
127 #[unsafe(method(maxWidth))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn maxWidth(&self) -> CGFloat;
130
131 #[cfg(feature = "objc2-core-foundation")]
132 #[unsafe(method(setMaxWidth:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn setMaxWidth(&self, max_width: CGFloat);
136
137 #[unsafe(method(title))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn title(&self) -> Retained<NSString>;
140
141 #[unsafe(method(setTitle:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setTitle(&self, title: &NSString);
145
146 #[cfg(all(
147 feature = "NSActionCell",
148 feature = "NSCell",
149 feature = "NSTableHeaderCell",
150 feature = "NSTextFieldCell"
151 ))]
152 #[unsafe(method(headerCell))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn headerCell(&self) -> Retained<NSTableHeaderCell>;
155
156 #[cfg(all(
157 feature = "NSActionCell",
158 feature = "NSCell",
159 feature = "NSTableHeaderCell",
160 feature = "NSTextFieldCell"
161 ))]
162 #[unsafe(method(setHeaderCell:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn setHeaderCell(&self, header_cell: &NSTableHeaderCell);
166
167 #[unsafe(method(isEditable))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn isEditable(&self) -> bool;
170
171 #[unsafe(method(setEditable:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn setEditable(&self, editable: bool);
175
176 #[unsafe(method(sizeToFit))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn sizeToFit(&self);
179
180 #[unsafe(method(sortDescriptorPrototype))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn sortDescriptorPrototype(&self) -> Option<Retained<NSSortDescriptor>>;
183
184 #[unsafe(method(setSortDescriptorPrototype:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn setSortDescriptorPrototype(
188 &self,
189 sort_descriptor_prototype: Option<&NSSortDescriptor>,
190 );
191
192 #[unsafe(method(resizingMask))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn resizingMask(&self) -> NSTableColumnResizingOptions;
195
196 #[unsafe(method(setResizingMask:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn setResizingMask(&self, resizing_mask: NSTableColumnResizingOptions);
200
201 #[unsafe(method(headerToolTip))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn headerToolTip(&self) -> Option<Retained<NSString>>;
204
205 #[unsafe(method(setHeaderToolTip:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn setHeaderToolTip(&self, header_tool_tip: Option<&NSString>);
209
210 #[unsafe(method(isHidden))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn isHidden(&self) -> bool;
213
214 #[unsafe(method(setHidden:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn setHidden(&self, hidden: bool);
218 );
219}
220
221impl NSTableColumn {
223 extern_methods!(
224 #[unsafe(method(init))]
225 #[unsafe(method_family = init)]
226 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
227
228 #[unsafe(method(new))]
229 #[unsafe(method_family = new)]
230 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
231 );
232}
233
234impl NSTableColumn {
236 extern_methods!(
237 #[deprecated]
238 #[unsafe(method(setResizable:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn setResizable(&self, flag: bool);
241
242 #[deprecated]
243 #[unsafe(method(isResizable))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn isResizable(&self) -> bool;
246
247 #[unsafe(method(dataCell))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn dataCell(&self) -> Retained<AnyObject>;
250
251 #[unsafe(method(setDataCell:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn setDataCell(&self, data_cell: &AnyObject);
255
256 #[unsafe(method(dataCellForRow:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn dataCellForRow(&self, row: NSInteger) -> Retained<AnyObject>;
259 );
260}