objc2_app_kit/generated/
NSComboBoxCell.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
12extern_class!(
13 #[unsafe(super(NSTextFieldCell, NSActionCell, NSCell, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(all(
17 feature = "NSActionCell",
18 feature = "NSCell",
19 feature = "NSTextFieldCell"
20 ))]
21 pub struct NSComboBoxCell;
22);
23
24#[cfg(all(
25 feature = "NSAccessibilityProtocols",
26 feature = "NSActionCell",
27 feature = "NSCell",
28 feature = "NSTextFieldCell"
29))]
30unsafe impl NSAccessibility for NSComboBoxCell {}
31
32#[cfg(all(
33 feature = "NSAccessibilityProtocols",
34 feature = "NSActionCell",
35 feature = "NSCell",
36 feature = "NSTextFieldCell"
37))]
38unsafe impl NSAccessibilityElementProtocol for NSComboBoxCell {}
39
40#[cfg(all(
41 feature = "NSActionCell",
42 feature = "NSCell",
43 feature = "NSTextFieldCell"
44))]
45unsafe impl NSCoding for NSComboBoxCell {}
46
47#[cfg(all(
48 feature = "NSActionCell",
49 feature = "NSCell",
50 feature = "NSTextFieldCell"
51))]
52unsafe impl NSCopying for NSComboBoxCell {}
53
54#[cfg(all(
55 feature = "NSActionCell",
56 feature = "NSCell",
57 feature = "NSTextFieldCell"
58))]
59unsafe impl CopyingHelper for NSComboBoxCell {
60 type Result = Self;
61}
62
63#[cfg(all(
64 feature = "NSActionCell",
65 feature = "NSCell",
66 feature = "NSTextFieldCell"
67))]
68unsafe impl NSObjectProtocol for NSComboBoxCell {}
69
70#[cfg(all(
71 feature = "NSActionCell",
72 feature = "NSCell",
73 feature = "NSTextFieldCell",
74 feature = "NSUserInterfaceItemIdentification"
75))]
76unsafe impl NSUserInterfaceItemIdentification for NSComboBoxCell {}
77
78#[cfg(all(
79 feature = "NSActionCell",
80 feature = "NSCell",
81 feature = "NSTextFieldCell"
82))]
83impl NSComboBoxCell {
84 extern_methods!(
85 #[unsafe(method(hasVerticalScroller))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn hasVerticalScroller(&self) -> bool;
88
89 #[unsafe(method(setHasVerticalScroller:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn setHasVerticalScroller(&self, has_vertical_scroller: bool);
93
94 #[unsafe(method(intercellSpacing))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn intercellSpacing(&self) -> NSSize;
97
98 #[unsafe(method(setIntercellSpacing:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn setIntercellSpacing(&self, intercell_spacing: NSSize);
102
103 #[cfg(feature = "objc2-core-foundation")]
104 #[unsafe(method(itemHeight))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn itemHeight(&self) -> CGFloat;
107
108 #[cfg(feature = "objc2-core-foundation")]
109 #[unsafe(method(setItemHeight:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn setItemHeight(&self, item_height: CGFloat);
113
114 #[unsafe(method(numberOfVisibleItems))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn numberOfVisibleItems(&self) -> NSInteger;
117
118 #[unsafe(method(setNumberOfVisibleItems:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setNumberOfVisibleItems(&self, number_of_visible_items: NSInteger);
122
123 #[unsafe(method(isButtonBordered))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn isButtonBordered(&self) -> bool;
126
127 #[unsafe(method(setButtonBordered:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setButtonBordered(&self, button_bordered: bool);
131
132 #[unsafe(method(reloadData))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn reloadData(&self);
135
136 #[unsafe(method(noteNumberOfItemsChanged))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn noteNumberOfItemsChanged(&self);
139
140 #[unsafe(method(usesDataSource))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn usesDataSource(&self) -> bool;
143
144 #[unsafe(method(setUsesDataSource:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn setUsesDataSource(&self, uses_data_source: bool);
148
149 #[unsafe(method(scrollItemAtIndexToTop:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn scrollItemAtIndexToTop(&self, index: NSInteger);
152
153 #[unsafe(method(scrollItemAtIndexToVisible:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn scrollItemAtIndexToVisible(&self, index: NSInteger);
156
157 #[unsafe(method(selectItemAtIndex:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn selectItemAtIndex(&self, index: NSInteger);
160
161 #[unsafe(method(deselectItemAtIndex:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn deselectItemAtIndex(&self, index: NSInteger);
164
165 #[unsafe(method(indexOfSelectedItem))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn indexOfSelectedItem(&self) -> NSInteger;
168
169 #[unsafe(method(numberOfItems))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn numberOfItems(&self) -> NSInteger;
172
173 #[unsafe(method(completes))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn completes(&self) -> bool;
176
177 #[unsafe(method(setCompletes:))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn setCompletes(&self, completes: bool);
181
182 #[unsafe(method(completedString:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn completedString(&self, string: &NSString) -> Option<Retained<NSString>>;
185
186 #[unsafe(method(dataSource))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn dataSource(
189 &self,
190 ) -> Option<Retained<ProtocolObject<dyn NSComboBoxCellDataSource>>>;
191
192 #[unsafe(method(setDataSource:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn setDataSource(
196 &self,
197 data_source: Option<&ProtocolObject<dyn NSComboBoxCellDataSource>>,
198 );
199
200 #[unsafe(method(addItemWithObjectValue:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn addItemWithObjectValue(&self, object: &AnyObject);
203
204 #[unsafe(method(addItemsWithObjectValues:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn addItemsWithObjectValues(&self, objects: &NSArray);
207
208 #[unsafe(method(insertItemWithObjectValue:atIndex:))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn insertItemWithObjectValue_atIndex(
211 &self,
212 object: &AnyObject,
213 index: NSInteger,
214 );
215
216 #[unsafe(method(removeItemWithObjectValue:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn removeItemWithObjectValue(&self, object: &AnyObject);
219
220 #[unsafe(method(removeItemAtIndex:))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn removeItemAtIndex(&self, index: NSInteger);
223
224 #[unsafe(method(removeAllItems))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn removeAllItems(&self);
227
228 #[unsafe(method(selectItemWithObjectValue:))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn selectItemWithObjectValue(&self, object: Option<&AnyObject>);
231
232 #[unsafe(method(itemObjectValueAtIndex:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn itemObjectValueAtIndex(&self, index: NSInteger) -> Retained<AnyObject>;
235
236 #[unsafe(method(objectValueOfSelectedItem))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn objectValueOfSelectedItem(&self) -> Option<Retained<AnyObject>>;
239
240 #[unsafe(method(indexOfItemWithObjectValue:))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn indexOfItemWithObjectValue(&self, object: &AnyObject) -> NSInteger;
243
244 #[unsafe(method(objectValues))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn objectValues(&self) -> Retained<NSArray>;
247 );
248}
249
250#[cfg(all(
252 feature = "NSActionCell",
253 feature = "NSCell",
254 feature = "NSTextFieldCell"
255))]
256impl NSComboBoxCell {
257 extern_methods!(
258 #[unsafe(method(initTextCell:))]
259 #[unsafe(method_family = init)]
260 pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
261
262 #[unsafe(method(initWithCoder:))]
263 #[unsafe(method_family = init)]
264 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
265
266 #[cfg(feature = "NSImage")]
267 #[unsafe(method(initImageCell:))]
268 #[unsafe(method_family = init)]
269 pub unsafe fn initImageCell(
270 this: Allocated<Self>,
271 image: Option<&NSImage>,
272 ) -> Retained<Self>;
273 );
274}
275
276#[cfg(all(
278 feature = "NSActionCell",
279 feature = "NSCell",
280 feature = "NSTextFieldCell"
281))]
282impl NSComboBoxCell {
283 extern_methods!(
284 #[unsafe(method(init))]
285 #[unsafe(method_family = init)]
286 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
287 );
288}
289
290#[cfg(all(
292 feature = "NSActionCell",
293 feature = "NSCell",
294 feature = "NSTextFieldCell"
295))]
296impl NSComboBoxCell {
297 extern_methods!(
298 #[unsafe(method(new))]
299 #[unsafe(method_family = new)]
300 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
301 );
302}
303
304extern_protocol!(
305 pub unsafe trait NSComboBoxCellDataSource: NSObjectProtocol {
307 #[cfg(all(
308 feature = "NSActionCell",
309 feature = "NSCell",
310 feature = "NSTextFieldCell"
311 ))]
312 #[optional]
313 #[unsafe(method(numberOfItemsInComboBoxCell:))]
314 #[unsafe(method_family = none)]
315 unsafe fn numberOfItemsInComboBoxCell(&self, combo_box_cell: &NSComboBoxCell) -> NSInteger;
316
317 #[cfg(all(
318 feature = "NSActionCell",
319 feature = "NSCell",
320 feature = "NSTextFieldCell"
321 ))]
322 #[optional]
323 #[unsafe(method(comboBoxCell:objectValueForItemAtIndex:))]
324 #[unsafe(method_family = none)]
325 unsafe fn comboBoxCell_objectValueForItemAtIndex(
326 &self,
327 combo_box_cell: &NSComboBoxCell,
328 index: NSInteger,
329 ) -> Retained<AnyObject>;
330
331 #[cfg(all(
332 feature = "NSActionCell",
333 feature = "NSCell",
334 feature = "NSTextFieldCell"
335 ))]
336 #[optional]
337 #[unsafe(method(comboBoxCell:indexOfItemWithStringValue:))]
338 #[unsafe(method_family = none)]
339 unsafe fn comboBoxCell_indexOfItemWithStringValue(
340 &self,
341 combo_box_cell: &NSComboBoxCell,
342 string: &NSString,
343 ) -> NSUInteger;
344
345 #[cfg(all(
346 feature = "NSActionCell",
347 feature = "NSCell",
348 feature = "NSTextFieldCell"
349 ))]
350 #[optional]
351 #[unsafe(method(comboBoxCell:completedString:))]
352 #[unsafe(method_family = none)]
353 unsafe fn comboBoxCell_completedString(
354 &self,
355 combo_box_cell: &NSComboBoxCell,
356 uncompleted_string: &NSString,
357 ) -> Option<Retained<NSString>>;
358 }
359);