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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextpastedelegate?language=objc)
    pub unsafe trait UITextPasteDelegate: NSObjectProtocol + MainThreadOnly {
        #[cfg(all(
            feature = "UIPasteConfigurationSupporting",
            feature = "UITextPasteConfigurationSupporting"
        ))]
        #[optional]
        #[unsafe(method(textPasteConfigurationSupporting:transformPasteItem:))]
        #[unsafe(method_family = none)]
        fn textPasteConfigurationSupporting_transformPasteItem(
            &self,
            text_paste_configuration_supporting: &ProtocolObject<
                dyn UITextPasteConfigurationSupporting,
            >,
            item: &ProtocolObject<dyn UITextPasteItem>,
        );

        #[cfg(all(
            feature = "UIPasteConfigurationSupporting",
            feature = "UITextInput",
            feature = "UITextPasteConfigurationSupporting"
        ))]
        #[optional]
        #[unsafe(method(textPasteConfigurationSupporting:combineItemAttributedStrings:forRange:))]
        #[unsafe(method_family = none)]
        fn textPasteConfigurationSupporting_combineItemAttributedStrings_forRange(
            &self,
            text_paste_configuration_supporting: &ProtocolObject<
                dyn UITextPasteConfigurationSupporting,
            >,
            item_strings: &NSArray<NSAttributedString>,
            text_range: &UITextRange,
        ) -> Retained<NSAttributedString>;

        #[cfg(all(
            feature = "UIPasteConfigurationSupporting",
            feature = "UITextInput",
            feature = "UITextPasteConfigurationSupporting"
        ))]
        #[optional]
        #[unsafe(method(textPasteConfigurationSupporting:performPasteOfAttributedString:toRange:))]
        #[unsafe(method_family = none)]
        fn textPasteConfigurationSupporting_performPasteOfAttributedString_toRange(
            &self,
            text_paste_configuration_supporting: &ProtocolObject<
                dyn UITextPasteConfigurationSupporting,
            >,
            attributed_string: &NSAttributedString,
            text_range: &UITextRange,
        ) -> Retained<UITextRange>;

        #[cfg(all(
            feature = "UIPasteConfigurationSupporting",
            feature = "UITextInput",
            feature = "UITextPasteConfigurationSupporting"
        ))]
        #[optional]
        #[unsafe(method(textPasteConfigurationSupporting:shouldAnimatePasteOfAttributedString:toRange:))]
        #[unsafe(method_family = none)]
        fn textPasteConfigurationSupporting_shouldAnimatePasteOfAttributedString_toRange(
            &self,
            text_paste_configuration_supporting: &ProtocolObject<
                dyn UITextPasteConfigurationSupporting,
            >,
            attributed_string: &NSAttributedString,
            text_range: &UITextRange,
        ) -> bool;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextpasteitem?language=objc)
    pub unsafe trait UITextPasteItem: NSObjectProtocol + MainThreadOnly {
        #[unsafe(method(itemProvider))]
        #[unsafe(method_family = none)]
        fn itemProvider(&self) -> Retained<NSItemProvider>;

        #[unsafe(method(localObject))]
        #[unsafe(method_family = none)]
        fn localObject(&self) -> Option<Retained<AnyObject>>;

        #[unsafe(method(defaultAttributes))]
        #[unsafe(method_family = none)]
        fn defaultAttributes(&self) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;

        #[unsafe(method(setStringResult:))]
        #[unsafe(method_family = none)]
        fn setStringResult(&self, string: &NSString);

        #[unsafe(method(setAttributedStringResult:))]
        #[unsafe(method_family = none)]
        fn setAttributedStringResult(&self, string: &NSAttributedString);

        #[cfg(feature = "NSTextAttachment")]
        #[unsafe(method(setAttachmentResult:))]
        #[unsafe(method_family = none)]
        fn setAttachmentResult(&self, text_attachment: &NSTextAttachment);

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

        #[unsafe(method(setDefaultResult))]
        #[unsafe(method_family = none)]
        fn setDefaultResult(&self);
    }
);
