//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivityitemsource?language=objc)
    pub unsafe trait UIActivityItemSource: NSObjectProtocol {
        #[cfg(all(
            feature = "UIActivityViewController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[unsafe(method(activityViewControllerPlaceholderItem:))]
        #[unsafe(method_family = none)]
        fn activityViewControllerPlaceholderItem(
            &self,
            activity_view_controller: &UIActivityViewController,
        ) -> Retained<AnyObject>;

        #[cfg(all(
            feature = "UIActivity",
            feature = "UIActivityViewController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[unsafe(method(activityViewController:itemForActivityType:))]
        #[unsafe(method_family = none)]
        fn activityViewController_itemForActivityType(
            &self,
            activity_view_controller: &UIActivityViewController,
            activity_type: Option<&UIActivityType>,
        ) -> Option<Retained<AnyObject>>;

        #[cfg(all(
            feature = "UIActivity",
            feature = "UIActivityViewController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(activityViewController:subjectForActivityType:))]
        #[unsafe(method_family = none)]
        fn activityViewController_subjectForActivityType(
            &self,
            activity_view_controller: &UIActivityViewController,
            activity_type: Option<&UIActivityType>,
        ) -> Retained<NSString>;

        #[cfg(all(
            feature = "UIActivity",
            feature = "UIActivityViewController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(activityViewController:dataTypeIdentifierForActivityType:))]
        #[unsafe(method_family = none)]
        fn activityViewController_dataTypeIdentifierForActivityType(
            &self,
            activity_view_controller: &UIActivityViewController,
            activity_type: Option<&UIActivityType>,
        ) -> Retained<NSString>;

        #[cfg(all(
            feature = "UIActivity",
            feature = "UIActivityViewController",
            feature = "UIImage",
            feature = "UIResponder",
            feature = "UIViewController",
            feature = "objc2-core-foundation"
        ))]
        #[optional]
        #[unsafe(method(activityViewController:thumbnailImageForActivityType:suggestedSize:))]
        #[unsafe(method_family = none)]
        fn activityViewController_thumbnailImageForActivityType_suggestedSize(
            &self,
            activity_view_controller: &UIActivityViewController,
            activity_type: Option<&UIActivityType>,
            size: CGSize,
        ) -> Option<Retained<UIImage>>;
    }
);

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

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

extern_conformance!(
    unsafe impl UIActivityItemSource for UIActivityItemProvider {}
);

impl UIActivityItemProvider {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// # Safety
        ///
        /// `placeholder_item` should be of the correct type.
        #[unsafe(method(initWithPlaceholderItem:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPlaceholderItem(
            this: Allocated<Self>,
            placeholder_item: &AnyObject,
        ) -> Retained<Self>;

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(placeholderItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn placeholderItem(&self) -> Option<Retained<AnyObject>>;

        #[cfg(feature = "UIActivity")]
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(activityType))]
        #[unsafe(method_family = none)]
        pub unsafe fn activityType(&self) -> Option<Retained<UIActivityType>>;

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(item))]
        #[unsafe(method_family = none)]
        pub unsafe fn item(&self) -> Retained<AnyObject>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIActivityItemProvider {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
