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 NSTitlePosition(pub NSUInteger);
impl NSTitlePosition {
#[doc(alias = "NSNoTitle")]
pub const NoTitle: Self = Self(0);
#[doc(alias = "NSAboveTop")]
pub const AboveTop: Self = Self(1);
#[doc(alias = "NSAtTop")]
pub const AtTop: Self = Self(2);
#[doc(alias = "NSBelowTop")]
pub const BelowTop: Self = Self(3);
#[doc(alias = "NSAboveBottom")]
pub const AboveBottom: Self = Self(4);
#[doc(alias = "NSAtBottom")]
pub const AtBottom: Self = Self(5);
#[doc(alias = "NSBelowBottom")]
pub const BelowBottom: Self = Self(6);
}
unsafe impl Encode for NSTitlePosition {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTitlePosition {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSBoxType(pub NSUInteger);
impl NSBoxType {
#[doc(alias = "NSBoxPrimary")]
pub const Primary: Self = Self(0);
#[doc(alias = "NSBoxSeparator")]
pub const Separator: Self = Self(2);
#[doc(alias = "NSBoxCustom")]
pub const Custom: Self = Self(4);
}
unsafe impl Encode for NSBoxType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSBoxType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
pub struct NSBox;
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibility for NSBox {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSBox {}
);
#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for NSBox {}
);
#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSAppearanceCustomization for NSBox {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSCoding for NSBox {}
);
#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSDraggingDestination for NSBox {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSBox {}
);
#[cfg(all(
feature = "NSResponder",
feature = "NSUserInterfaceItemIdentification",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSBox {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSBox {
extern_methods!(
#[unsafe(method(boxType))]
#[unsafe(method_family = none)]
pub fn boxType(&self) -> NSBoxType;
#[unsafe(method(setBoxType:))]
#[unsafe(method_family = none)]
pub fn setBoxType(&self, box_type: NSBoxType);
#[unsafe(method(titlePosition))]
#[unsafe(method_family = none)]
pub fn titlePosition(&self) -> NSTitlePosition;
#[unsafe(method(setTitlePosition:))]
#[unsafe(method_family = none)]
pub fn setTitlePosition(&self, title_position: NSTitlePosition);
#[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(feature = "NSFont")]
#[unsafe(method(titleFont))]
#[unsafe(method_family = none)]
pub fn titleFont(&self) -> Retained<NSFont>;
#[cfg(feature = "NSFont")]
#[unsafe(method(setTitleFont:))]
#[unsafe(method_family = none)]
pub fn setTitleFont(&self, title_font: &NSFont);
#[unsafe(method(borderRect))]
#[unsafe(method_family = none)]
pub fn borderRect(&self) -> NSRect;
#[unsafe(method(titleRect))]
#[unsafe(method_family = none)]
pub fn titleRect(&self) -> NSRect;
#[unsafe(method(titleCell))]
#[unsafe(method_family = none)]
pub fn titleCell(&self) -> Retained<AnyObject>;
#[unsafe(method(contentViewMargins))]
#[unsafe(method_family = none)]
pub fn contentViewMargins(&self) -> NSSize;
#[unsafe(method(setContentViewMargins:))]
#[unsafe(method_family = none)]
pub fn setContentViewMargins(&self, content_view_margins: NSSize);
#[unsafe(method(sizeToFit))]
#[unsafe(method_family = none)]
pub fn sizeToFit(&self);
#[unsafe(method(setFrameFromContentFrame:))]
#[unsafe(method_family = none)]
pub fn setFrameFromContentFrame(&self, content_frame: NSRect);
#[unsafe(method(contentView))]
#[unsafe(method_family = none)]
pub fn contentView(&self) -> Option<Retained<NSView>>;
#[unsafe(method(setContentView:))]
#[unsafe(method_family = none)]
pub fn setContentView(&self, content_view: Option<&NSView>);
#[unsafe(method(isTransparent))]
#[unsafe(method_family = none)]
pub fn isTransparent(&self) -> bool;
#[unsafe(method(setTransparent:))]
#[unsafe(method_family = none)]
pub fn setTransparent(&self, transparent: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(borderWidth))]
#[unsafe(method_family = none)]
pub fn borderWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setBorderWidth:))]
#[unsafe(method_family = none)]
pub fn setBorderWidth(&self, border_width: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(cornerRadius))]
#[unsafe(method_family = none)]
pub fn cornerRadius(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setCornerRadius:))]
#[unsafe(method_family = none)]
pub fn setCornerRadius(&self, corner_radius: CGFloat);
#[cfg(feature = "NSColor")]
#[unsafe(method(borderColor))]
#[unsafe(method_family = none)]
pub fn borderColor(&self) -> Retained<NSColor>;
#[cfg(feature = "NSColor")]
#[unsafe(method(setBorderColor:))]
#[unsafe(method_family = none)]
pub fn setBorderColor(&self, border_color: &NSColor);
#[cfg(feature = "NSColor")]
#[unsafe(method(fillColor))]
#[unsafe(method_family = none)]
pub fn fillColor(&self) -> Retained<NSColor>;
#[cfg(feature = "NSColor")]
#[unsafe(method(setFillColor:))]
#[unsafe(method_family = none)]
pub fn setFillColor(&self, fill_color: &NSColor);
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSBox {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSBox {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSBox {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSBox {
extern_methods!(
#[deprecated = "borderType is only applicable to NSBoxOldStyle, which is deprecated. To replace a borderType of NSNoBorder, use the `transparent` property."]
#[unsafe(method(borderType))]
#[unsafe(method_family = none)]
pub fn borderType(&self) -> NSBorderType;
#[deprecated = "borderType is only applicable to NSBoxOldStyle, which is deprecated. To replace a borderType of NSNoBorder, use the `transparent` property."]
#[unsafe(method(setBorderType:))]
#[unsafe(method_family = none)]
pub fn setBorderType(&self, border_type: NSBorderType);
#[deprecated]
#[unsafe(method(setTitleWithMnemonic:))]
#[unsafe(method_family = none)]
pub unsafe fn setTitleWithMnemonic(&self, string_with_ampersand: Option<&NSString>);
);
}
#[deprecated]
pub static NSBoxSecondary: NSBoxType = NSBoxType(1);
#[deprecated = "NSBoxOldStyle is discouraged in modern application design. It should be replaced with either NSBoxPrimary or NSBoxCustom."]
pub static NSBoxOldStyle: NSBoxType = NSBoxType(3);