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::*;
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIMenuControllerArrowDirection(pub NSInteger);
impl UIMenuControllerArrowDirection {
#[doc(alias = "UIMenuControllerArrowDefault")]
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub const Default: Self = Self(0);
#[doc(alias = "UIMenuControllerArrowUp")]
pub const Up: Self = Self(1);
#[doc(alias = "UIMenuControllerArrowDown")]
pub const Down: Self = Self(2);
#[doc(alias = "UIMenuControllerArrowLeft")]
pub const Left: Self = Self(3);
#[doc(alias = "UIMenuControllerArrowRight")]
pub const Right: Self = Self(4);
}
unsafe impl Encode for UIMenuControllerArrowDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIMenuControllerArrowDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub struct UIMenuController;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UIMenuController {}
);
impl UIMenuController {
extern_methods!(
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(sharedMenuController))]
#[unsafe(method_family = none)]
pub fn sharedMenuController(mtm: MainThreadMarker) -> Retained<UIMenuController>;
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(isMenuVisible))]
#[unsafe(method_family = none)]
pub fn isMenuVisible(&self) -> bool;
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(setMenuVisible:))]
#[unsafe(method_family = none)]
pub fn setMenuVisible(&self, menu_visible: bool);
#[deprecated = "Use showMenuFromView:rect: or hideMenuFromView: instead."]
#[unsafe(method(setMenuVisible:animated:))]
#[unsafe(method_family = none)]
pub fn setMenuVisible_animated(&self, menu_visible: bool, animated: bool);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[deprecated = "Use showMenuFromView:rect: instead."]
#[unsafe(method(setTargetRect:inView:))]
#[unsafe(method_family = none)]
pub fn setTargetRect_inView(&self, target_rect: CGRect, target_view: &UIView);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(showMenuFromView:rect:))]
#[unsafe(method_family = none)]
pub fn showMenuFromView_rect(&self, target_view: &UIView, target_rect: CGRect);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(hideMenuFromView:))]
#[unsafe(method_family = none)]
pub fn hideMenuFromView(&self, target_view: &UIView);
#[unsafe(method(hideMenu))]
#[unsafe(method_family = none)]
pub fn hideMenu(&self);
#[unsafe(method(arrowDirection))]
#[unsafe(method_family = none)]
pub fn arrowDirection(&self) -> UIMenuControllerArrowDirection;
#[unsafe(method(setArrowDirection:))]
#[unsafe(method_family = none)]
pub fn setArrowDirection(&self, arrow_direction: UIMenuControllerArrowDirection);
#[unsafe(method(menuItems))]
#[unsafe(method_family = none)]
pub fn menuItems(&self) -> Option<Retained<NSArray<UIMenuItem>>>;
#[unsafe(method(setMenuItems:))]
#[unsafe(method_family = none)]
pub fn setMenuItems(&self, menu_items: Option<&NSArray<UIMenuItem>>);
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(update))]
#[unsafe(method_family = none)]
pub fn update(&self);
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(menuFrame))]
#[unsafe(method_family = none)]
pub fn menuFrame(&self) -> CGRect;
);
}
impl UIMenuController {
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>;
);
}
extern "C" {
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub static UIMenuControllerWillShowMenuNotification: &'static NSNotificationName;
}
extern "C" {
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub static UIMenuControllerDidShowMenuNotification: &'static NSNotificationName;
}
extern "C" {
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub static UIMenuControllerWillHideMenuNotification: &'static NSNotificationName;
}
extern "C" {
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub static UIMenuControllerDidHideMenuNotification: &'static NSNotificationName;
}
extern "C" {
#[deprecated = "UIMenuController is deprecated. Use UIEditMenuInteraction instead."]
pub static UIMenuControllerMenuFrameDidChangeNotification: &'static NSNotificationName;
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "UIMenuItem is deprecated. Use UIEditMenuInteraction instead."]
pub struct UIMenuItem;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UIMenuItem {}
);
impl UIMenuItem {
extern_methods!(
#[deprecated = "UIMenuItem is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(initWithTitle:action:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTitle_action(
this: Allocated<Self>,
title: &NSString,
action: Sel,
) -> Retained<Self>;
#[deprecated = "UIMenuItem is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub fn title(&self) -> Retained<NSString>;
#[deprecated = "UIMenuItem is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub fn setTitle(&self, title: &NSString);
#[deprecated = "UIMenuItem is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(action))]
#[unsafe(method_family = none)]
pub fn action(&self) -> Sel;
#[deprecated = "UIMenuItem is deprecated. Use UIEditMenuInteraction instead."]
#[unsafe(method(setAction:))]
#[unsafe(method_family = none)]
pub unsafe fn setAction(&self, action: Sel);
);
}
impl UIMenuItem {
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>;
);
}