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 unsafe 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 unsafe 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 unsafe 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 unsafe fn isFindNavigatorVisible(&self) -> bool;
75
76 #[cfg(feature = "UIFindSession")]
77 #[unsafe(method(activeFindSession))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn activeFindSession(&self) -> Option<Retained<UIFindSession>>;
81
82 #[unsafe(method(searchText))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn searchText(&self) -> Option<Retained<NSString>>;
86
87 #[unsafe(method(setSearchText:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setSearchText(&self, search_text: Option<&NSString>);
91
92 #[unsafe(method(replacementText))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn replacementText(&self) -> Option<Retained<NSString>>;
96
97 #[unsafe(method(setReplacementText:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setReplacementText(&self, replacement_text: Option<&NSString>);
101
102 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
103 #[unsafe(method(optionsMenuProvider))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn optionsMenuProvider(
109 &self,
110 ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> *mut UIMenu>;
111
112 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
113 #[unsafe(method(setOptionsMenuProvider:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn setOptionsMenuProvider(
117 &self,
118 options_menu_provider: Option<
119 &block2::DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> *mut UIMenu>,
120 >,
121 );
122
123 #[unsafe(method(delegate))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn delegate(
127 &self,
128 ) -> Option<Retained<ProtocolObject<dyn UIFindInteractionDelegate>>>;
129
130 #[unsafe(method(initWithSessionDelegate:))]
132 #[unsafe(method_family = init)]
133 pub unsafe fn initWithSessionDelegate(
134 this: Allocated<Self>,
135 session_delegate: &ProtocolObject<dyn UIFindInteractionDelegate>,
136 ) -> Retained<Self>;
137
138 #[unsafe(method(presentFindNavigatorShowingReplace:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn presentFindNavigatorShowingReplace(&self, showing_replace: bool);
146
147 #[unsafe(method(dismissFindNavigator))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn dismissFindNavigator(&self);
151
152 #[unsafe(method(findNext))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn findNext(&self);
156
157 #[unsafe(method(findPrevious))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn findPrevious(&self);
161
162 #[unsafe(method(updateResultCount))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn updateResultCount(&self);
166
167 #[unsafe(method(new))]
168 #[unsafe(method_family = new)]
169 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
170
171 #[unsafe(method(init))]
172 #[unsafe(method_family = init)]
173 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
174 );
175}