use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActivitySectionTypes(pub NSUInteger);
bitflags::bitflags! {
impl UIActivitySectionTypes: NSUInteger {
#[doc(alias = "UIActivitySectionTypesNone")]
const None = 0;
#[doc(alias = "UIActivitySectionTypesPeopleSuggestions")]
const PeopleSuggestions = 1<<0;
}
}
unsafe impl Encode for UIActivitySectionTypes {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UIActivitySectionTypes {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(all(feature = "UIActivity", feature = "block2"))]
pub type UIActivityViewControllerCompletionHandler =
*mut block2::DynBlock<dyn Fn(*mut UIActivityType, Bool)>;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
pub type UIActivityViewControllerCompletionWithItemsHandler =
*mut block2::DynBlock<dyn Fn(*mut UIActivityType, Bool, *mut NSArray, *mut NSError)>;
extern_class!(
#[unsafe(super(UIViewController, UIResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UIActivityViewController;
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSCoding for UIActivityViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UIActivityViewController {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIActivityViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIContentContainer for UIActivityViewController {}
);
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIActivityViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIActivityViewController {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIActivityViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIActivityViewController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(feature = "UIActivity")]
#[unsafe(method(initWithActivityItems:applicationActivities:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithActivityItems_applicationActivities(
this: Allocated<Self>,
activity_items: &NSArray,
application_activities: Option<&NSArray<UIActivity>>,
) -> Retained<Self>;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[deprecated]
#[unsafe(method(completionHandler))]
#[unsafe(method_family = none)]
pub unsafe fn completionHandler(&self) -> UIActivityViewControllerCompletionHandler;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[deprecated]
#[unsafe(method(setCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setCompletionHandler(
&self,
completion_handler: UIActivityViewControllerCompletionHandler,
);
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[unsafe(method(completionWithItemsHandler))]
#[unsafe(method_family = none)]
pub unsafe fn completionWithItemsHandler(
&self,
) -> UIActivityViewControllerCompletionWithItemsHandler;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[unsafe(method(setCompletionWithItemsHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setCompletionWithItemsHandler(
&self,
completion_with_items_handler: UIActivityViewControllerCompletionWithItemsHandler,
);
#[cfg(feature = "UIActivity")]
#[unsafe(method(excludedActivityTypes))]
#[unsafe(method_family = none)]
pub fn excludedActivityTypes(&self) -> Option<Retained<NSArray<UIActivityType>>>;
#[cfg(feature = "UIActivity")]
#[unsafe(method(setExcludedActivityTypes:))]
#[unsafe(method_family = none)]
pub fn setExcludedActivityTypes(
&self,
excluded_activity_types: Option<&NSArray<UIActivityType>>,
);
#[unsafe(method(excludedActivitySectionTypes))]
#[unsafe(method_family = none)]
pub fn excludedActivitySectionTypes(&self) -> UIActivitySectionTypes;
#[unsafe(method(setExcludedActivitySectionTypes:))]
#[unsafe(method_family = none)]
pub fn setExcludedActivitySectionTypes(
&self,
excluded_activity_section_types: UIActivitySectionTypes,
);
#[unsafe(method(allowsProminentActivity))]
#[unsafe(method_family = none)]
pub fn allowsProminentActivity(&self) -> bool;
#[unsafe(method(setAllowsProminentActivity:))]
#[unsafe(method_family = none)]
pub fn setAllowsProminentActivity(&self, allows_prominent_activity: bool);
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIActivityViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIActivityViewController {
extern_methods!(
#[cfg(feature = "UIActivityItemsConfigurationReading")]
#[unsafe(method(initWithActivityItemsConfiguration:))]
#[unsafe(method_family = init)]
pub fn initWithActivityItemsConfiguration(
this: Allocated<Self>,
activity_items_configuration: &ProtocolObject<dyn UIActivityItemsConfigurationReading>,
) -> Retained<Self>;
);
}