//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipreferredpresentationstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPreferredPresentationStyle(pub NSInteger);
impl UIPreferredPresentationStyle {
    #[doc(alias = "UIPreferredPresentationStyleUnspecified")]
    pub const Unspecified: Self = Self(0);
    #[doc(alias = "UIPreferredPresentationStyleInline")]
    pub const Inline: Self = Self(1);
    #[doc(alias = "UIPreferredPresentationStyleAttachment")]
    pub const Attachment: Self = Self(2);
}

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

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

mod private_NSItemProviderUIKitAdditions {
    pub trait Sealed {}
}

/// Category "UIKitAdditions" on [`NSItemProvider`].
#[doc(alias = "UIKitAdditions")]
pub unsafe trait NSItemProviderUIKitAdditions:
    ClassType + Sized + private_NSItemProviderUIKitAdditions::Sealed
{
    extern_methods!(
        #[unsafe(method(teamData))]
        #[unsafe(method_family = none)]
        fn teamData(&self) -> Option<Retained<NSData>>;

        /// Setter for [`teamData`][Self::teamData].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTeamData:))]
        #[unsafe(method_family = none)]
        fn setTeamData(&self, team_data: Option<&NSData>);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredPresentationSize))]
        #[unsafe(method_family = none)]
        fn preferredPresentationSize(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredPresentationSize`][Self::preferredPresentationSize].
        #[unsafe(method(setPreferredPresentationSize:))]
        #[unsafe(method_family = none)]
        fn setPreferredPresentationSize(&self, preferred_presentation_size: CGSize);

        #[unsafe(method(preferredPresentationStyle))]
        #[unsafe(method_family = none)]
        fn preferredPresentationStyle(&self) -> UIPreferredPresentationStyle;

        /// Setter for [`preferredPresentationStyle`][Self::preferredPresentationStyle].
        #[unsafe(method(setPreferredPresentationStyle:))]
        #[unsafe(method_family = none)]
        fn setPreferredPresentationStyle(
            &self,
            preferred_presentation_style: UIPreferredPresentationStyle,
        );
    );
}

impl private_NSItemProviderUIKitAdditions::Sealed for NSItemProvider {}
unsafe impl NSItemProviderUIKitAdditions for NSItemProvider {}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiitemproviderpresentationsizeproviding?language=objc)
    pub unsafe trait UIItemProviderPresentationSizeProviding:
        NSObjectProtocol + MainThreadOnly
    {
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredPresentationSizeForItemProvider))]
        #[unsafe(method_family = none)]
        fn preferredPresentationSizeForItemProvider(&self) -> CGSize;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiitemproviderreadingaugmentationproviding?language=objc)
    pub unsafe trait UIItemProviderReadingAugmentationProviding {
        /// # Safety
        ///
        /// `requested_class` probably has further requirements.
        #[unsafe(method(objectWithItemProviderData:typeIdentifier:requestedClass:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn objectWithItemProviderData_typeIdentifier_requestedClass_error(
            data: &NSData,
            type_identifier: &NSString,
            requested_class: &AnyClass,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        #[unsafe(method(additionalLeadingReadableTypeIdentifiersForItemProvider))]
        #[unsafe(method_family = none)]
        fn additionalLeadingReadableTypeIdentifiersForItemProvider() -> Retained<NSArray<NSString>>;

        #[unsafe(method(additionalTrailingReadableTypeIdentifiersForItemProvider))]
        #[unsafe(method_family = none)]
        fn additionalTrailingReadableTypeIdentifiersForItemProvider() -> Retained<NSArray<NSString>>;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiitemproviderreadingaugmentationdesignating?language=objc)
    pub unsafe trait UIItemProviderReadingAugmentationDesignating:
        NSItemProviderReading
    {
        #[unsafe(method(_ui_augmentingNSItemProviderReadingClass))]
        #[unsafe(method_family = none)]
        fn _ui_augmentingNSItemProviderReadingClass() -> &'static AnyClass;
    }
);
