objc2_ui_kit/generated/
UIFindInteraction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait UIFindInteractionDelegate: NSObjectProtocol + MainThreadOnly {
13 #[cfg(all(feature = "UIFindSession", feature = "UIResponder", feature = "UIView"))]
14 #[unsafe(method(findInteraction:sessionForView:))]
17 #[unsafe(method_family = none)]
18 fn findInteraction_sessionForView(
19 &self,
20 interaction: &UIFindInteraction,
21 view: &UIView,
22 ) -> Option<Retained<UIFindSession>>;
23
24 #[cfg(feature = "UIFindSession")]
25 #[optional]
29 #[unsafe(method(findInteraction:didBeginFindSession:))]
30 #[unsafe(method_family = none)]
31 fn findInteraction_didBeginFindSession(
32 &self,
33 interaction: &UIFindInteraction,
34 session: &UIFindSession,
35 );
36
37 #[cfg(feature = "UIFindSession")]
38 #[optional]
42 #[unsafe(method(findInteraction:didEndFindSession:))]
43 #[unsafe(method_family = none)]
44 fn findInteraction_didEndFindSession(
45 &self,
46 interaction: &UIFindInteraction,
47 session: &UIFindSession,
48 );
49 }
50);
51
52extern_class!(
53 #[unsafe(super(NSObject))]
55 #[thread_kind = MainThreadOnly]
56 #[derive(Debug, PartialEq, Eq, Hash)]
57 pub struct UIFindInteraction;
58);
59
60extern_conformance!(
61 unsafe impl NSObjectProtocol for UIFindInteraction {}
62);
63
64#[cfg(feature = "UIInteraction")]
65extern_conformance!(
66 unsafe impl UIInteraction for UIFindInteraction {}
67);
68
69impl UIFindInteraction {
70 extern_methods!(
71 #[unsafe(method(isFindNavigatorVisible))]
73 #[unsafe(method_family = none)]
74 pub fn isFindNavigatorVisible(&self) -> bool;
75
76 #[cfg(feature = "UIFindSession")]
77 #[unsafe(method(activeFindSession))]
79 #[unsafe(method_family = none)]
80 pub fn activeFindSession(&self) -> Option<Retained<UIFindSession>>;
81
82 #[unsafe(method(searchText))]
84 #[unsafe(method_family = none)]
85 pub fn searchText(&self) -> Option<Retained<NSString>>;
86
87 #[unsafe(method(setSearchText:))]
91 #[unsafe(method_family = none)]
92 pub fn setSearchText(&self, search_text: Option<&NSString>);
93
94 #[unsafe(method(replacementText))]
96 #[unsafe(method_family = none)]
97 pub fn replacementText(&self) -> Option<Retained<NSString>>;
98
99 #[unsafe(method(setReplacementText:))]
103 #[unsafe(method_family = none)]
104 pub fn setReplacementText(&self, replacement_text: Option<&NSString>);
105
106 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
107 #[unsafe(method(optionsMenuProvider))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn optionsMenuProvider(
117 &self,
118 ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> *mut UIMenu>;
119
120 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
121 #[unsafe(method(setOptionsMenuProvider:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setOptionsMenuProvider(
131 &self,
132 options_menu_provider: Option<
133 &block2::DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> *mut UIMenu>,
134 >,
135 );
136
137 #[unsafe(method(delegate))]
139 #[unsafe(method_family = none)]
140 pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UIFindInteractionDelegate>>>;
141
142 #[unsafe(method(initWithSessionDelegate:))]
144 #[unsafe(method_family = init)]
145 pub fn initWithSessionDelegate(
146 this: Allocated<Self>,
147 session_delegate: &ProtocolObject<dyn UIFindInteractionDelegate>,
148 ) -> Retained<Self>;
149
150 #[unsafe(method(presentFindNavigatorShowingReplace:))]
156 #[unsafe(method_family = none)]
157 pub fn presentFindNavigatorShowingReplace(&self, showing_replace: bool);
158
159 #[unsafe(method(dismissFindNavigator))]
161 #[unsafe(method_family = none)]
162 pub fn dismissFindNavigator(&self);
163
164 #[unsafe(method(findNext))]
166 #[unsafe(method_family = none)]
167 pub fn findNext(&self);
168
169 #[unsafe(method(findPrevious))]
171 #[unsafe(method_family = none)]
172 pub fn findPrevious(&self);
173
174 #[unsafe(method(updateResultCount))]
176 #[unsafe(method_family = none)]
177 pub fn updateResultCount(&self);
178
179 #[unsafe(method(new))]
180 #[unsafe(method_family = new)]
181 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
182
183 #[unsafe(method(init))]
184 #[unsafe(method_family = init)]
185 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
186 );
187}