use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTabState(pub NSUInteger);
impl NSTabState {
#[doc(alias = "NSSelectedTab")]
pub const SelectedTab: Self = Self(0);
#[doc(alias = "NSBackgroundTab")]
pub const BackgroundTab: Self = Self(1);
#[doc(alias = "NSPressedTab")]
pub const PressedTab: Self = Self(2);
}
unsafe impl Encode for NSTabState {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTabState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTabViewItem;
);
extern_conformance!(
unsafe impl NSCoding for NSTabViewItem {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSTabViewItem {}
);
impl NSTabViewItem {
extern_methods!(
#[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
#[unsafe(method(tabViewItemWithViewController:))]
#[unsafe(method_family = none)]
pub fn tabViewItemWithViewController(view_controller: &NSViewController) -> Retained<Self>;
#[unsafe(method(initWithIdentifier:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIdentifier(
this: Allocated<Self>,
identifier: Option<&AnyObject>,
) -> Retained<Self>;
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub fn identifier(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setIdentifier(&self, identifier: Option<&AnyObject>);
#[cfg(feature = "NSColor")]
#[unsafe(method(color))]
#[unsafe(method_family = none)]
pub fn color(&self) -> Retained<NSColor>;
#[cfg(feature = "NSColor")]
#[unsafe(method(setColor:))]
#[unsafe(method_family = none)]
pub fn setColor(&self, color: &NSColor);
#[unsafe(method(label))]
#[unsafe(method_family = none)]
pub fn label(&self) -> Retained<NSString>;
#[unsafe(method(setLabel:))]
#[unsafe(method_family = none)]
pub fn setLabel(&self, label: &NSString);
#[cfg(feature = "NSImage")]
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub fn image(&self) -> Option<Retained<NSImage>>;
#[cfg(feature = "NSImage")]
#[unsafe(method(setImage:))]
#[unsafe(method_family = none)]
pub fn setImage(&self, image: Option<&NSImage>);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(view))]
#[unsafe(method_family = none)]
pub fn view(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(setView:))]
#[unsafe(method_family = none)]
pub fn setView(&self, view: Option<&NSView>);
#[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
#[unsafe(method(viewController))]
#[unsafe(method_family = none)]
pub fn viewController(&self, mtm: MainThreadMarker) -> Option<Retained<NSViewController>>;
#[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
#[unsafe(method(setViewController:))]
#[unsafe(method_family = none)]
pub fn setViewController(&self, view_controller: Option<&NSViewController>);
#[unsafe(method(tabState))]
#[unsafe(method_family = none)]
pub fn tabState(&self) -> NSTabState;
#[cfg(all(feature = "NSResponder", feature = "NSTabView", feature = "NSView"))]
#[unsafe(method(tabView))]
#[unsafe(method_family = none)]
pub fn tabView(&self, mtm: MainThreadMarker) -> Option<Retained<NSTabView>>;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(initialFirstResponder))]
#[unsafe(method_family = none)]
pub fn initialFirstResponder(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(setInitialFirstResponder:))]
#[unsafe(method_family = none)]
pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
#[unsafe(method(toolTip))]
#[unsafe(method_family = none)]
pub fn toolTip(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setToolTip:))]
#[unsafe(method_family = none)]
pub fn setToolTip(&self, tool_tip: Option<&NSString>);
#[unsafe(method(drawLabel:inRect:))]
#[unsafe(method_family = none)]
pub fn drawLabel_inRect(&self, should_truncate_label: bool, label_rect: NSRect);
#[unsafe(method(sizeOfLabel:))]
#[unsafe(method_family = none)]
pub fn sizeOfLabel(&self, compute_min: bool) -> NSSize;
);
}
impl NSTabViewItem {
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() -> Retained<Self>;
);
}
impl DefaultRetained for NSTabViewItem {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}