objc2_ui_kit/generated/
UITextSelectionDisplayInteraction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait UITextSelectionDisplayInteractionDelegate:
13 NSObjectProtocol + MainThreadOnly
14 {
15 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
16 #[optional]
20 #[unsafe(method(selectionContainerViewBelowTextForSelectionDisplayInteraction:))]
21 #[unsafe(method_family = none)]
22 fn selectionContainerViewBelowTextForSelectionDisplayInteraction(
23 &self,
24 interaction: &UITextSelectionDisplayInteraction,
25 ) -> Option<Retained<UIView>>;
26 }
27);
28
29extern_class!(
30 #[unsafe(super(NSObject))]
39 #[thread_kind = MainThreadOnly]
40 #[derive(Debug, PartialEq, Eq, Hash)]
41 pub struct UITextSelectionDisplayInteraction;
42);
43
44extern_conformance!(
45 unsafe impl NSObjectProtocol for UITextSelectionDisplayInteraction {}
46);
47
48#[cfg(feature = "UIInteraction")]
49extern_conformance!(
50 unsafe impl UIInteraction for UITextSelectionDisplayInteraction {}
51);
52
53impl UITextSelectionDisplayInteraction {
54 extern_methods!(
55 #[unsafe(method(isActivated))]
57 #[unsafe(method_family = none)]
58 pub fn isActivated(&self) -> bool;
59
60 #[unsafe(method(setActivated:))]
62 #[unsafe(method_family = none)]
63 pub fn setActivated(&self, activated: bool);
64
65 #[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
66 #[unsafe(method(textInput))]
68 #[unsafe(method_family = none)]
69 pub fn textInput(&self) -> Option<Retained<ProtocolObject<dyn UITextInput>>>;
70
71 #[unsafe(method(delegate))]
74 #[unsafe(method_family = none)]
75 pub fn delegate(
76 &self,
77 ) -> Option<Retained<ProtocolObject<dyn UITextSelectionDisplayInteractionDelegate>>>;
78
79 #[cfg(all(
80 feature = "UIResponder",
81 feature = "UITextCursorView",
82 feature = "UIView"
83 ))]
84 #[unsafe(method(cursorView))]
86 #[unsafe(method_family = none)]
87 pub fn cursorView(&self) -> Retained<UIView>;
88
89 #[cfg(all(
90 feature = "UIResponder",
91 feature = "UITextCursorView",
92 feature = "UIView"
93 ))]
94 #[unsafe(method(setCursorView:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn setCursorView(&self, cursor_view: &UIView);
102
103 #[cfg(all(
104 feature = "UIResponder",
105 feature = "UITextSelectionHighlightView",
106 feature = "UIView"
107 ))]
108 #[unsafe(method(highlightView))]
110 #[unsafe(method_family = none)]
111 pub fn highlightView(&self) -> Retained<UIView>;
112
113 #[cfg(all(
114 feature = "UIResponder",
115 feature = "UITextSelectionHighlightView",
116 feature = "UIView"
117 ))]
118 #[unsafe(method(setHighlightView:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setHighlightView(&self, highlight_view: &UIView);
126
127 #[cfg(all(
128 feature = "UIResponder",
129 feature = "UITextSelectionHandleView",
130 feature = "UIView"
131 ))]
132 #[unsafe(method(handleViews))]
138 #[unsafe(method_family = none)]
139 pub fn handleViews(&self) -> Retained<NSArray<UIView>>;
140
141 #[cfg(all(
142 feature = "UIResponder",
143 feature = "UITextSelectionHandleView",
144 feature = "UIView"
145 ))]
146 #[unsafe(method(setHandleViews:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setHandleViews(&self, handle_views: &NSArray<UIView>);
154
155 #[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
156 #[unsafe(method(initWithTextInput:delegate:))]
159 #[unsafe(method_family = init)]
160 pub fn initWithTextInput_delegate(
161 this: Allocated<Self>,
162 text_input: &ProtocolObject<dyn UITextInput>,
163 delegate: &ProtocolObject<dyn UITextSelectionDisplayInteractionDelegate>,
164 ) -> Retained<Self>;
165
166 #[unsafe(method(layoutManagedSubviews))]
168 #[unsafe(method_family = none)]
169 pub fn layoutManagedSubviews(&self);
170
171 #[unsafe(method(setNeedsSelectionUpdate))]
173 #[unsafe(method_family = none)]
174 pub fn setNeedsSelectionUpdate(&self);
175
176 #[unsafe(method(init))]
177 #[unsafe(method_family = init)]
178 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
179
180 #[unsafe(method(new))]
181 #[unsafe(method_family = new)]
182 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
183 );
184}