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::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTableColumnResizingOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSTableColumnResizingOptions: NSUInteger {
#[doc(alias = "NSTableColumnNoResizing")]
const NoResizing = 0;
#[doc(alias = "NSTableColumnAutoresizingMask")]
const AutoresizingMask = 1<<0;
#[doc(alias = "NSTableColumnUserResizingMask")]
const UserResizingMask = 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!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTableColumn;
);
extern_conformance!(
unsafe impl NSCoding for NSTableColumn {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSTableColumn {}
);
#[cfg(feature = "NSUserInterfaceItemIdentification")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSTableColumn {}
);
impl NSTableColumn {
extern_methods!(
#[cfg(feature = "NSUserInterfaceItemIdentification")]
#[unsafe(method(initWithIdentifier:))]
#[unsafe(method_family = init)]
pub fn initWithIdentifier(
this: Allocated<Self>,
identifier: &NSUserInterfaceItemIdentifier,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "NSUserInterfaceItemIdentification")]
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub fn identifier(&self) -> Retained<NSUserInterfaceItemIdentifier>;
#[cfg(feature = "NSUserInterfaceItemIdentification")]
#[unsafe(method(setIdentifier:))]
#[unsafe(method_family = none)]
pub fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);
#[cfg(all(
feature = "NSControl",
feature = "NSResponder",
feature = "NSTableView",
feature = "NSView"
))]
#[unsafe(method(tableView))]
#[unsafe(method_family = none)]
pub fn tableView(&self) -> Option<Retained<NSTableView>>;
#[cfg(all(
feature = "NSControl",
feature = "NSResponder",
feature = "NSTableView",
feature = "NSView"
))]
#[unsafe(method(setTableView:))]
#[unsafe(method_family = none)]
pub fn setTableView(&self, table_view: Option<&NSTableView>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(width))]
#[unsafe(method_family = none)]
pub fn width(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setWidth:))]
#[unsafe(method_family = none)]
pub fn setWidth(&self, width: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(minWidth))]
#[unsafe(method_family = none)]
pub fn minWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setMinWidth:))]
#[unsafe(method_family = none)]
pub fn setMinWidth(&self, min_width: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(maxWidth))]
#[unsafe(method_family = none)]
pub fn maxWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setMaxWidth:))]
#[unsafe(method_family = none)]
pub fn setMaxWidth(&self, max_width: CGFloat);
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub fn title(&self) -> Retained<NSString>;
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub fn setTitle(&self, title: &NSString);
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTableHeaderCell",
feature = "NSTextFieldCell"
))]
#[unsafe(method(headerCell))]
#[unsafe(method_family = none)]
pub fn headerCell(&self) -> Retained<NSTableHeaderCell>;
#[cfg(all(
feature = "NSActionCell",
feature = "NSCell",
feature = "NSTableHeaderCell",
feature = "NSTextFieldCell"
))]
#[unsafe(method(setHeaderCell:))]
#[unsafe(method_family = none)]
pub fn setHeaderCell(&self, header_cell: &NSTableHeaderCell);
#[unsafe(method(isEditable))]
#[unsafe(method_family = none)]
pub fn isEditable(&self) -> bool;
#[unsafe(method(setEditable:))]
#[unsafe(method_family = none)]
pub fn setEditable(&self, editable: bool);
#[unsafe(method(sizeToFit))]
#[unsafe(method_family = none)]
pub fn sizeToFit(&self);
#[unsafe(method(sortDescriptorPrototype))]
#[unsafe(method_family = none)]
pub fn sortDescriptorPrototype(&self) -> Option<Retained<NSSortDescriptor>>;
#[unsafe(method(setSortDescriptorPrototype:))]
#[unsafe(method_family = none)]
pub fn setSortDescriptorPrototype(
&self,
sort_descriptor_prototype: Option<&NSSortDescriptor>,
);
#[unsafe(method(resizingMask))]
#[unsafe(method_family = none)]
pub fn resizingMask(&self) -> NSTableColumnResizingOptions;
#[unsafe(method(setResizingMask:))]
#[unsafe(method_family = none)]
pub fn setResizingMask(&self, resizing_mask: NSTableColumnResizingOptions);
#[unsafe(method(headerToolTip))]
#[unsafe(method_family = none)]
pub fn headerToolTip(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setHeaderToolTip:))]
#[unsafe(method_family = none)]
pub fn setHeaderToolTip(&self, header_tool_tip: Option<&NSString>);
#[unsafe(method(isHidden))]
#[unsafe(method_family = none)]
pub fn isHidden(&self) -> bool;
#[unsafe(method(setHidden:))]
#[unsafe(method_family = none)]
pub fn setHidden(&self, hidden: bool);
);
}
impl NSTableColumn {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
impl NSTableColumn {
extern_methods!(
#[deprecated]
#[unsafe(method(setResizable:))]
#[unsafe(method_family = none)]
pub fn setResizable(&self, flag: bool);
#[deprecated]
#[unsafe(method(isResizable))]
#[unsafe(method_family = none)]
pub fn isResizable(&self) -> bool;
#[unsafe(method(dataCell))]
#[unsafe(method_family = none)]
pub fn dataCell(&self) -> Retained<AnyObject>;
#[unsafe(method(setDataCell:))]
#[unsafe(method_family = none)]
pub unsafe fn setDataCell(&self, data_cell: &AnyObject);
#[unsafe(method(dataCellForRow:))]
#[unsafe(method_family = none)]
pub fn dataCellForRow(&self, row: NSInteger) -> Retained<AnyObject>;
);
}