use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActionSheetStyle(pub NSInteger);
impl UIActionSheetStyle {
#[doc(alias = "UIActionSheetStyleAutomatic")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
pub const Automatic: Self = Self(-1);
#[doc(alias = "UIActionSheetStyleDefault")]
#[cfg(feature = "UIInterface")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
pub const Default: Self = Self(UIBarStyle::Default.0);
#[doc(alias = "UIActionSheetStyleBlackTranslucent")]
#[cfg(feature = "UIInterface")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
pub const BlackTranslucent: Self = Self(UIBarStyle::BlackTranslucent.0);
#[doc(alias = "UIActionSheetStyleBlackOpaque")]
#[cfg(feature = "UIInterface")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
pub const BlackOpaque: Self = Self(UIBarStyle::BlackOpaque.0);
}
unsafe impl Encode for UIActionSheetStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIActionSheetStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIView, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
pub struct UIActionSheet;
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for UIActionSheet {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSCoding for UIActionSheet {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UIActionSheet {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearance for UIActionSheet {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIActionSheet {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UICoordinateSpace for UIActionSheet {}
);
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIDynamicItem for UIActionSheet {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIActionSheet {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItem for UIActionSheet {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItemContainer for UIActionSheet {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIActionSheet {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIActionSheet {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIActionSheet {
extern_methods!(
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UIActionSheetDelegate>>>;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UIActionSheetDelegate>>);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub fn title(&self) -> Retained<NSString>;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub fn setTitle(&self, title: &NSString);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(actionSheetStyle))]
#[unsafe(method_family = none)]
pub fn actionSheetStyle(&self) -> UIActionSheetStyle;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(setActionSheetStyle:))]
#[unsafe(method_family = none)]
pub fn setActionSheetStyle(&self, action_sheet_style: UIActionSheetStyle);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(addButtonWithTitle:))]
#[unsafe(method_family = none)]
pub fn addButtonWithTitle(&self, title: Option<&NSString>) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(buttonTitleAtIndex:))]
#[unsafe(method_family = none)]
pub fn buttonTitleAtIndex(&self, button_index: NSInteger) -> Option<Retained<NSString>>;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(numberOfButtons))]
#[unsafe(method_family = none)]
pub fn numberOfButtons(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(cancelButtonIndex))]
#[unsafe(method_family = none)]
pub fn cancelButtonIndex(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(setCancelButtonIndex:))]
#[unsafe(method_family = none)]
pub fn setCancelButtonIndex(&self, cancel_button_index: NSInteger);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(destructiveButtonIndex))]
#[unsafe(method_family = none)]
pub fn destructiveButtonIndex(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(setDestructiveButtonIndex:))]
#[unsafe(method_family = none)]
pub fn setDestructiveButtonIndex(&self, destructive_button_index: NSInteger);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(firstOtherButtonIndex))]
#[unsafe(method_family = none)]
pub fn firstOtherButtonIndex(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(isVisible))]
#[unsafe(method_family = none)]
pub fn isVisible(&self) -> bool;
#[cfg(feature = "UIToolbar")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(showFromToolbar:))]
#[unsafe(method_family = none)]
pub fn showFromToolbar(&self, view: &UIToolbar);
#[cfg(feature = "UITabBar")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(showFromTabBar:))]
#[unsafe(method_family = none)]
pub fn showFromTabBar(&self, view: &UITabBar);
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(showFromBarButtonItem:animated:))]
#[unsafe(method_family = none)]
pub fn showFromBarButtonItem_animated(&self, item: &UIBarButtonItem, animated: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(showFromRect:inView:animated:))]
#[unsafe(method_family = none)]
pub fn showFromRect_inView_animated(&self, rect: CGRect, view: &UIView, animated: bool);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(showInView:))]
#[unsafe(method_family = none)]
pub fn showInView(&self, view: &UIView);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[unsafe(method(dismissWithClickedButtonIndex:animated:))]
#[unsafe(method_family = none)]
pub fn dismissWithClickedButtonIndex_animated(
&self,
button_index: NSInteger,
animated: bool,
);
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIActionSheet {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[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>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIActionSheet {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait UIActionSheetDelegate: NSObjectProtocol + MainThreadOnly {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[unsafe(method(actionSheet:clickedButtonAtIndex:))]
#[unsafe(method_family = none)]
fn actionSheet_clickedButtonAtIndex(
&self,
action_sheet: &UIActionSheet,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[unsafe(method(actionSheetCancel:))]
#[unsafe(method_family = none)]
fn actionSheetCancel(&self, action_sheet: &UIActionSheet);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[unsafe(method(willPresentActionSheet:))]
#[unsafe(method_family = none)]
fn willPresentActionSheet(&self, action_sheet: &UIActionSheet);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[unsafe(method(didPresentActionSheet:))]
#[unsafe(method_family = none)]
fn didPresentActionSheet(&self, action_sheet: &UIActionSheet);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[unsafe(method(actionSheet:willDismissWithButtonIndex:))]
#[unsafe(method_family = none)]
fn actionSheet_willDismissWithButtonIndex(
&self,
action_sheet: &UIActionSheet,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[unsafe(method(actionSheet:didDismissWithButtonIndex:))]
#[unsafe(method_family = none)]
fn actionSheet_didDismissWithButtonIndex(
&self,
action_sheet: &UIActionSheet,
button_index: NSInteger,
);
}
);