objc2_ui_kit/generated/
UITextPasteDelegate.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextpastedelegate?language=objc)
12    pub unsafe trait UITextPasteDelegate: NSObjectProtocol + MainThreadOnly {
13        #[cfg(all(
14            feature = "UIPasteConfigurationSupporting",
15            feature = "UITextPasteConfigurationSupporting"
16        ))]
17        #[optional]
18        #[unsafe(method(textPasteConfigurationSupporting:transformPasteItem:))]
19        #[unsafe(method_family = none)]
20        fn textPasteConfigurationSupporting_transformPasteItem(
21            &self,
22            text_paste_configuration_supporting: &ProtocolObject<
23                dyn UITextPasteConfigurationSupporting,
24            >,
25            item: &ProtocolObject<dyn UITextPasteItem>,
26        );
27
28        #[cfg(all(
29            feature = "UIPasteConfigurationSupporting",
30            feature = "UITextInput",
31            feature = "UITextPasteConfigurationSupporting"
32        ))]
33        #[optional]
34        #[unsafe(method(textPasteConfigurationSupporting:combineItemAttributedStrings:forRange:))]
35        #[unsafe(method_family = none)]
36        fn textPasteConfigurationSupporting_combineItemAttributedStrings_forRange(
37            &self,
38            text_paste_configuration_supporting: &ProtocolObject<
39                dyn UITextPasteConfigurationSupporting,
40            >,
41            item_strings: &NSArray<NSAttributedString>,
42            text_range: &UITextRange,
43        ) -> Retained<NSAttributedString>;
44
45        #[cfg(all(
46            feature = "UIPasteConfigurationSupporting",
47            feature = "UITextInput",
48            feature = "UITextPasteConfigurationSupporting"
49        ))]
50        #[optional]
51        #[unsafe(method(textPasteConfigurationSupporting:performPasteOfAttributedString:toRange:))]
52        #[unsafe(method_family = none)]
53        fn textPasteConfigurationSupporting_performPasteOfAttributedString_toRange(
54            &self,
55            text_paste_configuration_supporting: &ProtocolObject<
56                dyn UITextPasteConfigurationSupporting,
57            >,
58            attributed_string: &NSAttributedString,
59            text_range: &UITextRange,
60        ) -> Retained<UITextRange>;
61
62        #[cfg(all(
63            feature = "UIPasteConfigurationSupporting",
64            feature = "UITextInput",
65            feature = "UITextPasteConfigurationSupporting"
66        ))]
67        #[optional]
68        #[unsafe(method(textPasteConfigurationSupporting:shouldAnimatePasteOfAttributedString:toRange:))]
69        #[unsafe(method_family = none)]
70        fn textPasteConfigurationSupporting_shouldAnimatePasteOfAttributedString_toRange(
71            &self,
72            text_paste_configuration_supporting: &ProtocolObject<
73                dyn UITextPasteConfigurationSupporting,
74            >,
75            attributed_string: &NSAttributedString,
76            text_range: &UITextRange,
77        ) -> bool;
78    }
79);
80
81extern_protocol!(
82    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextpasteitem?language=objc)
83    pub unsafe trait UITextPasteItem: NSObjectProtocol + MainThreadOnly {
84        #[unsafe(method(itemProvider))]
85        #[unsafe(method_family = none)]
86        fn itemProvider(&self) -> Retained<NSItemProvider>;
87
88        #[unsafe(method(localObject))]
89        #[unsafe(method_family = none)]
90        fn localObject(&self) -> Option<Retained<AnyObject>>;
91
92        #[unsafe(method(defaultAttributes))]
93        #[unsafe(method_family = none)]
94        fn defaultAttributes(&self) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
95
96        #[unsafe(method(setStringResult:))]
97        #[unsafe(method_family = none)]
98        fn setStringResult(&self, string: &NSString);
99
100        #[unsafe(method(setAttributedStringResult:))]
101        #[unsafe(method_family = none)]
102        fn setAttributedStringResult(&self, string: &NSAttributedString);
103
104        #[cfg(feature = "NSTextAttachment")]
105        #[unsafe(method(setAttachmentResult:))]
106        #[unsafe(method_family = none)]
107        fn setAttachmentResult(&self, text_attachment: &NSTextAttachment);
108
109        #[unsafe(method(setNoResult))]
110        #[unsafe(method_family = none)]
111        fn setNoResult(&self);
112
113        #[unsafe(method(setDefaultResult))]
114        #[unsafe(method_family = none)]
115        fn setDefaultResult(&self);
116    }
117);