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::*;
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIDocumentInteractionController;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UIDocumentInteractionController {}
);
#[cfg(feature = "UIActionSheet")]
extern_conformance!(
unsafe impl UIActionSheetDelegate for UIDocumentInteractionController {}
);
impl UIDocumentInteractionController {
extern_methods!(
#[unsafe(method(interactionControllerWithURL:))]
#[unsafe(method_family = none)]
pub fn interactionControllerWithURL(
url: &NSURL,
mtm: MainThreadMarker,
) -> Retained<UIDocumentInteractionController>;
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UIDocumentInteractionControllerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UIDocumentInteractionControllerDelegate>>,
);
#[unsafe(method(URL))]
#[unsafe(method_family = none)]
pub fn URL(&self) -> Option<Retained<NSURL>>;
#[unsafe(method(setURL:))]
#[unsafe(method_family = none)]
pub fn setURL(&self, url: Option<&NSURL>);
#[unsafe(method(UTI))]
#[unsafe(method_family = none)]
pub fn UTI(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setUTI:))]
#[unsafe(method_family = none)]
pub fn setUTI(&self, uti: Option<&NSString>);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub fn name(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub fn setName(&self, name: Option<&NSString>);
#[cfg(feature = "UIImage")]
#[unsafe(method(icons))]
#[unsafe(method_family = none)]
pub fn icons(&self) -> Retained<NSArray<UIImage>>;
#[unsafe(method(annotation))]
#[unsafe(method_family = none)]
pub fn annotation(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setAnnotation:))]
#[unsafe(method_family = none)]
pub unsafe fn setAnnotation(&self, annotation: Option<&AnyObject>);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(presentOptionsMenuFromRect:inView:animated:))]
#[unsafe(method_family = none)]
pub fn presentOptionsMenuFromRect_inView_animated(
&self,
rect: CGRect,
view: &UIView,
animated: bool,
) -> bool;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(presentOptionsMenuFromBarButtonItem:animated:))]
#[unsafe(method_family = none)]
pub fn presentOptionsMenuFromBarButtonItem_animated(
&self,
item: &UIBarButtonItem,
animated: bool,
) -> bool;
#[unsafe(method(presentPreviewAnimated:))]
#[unsafe(method_family = none)]
pub fn presentPreviewAnimated(&self, animated: bool) -> bool;
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(presentOpenInMenuFromRect:inView:animated:))]
#[unsafe(method_family = none)]
pub fn presentOpenInMenuFromRect_inView_animated(
&self,
rect: CGRect,
view: &UIView,
animated: bool,
) -> bool;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(presentOpenInMenuFromBarButtonItem:animated:))]
#[unsafe(method_family = none)]
pub fn presentOpenInMenuFromBarButtonItem_animated(
&self,
item: &UIBarButtonItem,
animated: bool,
) -> bool;
#[unsafe(method(dismissPreviewAnimated:))]
#[unsafe(method_family = none)]
pub fn dismissPreviewAnimated(&self, animated: bool);
#[unsafe(method(dismissMenuAnimated:))]
#[unsafe(method_family = none)]
pub fn dismissMenuAnimated(&self, animated: bool);
#[cfg(feature = "UIGestureRecognizer")]
#[unsafe(method(gestureRecognizers))]
#[unsafe(method_family = none)]
pub fn gestureRecognizers(&self) -> Retained<NSArray<UIGestureRecognizer>>;
);
}
impl UIDocumentInteractionController {
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_protocol!(
pub unsafe trait UIDocumentInteractionControllerDelegate: NSObjectProtocol {
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(documentInteractionControllerViewControllerForPreview:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerViewControllerForPreview(
&self,
controller: &UIDocumentInteractionController,
) -> Retained<UIViewController>;
#[cfg(feature = "objc2-core-foundation")]
#[optional]
#[unsafe(method(documentInteractionControllerRectForPreview:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerRectForPreview(
&self,
controller: &UIDocumentInteractionController,
) -> CGRect;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[unsafe(method(documentInteractionControllerViewForPreview:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerViewForPreview(
&self,
controller: &UIDocumentInteractionController,
) -> Option<Retained<UIView>>;
#[optional]
#[unsafe(method(documentInteractionControllerWillBeginPreview:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerWillBeginPreview(
&self,
controller: &UIDocumentInteractionController,
);
#[optional]
#[unsafe(method(documentInteractionControllerDidEndPreview:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerDidEndPreview(
&self,
controller: &UIDocumentInteractionController,
);
#[optional]
#[unsafe(method(documentInteractionControllerWillPresentOptionsMenu:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerWillPresentOptionsMenu(
&self,
controller: &UIDocumentInteractionController,
);
#[optional]
#[unsafe(method(documentInteractionControllerDidDismissOptionsMenu:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerDidDismissOptionsMenu(
&self,
controller: &UIDocumentInteractionController,
);
#[optional]
#[unsafe(method(documentInteractionControllerWillPresentOpenInMenu:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerWillPresentOpenInMenu(
&self,
controller: &UIDocumentInteractionController,
);
#[optional]
#[unsafe(method(documentInteractionControllerDidDismissOpenInMenu:))]
#[unsafe(method_family = none)]
fn documentInteractionControllerDidDismissOpenInMenu(
&self,
controller: &UIDocumentInteractionController,
);
#[optional]
#[unsafe(method(documentInteractionController:willBeginSendingToApplication:))]
#[unsafe(method_family = none)]
fn documentInteractionController_willBeginSendingToApplication(
&self,
controller: &UIDocumentInteractionController,
application: Option<&NSString>,
);
#[optional]
#[unsafe(method(documentInteractionController:didEndSendingToApplication:))]
#[unsafe(method_family = none)]
fn documentInteractionController_didEndSendingToApplication(
&self,
controller: &UIDocumentInteractionController,
application: Option<&NSString>,
);
#[deprecated]
#[optional]
#[unsafe(method(documentInteractionController:canPerformAction:))]
#[unsafe(method_family = none)]
unsafe fn documentInteractionController_canPerformAction(
&self,
controller: &UIDocumentInteractionController,
action: Option<Sel>,
) -> bool;
#[deprecated]
#[optional]
#[unsafe(method(documentInteractionController:performAction:))]
#[unsafe(method_family = none)]
unsafe fn documentInteractionController_performAction(
&self,
controller: &UIDocumentInteractionController,
action: Option<Sel>,
) -> bool;
}
);