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 UICellAccessoryDisplayedState(pub NSInteger);
impl UICellAccessoryDisplayedState {
#[doc(alias = "UICellAccessoryDisplayedAlways")]
pub const Always: Self = Self(0);
#[doc(alias = "UICellAccessoryDisplayedWhenEditing")]
pub const WhenEditing: Self = Self(1);
#[doc(alias = "UICellAccessoryDisplayedWhenNotEditing")]
pub const WhenNotEditing: Self = Self(2);
}
unsafe impl Encode for UICellAccessoryDisplayedState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellAccessoryDisplayedState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UICellAccessoryStandardDimension: CGFloat;
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessory;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessory {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessory {}
);
unsafe impl CopyingHelper for UICellAccessory {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessory {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessory {}
);
impl UICellAccessory {
extern_methods!(
#[unsafe(method(displayedState))]
#[unsafe(method_family = none)]
pub fn displayedState(&self) -> UICellAccessoryDisplayedState;
#[unsafe(method(setDisplayedState:))]
#[unsafe(method_family = none)]
pub fn setDisplayedState(&self, displayed_state: UICellAccessoryDisplayedState);
#[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);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(reservedLayoutWidth))]
#[unsafe(method_family = none)]
pub fn reservedLayoutWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setReservedLayoutWidth:))]
#[unsafe(method_family = none)]
pub fn setReservedLayoutWidth(&self, reserved_layout_width: CGFloat);
#[cfg(feature = "UIColor")]
#[unsafe(method(tintColor))]
#[unsafe(method_family = none)]
pub fn tintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setTintColor:))]
#[unsafe(method_family = none)]
pub fn setTintColor(&self, tint_color: Option<&UIColor>);
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessory {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryDisclosureIndicator;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryDisclosureIndicator {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryDisclosureIndicator {}
);
unsafe impl CopyingHelper for UICellAccessoryDisclosureIndicator {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryDisclosureIndicator {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryDisclosureIndicator {}
);
impl UICellAccessoryDisclosureIndicator {
extern_methods!();
}
impl UICellAccessoryDisclosureIndicator {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryDisclosureIndicator {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryDetail;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryDetail {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryDetail {}
);
unsafe impl CopyingHelper for UICellAccessoryDetail {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryDetail {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryDetail {}
);
impl UICellAccessoryDetail {
extern_methods!(
#[cfg(feature = "block2")]
#[unsafe(method(actionHandler))]
#[unsafe(method_family = none)]
pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
#[cfg(feature = "block2")]
#[unsafe(method(setActionHandler:))]
#[unsafe(method_family = none)]
pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
);
}
impl UICellAccessoryDetail {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryDetail {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryCheckmark;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryCheckmark {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryCheckmark {}
);
unsafe impl CopyingHelper for UICellAccessoryCheckmark {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryCheckmark {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryCheckmark {}
);
impl UICellAccessoryCheckmark {
extern_methods!();
}
impl UICellAccessoryCheckmark {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryCheckmark {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryDelete;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryDelete {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryDelete {}
);
unsafe impl CopyingHelper for UICellAccessoryDelete {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryDelete {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryDelete {}
);
impl UICellAccessoryDelete {
extern_methods!(
#[cfg(feature = "UIColor")]
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(feature = "block2")]
#[unsafe(method(actionHandler))]
#[unsafe(method_family = none)]
pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
#[cfg(feature = "block2")]
#[unsafe(method(setActionHandler:))]
#[unsafe(method_family = none)]
pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
);
}
impl UICellAccessoryDelete {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryDelete {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryInsert;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryInsert {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryInsert {}
);
unsafe impl CopyingHelper for UICellAccessoryInsert {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryInsert {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryInsert {}
);
impl UICellAccessoryInsert {
extern_methods!(
#[cfg(feature = "UIColor")]
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(feature = "block2")]
#[unsafe(method(actionHandler))]
#[unsafe(method_family = none)]
pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
#[cfg(feature = "block2")]
#[unsafe(method(setActionHandler:))]
#[unsafe(method_family = none)]
pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
);
}
impl UICellAccessoryInsert {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryInsert {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryReorder;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryReorder {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryReorder {}
);
unsafe impl CopyingHelper for UICellAccessoryReorder {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryReorder {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryReorder {}
);
impl UICellAccessoryReorder {
extern_methods!(
#[unsafe(method(showsVerticalSeparator))]
#[unsafe(method_family = none)]
pub fn showsVerticalSeparator(&self) -> bool;
#[unsafe(method(setShowsVerticalSeparator:))]
#[unsafe(method_family = none)]
pub fn setShowsVerticalSeparator(&self, shows_vertical_separator: bool);
);
}
impl UICellAccessoryReorder {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryReorder {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryMultiselect;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryMultiselect {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryMultiselect {}
);
unsafe impl CopyingHelper for UICellAccessoryMultiselect {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryMultiselect {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryMultiselect {}
);
impl UICellAccessoryMultiselect {
extern_methods!(
#[cfg(feature = "UIColor")]
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
);
}
impl UICellAccessoryMultiselect {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryMultiselect {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellAccessoryOutlineDisclosureStyle(pub NSInteger);
impl UICellAccessoryOutlineDisclosureStyle {
#[doc(alias = "UICellAccessoryOutlineDisclosureStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UICellAccessoryOutlineDisclosureStyleHeader")]
pub const Header: Self = Self(1);
#[doc(alias = "UICellAccessoryOutlineDisclosureStyleCell")]
pub const Cell: Self = Self(2);
}
unsafe impl Encode for UICellAccessoryOutlineDisclosureStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellAccessoryOutlineDisclosureStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryOutlineDisclosure;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryOutlineDisclosure {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryOutlineDisclosure {}
);
unsafe impl CopyingHelper for UICellAccessoryOutlineDisclosure {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryOutlineDisclosure {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryOutlineDisclosure {}
);
impl UICellAccessoryOutlineDisclosure {
extern_methods!(
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub fn style(&self) -> UICellAccessoryOutlineDisclosureStyle;
#[unsafe(method(setStyle:))]
#[unsafe(method_family = none)]
pub fn setStyle(&self, style: UICellAccessoryOutlineDisclosureStyle);
#[cfg(feature = "block2")]
#[unsafe(method(actionHandler))]
#[unsafe(method_family = none)]
pub fn actionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
#[cfg(feature = "block2")]
#[unsafe(method(setActionHandler:))]
#[unsafe(method_family = none)]
pub fn setActionHandler(&self, action_handler: Option<&block2::DynBlock<dyn Fn()>>);
);
}
impl UICellAccessoryOutlineDisclosure {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UICellAccessoryOutlineDisclosure {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryPopUpMenu;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryPopUpMenu {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryPopUpMenu {}
);
unsafe impl CopyingHelper for UICellAccessoryPopUpMenu {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryPopUpMenu {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryPopUpMenu {}
);
impl UICellAccessoryPopUpMenu {
extern_methods!(
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[unsafe(method(initWithMenu:))]
#[unsafe(method_family = init)]
pub fn initWithMenu(this: Allocated<Self>, menu: &UIMenu) -> Retained<Self>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[unsafe(method(menu))]
#[unsafe(method_family = none)]
pub fn menu(&self) -> Retained<UIMenu>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
#[unsafe(method(selectedElementDidChangeHandler))]
#[unsafe(method_family = none)]
pub unsafe fn selectedElementDidChangeHandler(
&self,
) -> *mut block2::DynBlock<dyn Fn(NonNull<UIMenu>)>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
#[unsafe(method(setSelectedElementDidChangeHandler:))]
#[unsafe(method_family = none)]
pub fn setSelectedElementDidChangeHandler(
&self,
selected_element_did_change_handler: Option<&block2::DynBlock<dyn Fn(NonNull<UIMenu>)>>,
);
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryLabel;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryLabel {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryLabel {}
);
unsafe impl CopyingHelper for UICellAccessoryLabel {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryLabel {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryLabel {}
);
impl UICellAccessoryLabel {
extern_methods!(
#[unsafe(method(initWithText:))]
#[unsafe(method_family = init)]
pub fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
#[unsafe(method(text))]
#[unsafe(method_family = none)]
pub fn text(&self) -> Retained<NSString>;
#[cfg(feature = "UIFont")]
#[unsafe(method(font))]
#[unsafe(method_family = none)]
pub fn font(&self) -> Retained<UIFont>;
#[cfg(feature = "UIFont")]
#[unsafe(method(setFont:))]
#[unsafe(method_family = none)]
pub fn setFont(&self, font: &UIFont);
#[unsafe(method(adjustsFontForContentSizeCategory))]
#[unsafe(method_family = none)]
pub fn adjustsFontForContentSizeCategory(&self) -> bool;
#[unsafe(method(setAdjustsFontForContentSizeCategory:))]
#[unsafe(method_family = none)]
pub fn setAdjustsFontForContentSizeCategory(
&self,
adjusts_font_for_content_size_category: bool,
);
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellAccessoryPlacement(pub NSInteger);
impl UICellAccessoryPlacement {
#[doc(alias = "UICellAccessoryPlacementLeading")]
pub const Leading: Self = Self(0);
#[doc(alias = "UICellAccessoryPlacementTrailing")]
pub const Trailing: Self = Self(1);
}
unsafe impl Encode for UICellAccessoryPlacement {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellAccessoryPlacement {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "block2")]
pub type UICellAccessoryPosition =
*mut block2::DynBlock<dyn Fn(NonNull<NSArray<UICellAccessory>>) -> NSUInteger>;
impl UICellAccessory {
#[doc(alias = "UICellAccessoryPositionBeforeAccessoryOfClass")]
#[cfg(feature = "block2")]
#[inline]
pub unsafe fn position_before_accessory_of_class(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition {
extern "C-unwind" {
fn UICellAccessoryPositionBeforeAccessoryOfClass(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition;
}
unsafe { UICellAccessoryPositionBeforeAccessoryOfClass(accessory_class) }
}
#[doc(alias = "UICellAccessoryPositionAfterAccessoryOfClass")]
#[cfg(feature = "block2")]
#[inline]
pub unsafe fn position_after_accessory_of_class(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition {
extern "C-unwind" {
fn UICellAccessoryPositionAfterAccessoryOfClass(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition;
}
unsafe { UICellAccessoryPositionAfterAccessoryOfClass(accessory_class) }
}
}
extern_class!(
#[unsafe(super(UICellAccessory, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryCustomView;
);
extern_conformance!(
unsafe impl NSCoding for UICellAccessoryCustomView {}
);
extern_conformance!(
unsafe impl NSCopying for UICellAccessoryCustomView {}
);
unsafe impl CopyingHelper for UICellAccessoryCustomView {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICellAccessoryCustomView {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UICellAccessoryCustomView {}
);
impl UICellAccessoryCustomView {
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(initWithCustomView:placement:))]
#[unsafe(method_family = init)]
pub fn initWithCustomView_placement(
this: Allocated<Self>,
custom_view: &UIView,
placement: UICellAccessoryPlacement,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(customView))]
#[unsafe(method_family = none)]
pub fn customView(&self) -> Retained<UIView>;
#[unsafe(method(placement))]
#[unsafe(method_family = none)]
pub fn placement(&self) -> UICellAccessoryPlacement;
#[unsafe(method(maintainsFixedSize))]
#[unsafe(method_family = none)]
pub fn maintainsFixedSize(&self) -> bool;
#[unsafe(method(setMaintainsFixedSize:))]
#[unsafe(method_family = none)]
pub fn setMaintainsFixedSize(&self, maintains_fixed_size: bool);
#[cfg(feature = "block2")]
#[unsafe(method(position))]
#[unsafe(method_family = none)]
pub unsafe fn position(&self) -> UICellAccessoryPosition;
#[cfg(feature = "block2")]
#[unsafe(method(setPosition:))]
#[unsafe(method_family = none)]
pub unsafe fn setPosition(&self, position: UICellAccessoryPosition);
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern "C-unwind" {
#[cfg(feature = "block2")]
#[deprecated = "renamed to `UICellAccessory::position_before_accessory_of_class`"]
pub fn UICellAccessoryPositionBeforeAccessoryOfClass(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition;
}
extern "C-unwind" {
#[cfg(feature = "block2")]
#[deprecated = "renamed to `UICellAccessory::position_after_accessory_of_class`"]
pub fn UICellAccessoryPositionAfterAccessoryOfClass(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition;
}