1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTableColumnResizingOptions(pub NSUInteger);
impl NSTableColumnResizingOptions {
    pub const NSTableColumnNoResizing: Self = Self(0);
    pub const NSTableColumnAutoresizingMask: Self = Self(1 << 0);
    pub const NSTableColumnUserResizingMask: Self = Self(1 << 1);
}

unsafe impl Encode for NSTableColumnResizingOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSTableColumnResizingOptions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSTableColumn;

    unsafe impl ClassType for NSTableColumn {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for NSTableColumn {}

unsafe impl NSObjectProtocol for NSTableColumn {}

#[cfg(feature = "NSUserInterfaceItemIdentification")]
unsafe impl NSUserInterfaceItemIdentification for NSTableColumn {}

extern_methods!(
    unsafe impl NSTableColumn {
        #[cfg(feature = "NSUserInterfaceItemIdentification")]
        #[method_id(@__retain_semantics Init initWithIdentifier:)]
        pub unsafe fn initWithIdentifier(
            this: Allocated<Self>,
            identifier: &NSUserInterfaceItemIdentifier,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;

        #[cfg(feature = "NSUserInterfaceItemIdentification")]
        #[method_id(@__retain_semantics Other identifier)]
        pub unsafe fn identifier(&self) -> Id<NSUserInterfaceItemIdentifier>;

        #[cfg(feature = "NSUserInterfaceItemIdentification")]
        #[method(setIdentifier:)]
        pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[method_id(@__retain_semantics Other tableView)]
        pub unsafe fn tableView(&self, mtm: MainThreadMarker) -> Option<Id<NSTableView>>;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[method(setTableView:)]
        pub unsafe fn setTableView(&self, table_view: Option<&NSTableView>);

        #[method(width)]
        pub unsafe fn width(&self) -> CGFloat;

        #[method(setWidth:)]
        pub unsafe fn setWidth(&self, width: CGFloat);

        #[method(minWidth)]
        pub unsafe fn minWidth(&self) -> CGFloat;

        #[method(setMinWidth:)]
        pub unsafe fn setMinWidth(&self, min_width: CGFloat);

        #[method(maxWidth)]
        pub unsafe fn maxWidth(&self) -> CGFloat;

        #[method(setMaxWidth:)]
        pub unsafe fn setMaxWidth(&self, max_width: CGFloat);

        #[method_id(@__retain_semantics Other title)]
        pub unsafe fn title(&self) -> Id<NSString>;

        #[method(setTitle:)]
        pub unsafe fn setTitle(&self, title: &NSString);

        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSTableHeaderCell",
            feature = "NSTextFieldCell"
        ))]
        #[method_id(@__retain_semantics Other headerCell)]
        pub unsafe fn headerCell(&self, mtm: MainThreadMarker) -> Id<NSTableHeaderCell>;

        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSTableHeaderCell",
            feature = "NSTextFieldCell"
        ))]
        #[method(setHeaderCell:)]
        pub unsafe fn setHeaderCell(&self, header_cell: &NSTableHeaderCell);

        #[method(isEditable)]
        pub unsafe fn isEditable(&self) -> bool;

        #[method(setEditable:)]
        pub unsafe fn setEditable(&self, editable: bool);

        #[method(sizeToFit)]
        pub unsafe fn sizeToFit(&self);

        #[method_id(@__retain_semantics Other sortDescriptorPrototype)]
        pub unsafe fn sortDescriptorPrototype(&self) -> Option<Id<NSSortDescriptor>>;

        #[method(setSortDescriptorPrototype:)]
        pub unsafe fn setSortDescriptorPrototype(
            &self,
            sort_descriptor_prototype: Option<&NSSortDescriptor>,
        );

        #[method(resizingMask)]
        pub unsafe fn resizingMask(&self) -> NSTableColumnResizingOptions;

        #[method(setResizingMask:)]
        pub unsafe fn setResizingMask(&self, resizing_mask: NSTableColumnResizingOptions);

        #[method_id(@__retain_semantics Other headerToolTip)]
        pub unsafe fn headerToolTip(&self) -> Option<Id<NSString>>;

        #[method(setHeaderToolTip:)]
        pub unsafe fn setHeaderToolTip(&self, header_tool_tip: Option<&NSString>);

        #[method(isHidden)]
        pub unsafe fn isHidden(&self) -> bool;

        #[method(setHidden:)]
        pub unsafe fn setHidden(&self, hidden: bool);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSTableColumn {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    /// NSDeprecated
    unsafe impl NSTableColumn {
        #[deprecated]
        #[method(setResizable:)]
        pub unsafe fn setResizable(&self, flag: bool);

        #[deprecated]
        #[method(isResizable)]
        pub unsafe fn isResizable(&self) -> bool;

        #[method_id(@__retain_semantics Other dataCell)]
        pub unsafe fn dataCell(&self) -> Id<AnyObject>;

        #[method(setDataCell:)]
        pub unsafe fn setDataCell(&self, data_cell: &AnyObject);

        #[method_id(@__retain_semantics Other dataCellForRow:)]
        pub unsafe fn dataCellForRow(&self, row: NSInteger) -> Id<AnyObject>;
    }
);