//! 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 crate::*;

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

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSCoding for NSExtensionItem {}
);

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSCopying for NSExtensionItem {}
);

#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSExtensionItem {
    type Result = Self;
}

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

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSSecureCoding for NSExtensionItem {}
);

impl NSExtensionItem {
    extern_methods!(
        #[cfg(feature = "NSAttributedString")]
        #[unsafe(method(attributedTitle))]
        #[unsafe(method_family = none)]
        pub fn attributedTitle(&self) -> Option<Retained<NSAttributedString>>;

        #[cfg(feature = "NSAttributedString")]
        /// Setter for [`attributedTitle`][Self::attributedTitle].
        ///
        /// This is [copied][crate::NSCopying::copy] when set.
        #[unsafe(method(setAttributedTitle:))]
        #[unsafe(method_family = none)]
        pub fn setAttributedTitle(&self, attributed_title: Option<&NSAttributedString>);

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

        #[cfg(feature = "NSAttributedString")]
        /// Setter for [`attributedContentText`][Self::attributedContentText].
        ///
        /// This is [copied][crate::NSCopying::copy] when set.
        #[unsafe(method(setAttributedContentText:))]
        #[unsafe(method_family = none)]
        pub fn setAttributedContentText(
            &self,
            attributed_content_text: Option<&NSAttributedString>,
        );

        #[cfg(all(feature = "NSArray", feature = "NSItemProvider"))]
        #[unsafe(method(attachments))]
        #[unsafe(method_family = none)]
        pub fn attachments(&self) -> Option<Retained<NSArray<NSItemProvider>>>;

        #[cfg(all(feature = "NSArray", feature = "NSItemProvider"))]
        /// Setter for [`attachments`][Self::attachments].
        ///
        /// This is [copied][crate::NSCopying::copy] when set.
        #[unsafe(method(setAttachments:))]
        #[unsafe(method_family = none)]
        pub fn setAttachments(&self, attachments: Option<&NSArray<NSItemProvider>>);

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

        #[cfg(feature = "NSDictionary")]
        /// Setter for [`userInfo`][Self::userInfo].
        ///
        /// This is [copied][crate::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `user_info` generic should be of the correct type.
        #[unsafe(method(setUserInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSExtensionItem {
    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 NSExtensionItem {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionitemattributedtitlekey?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionItemAttributedTitleKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionitemattributedcontenttextkey?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionItemAttributedContentTextKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionitemattachmentskey?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionItemAttachmentsKey: Option<&'static NSString>;
}
