//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytype?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActivityType = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeposttofacebook?language=objc)
    pub static UIActivityTypePostToFacebook: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeposttotwitter?language=objc)
    pub static UIActivityTypePostToTwitter: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeposttoweibo?language=objc)
    pub static UIActivityTypePostToWeibo: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypemessage?language=objc)
    pub static UIActivityTypeMessage: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypemail?language=objc)
    pub static UIActivityTypeMail: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeprint?language=objc)
    pub static UIActivityTypePrint: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypecopytopasteboard?language=objc)
    pub static UIActivityTypeCopyToPasteboard: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeassigntocontact?language=objc)
    pub static UIActivityTypeAssignToContact: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypesavetocameraroll?language=objc)
    pub static UIActivityTypeSaveToCameraRoll: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeaddtoreadinglist?language=objc)
    pub static UIActivityTypeAddToReadingList: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeposttoflickr?language=objc)
    pub static UIActivityTypePostToFlickr: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeposttovimeo?language=objc)
    pub static UIActivityTypePostToVimeo: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeposttotencentweibo?language=objc)
    pub static UIActivityTypePostToTencentWeibo: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeairdrop?language=objc)
    pub static UIActivityTypeAirDrop: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeopeninibooks?language=objc)
    pub static UIActivityTypeOpenInIBooks: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypemarkupaspdf?language=objc)
    pub static UIActivityTypeMarkupAsPDF: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeshareplay?language=objc)
    pub static UIActivityTypeSharePlay: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypecollaborationinvitewithlink?language=objc)
    pub static UIActivityTypeCollaborationInviteWithLink: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypecollaborationcopylink?language=objc)
    pub static UIActivityTypeCollaborationCopyLink: &'static UIActivityType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitytypeaddtohomescreen?language=objc)
    pub static UIActivityTypeAddToHomeScreen: &'static UIActivityType;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivitycategory?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActivityCategory(pub NSInteger);
impl UIActivityCategory {
    #[doc(alias = "UIActivityCategoryAction")]
    pub const Action: Self = Self(0);
    #[doc(alias = "UIActivityCategoryShare")]
    pub const Share: Self = Self(1);
}

unsafe impl Encode for UIActivityCategory {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIActivityCategory {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivity?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIActivity;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for UIActivity {}
);

impl UIActivity {
    extern_methods!(
        #[unsafe(method(activityCategory))]
        #[unsafe(method_family = none)]
        pub fn activityCategory() -> UIActivityCategory;

        #[unsafe(method(activityType))]
        #[unsafe(method_family = none)]
        pub fn activityType(&self) -> Option<Retained<UIActivityType>>;

        #[unsafe(method(activityTitle))]
        #[unsafe(method_family = none)]
        pub fn activityTitle(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "UIImage")]
        #[unsafe(method(activityImage))]
        #[unsafe(method_family = none)]
        pub fn activityImage(&self) -> Option<Retained<UIImage>>;

        /// # Safety
        ///
        /// `activity_items` generic should be of the correct type.
        #[unsafe(method(canPerformWithActivityItems:))]
        #[unsafe(method_family = none)]
        pub unsafe fn canPerformWithActivityItems(&self, activity_items: &NSArray) -> bool;

        /// # Safety
        ///
        /// `activity_items` generic should be of the correct type.
        #[unsafe(method(prepareWithActivityItems:))]
        #[unsafe(method_family = none)]
        pub unsafe fn prepareWithActivityItems(&self, activity_items: &NSArray);

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[unsafe(method(activityViewController))]
        #[unsafe(method_family = none)]
        pub fn activityViewController(
            &self,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UIViewController>>;

        #[unsafe(method(performActivity))]
        #[unsafe(method_family = none)]
        pub fn performActivity(&self);

        #[unsafe(method(activityDidFinish:))]
        #[unsafe(method_family = none)]
        pub fn activityDidFinish(&self, completed: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl UIActivity {
    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() -> Retained<Self>;
    );
}

impl DefaultRetained for UIActivity {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}
