use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSTextFieldCell, NSActionCell, NSCell, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
pub struct NSComboBoxCell;
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
extern_conformance!(
unsafe impl NSAccessibility for NSComboBoxCell {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSComboBoxCell {}
);
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
extern_conformance!(
unsafe impl NSCoding for NSComboBoxCell {}
);
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
extern_conformance!(
unsafe impl NSCopying for NSComboBoxCell {}
);
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
unsafe impl CopyingHelper for NSComboBoxCell {
type Result = Self;
}
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSComboBoxCell {}
);
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell",
feature = "NSUserInterfaceItemIdentification"
))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSComboBoxCell {}
);
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
impl NSComboBoxCell {
extern_methods!(
#[unsafe(method(hasVerticalScroller))]
#[unsafe(method_family = none)]
pub fn hasVerticalScroller(&self) -> bool;
#[unsafe(method(setHasVerticalScroller:))]
#[unsafe(method_family = none)]
pub fn setHasVerticalScroller(&self, has_vertical_scroller: bool);
#[unsafe(method(intercellSpacing))]
#[unsafe(method_family = none)]
pub fn intercellSpacing(&self) -> NSSize;
#[unsafe(method(setIntercellSpacing:))]
#[unsafe(method_family = none)]
pub fn setIntercellSpacing(&self, intercell_spacing: NSSize);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(itemHeight))]
#[unsafe(method_family = none)]
pub fn itemHeight(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setItemHeight:))]
#[unsafe(method_family = none)]
pub fn setItemHeight(&self, item_height: CGFloat);
#[unsafe(method(numberOfVisibleItems))]
#[unsafe(method_family = none)]
pub fn numberOfVisibleItems(&self) -> NSInteger;
#[unsafe(method(setNumberOfVisibleItems:))]
#[unsafe(method_family = none)]
pub fn setNumberOfVisibleItems(&self, number_of_visible_items: NSInteger);
#[unsafe(method(isButtonBordered))]
#[unsafe(method_family = none)]
pub fn isButtonBordered(&self) -> bool;
#[unsafe(method(setButtonBordered:))]
#[unsafe(method_family = none)]
pub fn setButtonBordered(&self, button_bordered: bool);
#[unsafe(method(reloadData))]
#[unsafe(method_family = none)]
pub fn reloadData(&self);
#[unsafe(method(noteNumberOfItemsChanged))]
#[unsafe(method_family = none)]
pub fn noteNumberOfItemsChanged(&self);
#[unsafe(method(usesDataSource))]
#[unsafe(method_family = none)]
pub fn usesDataSource(&self) -> bool;
#[unsafe(method(setUsesDataSource:))]
#[unsafe(method_family = none)]
pub fn setUsesDataSource(&self, uses_data_source: bool);
#[unsafe(method(scrollItemAtIndexToTop:))]
#[unsafe(method_family = none)]
pub fn scrollItemAtIndexToTop(&self, index: NSInteger);
#[unsafe(method(scrollItemAtIndexToVisible:))]
#[unsafe(method_family = none)]
pub fn scrollItemAtIndexToVisible(&self, index: NSInteger);
#[unsafe(method(selectItemAtIndex:))]
#[unsafe(method_family = none)]
pub fn selectItemAtIndex(&self, index: NSInteger);
#[unsafe(method(deselectItemAtIndex:))]
#[unsafe(method_family = none)]
pub fn deselectItemAtIndex(&self, index: NSInteger);
#[unsafe(method(indexOfSelectedItem))]
#[unsafe(method_family = none)]
pub fn indexOfSelectedItem(&self) -> NSInteger;
#[unsafe(method(numberOfItems))]
#[unsafe(method_family = none)]
pub fn numberOfItems(&self) -> NSInteger;
#[unsafe(method(completes))]
#[unsafe(method_family = none)]
pub fn completes(&self) -> bool;
#[unsafe(method(setCompletes:))]
#[unsafe(method_family = none)]
pub fn setCompletes(&self, completes: bool);
#[unsafe(method(completedString:))]
#[unsafe(method_family = none)]
pub fn completedString(&self, string: &NSString) -> Option<Retained<NSString>>;
#[unsafe(method(dataSource))]
#[unsafe(method_family = none)]
pub unsafe fn dataSource(
&self,
) -> Option<Retained<ProtocolObject<dyn NSComboBoxCellDataSource>>>;
#[unsafe(method(setDataSource:))]
#[unsafe(method_family = none)]
pub unsafe fn setDataSource(
&self,
data_source: Option<&ProtocolObject<dyn NSComboBoxCellDataSource>>,
);
#[unsafe(method(addItemWithObjectValue:))]
#[unsafe(method_family = none)]
pub unsafe fn addItemWithObjectValue(&self, object: &AnyObject);
#[unsafe(method(addItemsWithObjectValues:))]
#[unsafe(method_family = none)]
pub unsafe fn addItemsWithObjectValues(&self, objects: &NSArray);
#[unsafe(method(insertItemWithObjectValue:atIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn insertItemWithObjectValue_atIndex(
&self,
object: &AnyObject,
index: NSInteger,
);
#[unsafe(method(removeItemWithObjectValue:))]
#[unsafe(method_family = none)]
pub unsafe fn removeItemWithObjectValue(&self, object: &AnyObject);
#[unsafe(method(removeItemAtIndex:))]
#[unsafe(method_family = none)]
pub fn removeItemAtIndex(&self, index: NSInteger);
#[unsafe(method(removeAllItems))]
#[unsafe(method_family = none)]
pub fn removeAllItems(&self);
#[unsafe(method(selectItemWithObjectValue:))]
#[unsafe(method_family = none)]
pub unsafe fn selectItemWithObjectValue(&self, object: Option<&AnyObject>);
#[unsafe(method(itemObjectValueAtIndex:))]
#[unsafe(method_family = none)]
pub fn itemObjectValueAtIndex(&self, index: NSInteger) -> Retained<AnyObject>;
#[unsafe(method(objectValueOfSelectedItem))]
#[unsafe(method_family = none)]
pub fn objectValueOfSelectedItem(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(indexOfItemWithObjectValue:))]
#[unsafe(method_family = none)]
pub unsafe fn indexOfItemWithObjectValue(&self, object: &AnyObject) -> NSInteger;
#[unsafe(method(objectValues))]
#[unsafe(method_family = none)]
pub fn objectValues(&self) -> Retained<NSArray>;
);
}
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
impl NSComboBoxCell {
extern_methods!(
#[unsafe(method(initTextCell:))]
#[unsafe(method_family = init)]
pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "NSImage")]
#[unsafe(method(initImageCell:))]
#[unsafe(method_family = init)]
pub unsafe fn initImageCell(
this: Allocated<Self>,
image: Option<&NSImage>,
) -> Retained<Self>;
);
}
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
impl NSComboBoxCell {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
impl NSComboBoxCell {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait NSComboBoxCellDataSource: NSObjectProtocol {
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
#[optional]
#[unsafe(method(numberOfItemsInComboBoxCell:))]
#[unsafe(method_family = none)]
fn numberOfItemsInComboBoxCell(&self, combo_box_cell: &NSComboBoxCell) -> NSInteger;
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
#[optional]
#[unsafe(method(comboBoxCell:objectValueForItemAtIndex:))]
#[unsafe(method_family = none)]
fn comboBoxCell_objectValueForItemAtIndex(
&self,
combo_box_cell: &NSComboBoxCell,
index: NSInteger,
) -> Retained<AnyObject>;
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
#[optional]
#[unsafe(method(comboBoxCell:indexOfItemWithStringValue:))]
#[unsafe(method_family = none)]
fn comboBoxCell_indexOfItemWithStringValue(
&self,
combo_box_cell: &NSComboBoxCell,
string: &NSString,
) -> NSUInteger;
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTextFieldCell"
))]
#[optional]
#[unsafe(method(comboBoxCell:completedString:))]
#[unsafe(method_family = none)]
fn comboBoxCell_completedString(
&self,
combo_box_cell: &NSComboBoxCell,
uncompleted_string: &NSString,
) -> Option<Retained<NSString>>;
}
);