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