objc2_app_kit/generated/
NSTableColumn.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstablecolumnresizingoptions?language=objc)
13// NS_OPTIONS
14#[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    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstablecolumn?language=objc)
38    #[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        /// Setter for [`identifier`][Self::identifier].
78        #[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        /// This is a [weak property][objc2::topics::weak_property].
99        /// Setter for [`tableView`][Self::tableView].
100        #[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        /// Setter for [`width`][Self::width].
111        #[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        /// Setter for [`minWidth`][Self::minWidth].
122        #[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        /// Setter for [`maxWidth`][Self::maxWidth].
133        #[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        /// Setter for [`title`][Self::title].
142        #[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        /// Setter for [`headerCell`][Self::headerCell].
163        #[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        /// Setter for [`isEditable`][Self::isEditable].
172        #[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        /// Setter for [`sortDescriptorPrototype`][Self::sortDescriptorPrototype].
185        #[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        /// Setter for [`resizingMask`][Self::resizingMask].
197        #[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        /// Setter for [`headerToolTip`][Self::headerToolTip].
206        #[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        /// Setter for [`isHidden`][Self::isHidden].
215        #[unsafe(method(setHidden:))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn setHidden(&self, hidden: bool);
218    );
219}
220
221/// Methods declared on superclass `NSObject`.
222impl 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
234/// NSDeprecated.
235impl 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        /// Setter for [`dataCell`][Self::dataCell].
252        #[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}