1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    pub unsafe trait UITextPasteDelegate: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(all(
            feature = "UIPasteConfigurationSupporting",
            feature = "UITextPasteConfigurationSupporting"
        ))]
        #[optional]
        #[method(textPasteConfigurationSupporting:transformPasteItem:)]
        unsafe fn textPasteConfigurationSupporting_transformPasteItem(
            &self,
            text_paste_configuration_supporting: &ProtocolObject<
                dyn UITextPasteConfigurationSupporting,
            >,
            item: &ProtocolObject<dyn UITextPasteItem>,
        );

        #[cfg(all(
            feature = "UIPasteConfigurationSupporting",
            feature = "UITextInput",
            feature = "UITextPasteConfigurationSupporting"
        ))]
        #[optional]
        #[method_id(@__retain_semantics Other textPasteConfigurationSupporting:combineItemAttributedStrings:forRange:)]
        unsafe 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]
        #[method_id(@__retain_semantics Other textPasteConfigurationSupporting:performPasteOfAttributedString:toRange:)]
        unsafe 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]
        #[method(textPasteConfigurationSupporting:shouldAnimatePasteOfAttributedString:toRange:)]
        unsafe fn textPasteConfigurationSupporting_shouldAnimatePasteOfAttributedString_toRange(
            &self,
            text_paste_configuration_supporting: &ProtocolObject<
                dyn UITextPasteConfigurationSupporting,
            >,
            attributed_string: &NSAttributedString,
            text_range: &UITextRange,
        ) -> bool;
    }

    unsafe impl ProtocolType for dyn UITextPasteDelegate {}
);

extern_protocol!(
    pub unsafe trait UITextPasteItem: NSObjectProtocol + IsMainThreadOnly {
        #[method_id(@__retain_semantics Other itemProvider)]
        unsafe fn itemProvider(&self) -> Retained<NSItemProvider>;

        #[method_id(@__retain_semantics Other localObject)]
        unsafe fn localObject(&self) -> Option<Retained<AnyObject>>;

        #[method_id(@__retain_semantics Other defaultAttributes)]
        unsafe fn defaultAttributes(
            &self,
        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;

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

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

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

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

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

    unsafe impl ProtocolType for dyn UITextPasteItem {}
);