objc2_ui_kit/generated/
UISearchDisplayController.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_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisearchdisplaycontroller?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
16    pub struct UISearchDisplayController;
17);
18
19unsafe impl NSObjectProtocol for UISearchDisplayController {}
20
21impl UISearchDisplayController {
22    extern_methods!(
23        #[cfg(all(
24            feature = "UIResponder",
25            feature = "UISearchBar",
26            feature = "UIView",
27            feature = "UIViewController"
28        ))]
29        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
30        #[unsafe(method(initWithSearchBar:contentsController:))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn initWithSearchBar_contentsController(
33            this: Allocated<Self>,
34            search_bar: &UISearchBar,
35            view_controller: &UIViewController,
36        ) -> Retained<Self>;
37
38        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
39        #[unsafe(method(delegate))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn delegate(
42            &self,
43        ) -> Option<Retained<ProtocolObject<dyn UISearchDisplayDelegate>>>;
44
45        /// Setter for [`delegate`][Self::delegate].
46        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
47        #[unsafe(method(setDelegate:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setDelegate(
50            &self,
51            delegate: Option<&ProtocolObject<dyn UISearchDisplayDelegate>>,
52        );
53
54        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
55        #[unsafe(method(isActive))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn isActive(&self) -> bool;
58
59        /// Setter for [`isActive`][Self::isActive].
60        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
61        #[unsafe(method(setActive:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setActive(&self, active: bool);
64
65        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
66        #[unsafe(method(setActive:animated:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setActive_animated(&self, visible: bool, animated: bool);
69
70        #[cfg(all(feature = "UIResponder", feature = "UISearchBar", feature = "UIView"))]
71        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
72        #[unsafe(method(searchBar))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn searchBar(&self) -> Retained<UISearchBar>;
75
76        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
77        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
78        #[unsafe(method(searchContentsController))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn searchContentsController(&self) -> Retained<UIViewController>;
81
82        #[cfg(all(
83            feature = "UIResponder",
84            feature = "UIScrollView",
85            feature = "UITableView",
86            feature = "UIView"
87        ))]
88        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
89        #[unsafe(method(searchResultsTableView))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn searchResultsTableView(&self) -> Retained<UITableView>;
92
93        #[cfg(feature = "UITableView")]
94        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
95        #[unsafe(method(searchResultsDataSource))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn searchResultsDataSource(
98            &self,
99        ) -> Option<Retained<ProtocolObject<dyn UITableViewDataSource>>>;
100
101        #[cfg(feature = "UITableView")]
102        /// This is a [weak property][objc2::topics::weak_property].
103        /// Setter for [`searchResultsDataSource`][Self::searchResultsDataSource].
104        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
105        #[unsafe(method(setSearchResultsDataSource:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn setSearchResultsDataSource(
108            &self,
109            search_results_data_source: Option<&ProtocolObject<dyn UITableViewDataSource>>,
110        );
111
112        #[cfg(all(feature = "UIScrollView", feature = "UITableView"))]
113        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
114        #[unsafe(method(searchResultsDelegate))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn searchResultsDelegate(
117            &self,
118        ) -> Option<Retained<ProtocolObject<dyn UITableViewDelegate>>>;
119
120        #[cfg(all(feature = "UIScrollView", feature = "UITableView"))]
121        /// This is a [weak property][objc2::topics::weak_property].
122        /// Setter for [`searchResultsDelegate`][Self::searchResultsDelegate].
123        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
124        #[unsafe(method(setSearchResultsDelegate:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setSearchResultsDelegate(
127            &self,
128            search_results_delegate: Option<&ProtocolObject<dyn UITableViewDelegate>>,
129        );
130
131        #[unsafe(method(searchResultsTitle))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn searchResultsTitle(&self) -> Option<Retained<NSString>>;
134
135        /// Setter for [`searchResultsTitle`][Self::searchResultsTitle].
136        #[unsafe(method(setSearchResultsTitle:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn setSearchResultsTitle(&self, search_results_title: Option<&NSString>);
139
140        #[unsafe(method(displaysSearchBarInNavigationBar))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn displaysSearchBarInNavigationBar(&self) -> bool;
143
144        /// Setter for [`displaysSearchBarInNavigationBar`][Self::displaysSearchBarInNavigationBar].
145        #[unsafe(method(setDisplaysSearchBarInNavigationBar:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn setDisplaysSearchBarInNavigationBar(
148            &self,
149            displays_search_bar_in_navigation_bar: bool,
150        );
151
152        #[cfg(feature = "UINavigationItem")]
153        #[unsafe(method(navigationItem))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn navigationItem(&self) -> Option<Retained<UINavigationItem>>;
156    );
157}
158
159/// Methods declared on superclass `NSObject`.
160impl UISearchDisplayController {
161    extern_methods!(
162        #[unsafe(method(init))]
163        #[unsafe(method_family = init)]
164        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
165
166        #[unsafe(method(new))]
167        #[unsafe(method_family = new)]
168        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
169    );
170}
171
172extern_protocol!(
173    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisearchdisplaydelegate?language=objc)
174    pub unsafe trait UISearchDisplayDelegate: NSObjectProtocol + MainThreadOnly {
175        #[deprecated]
176        #[optional]
177        #[unsafe(method(searchDisplayControllerWillBeginSearch:))]
178        #[unsafe(method_family = none)]
179        unsafe fn searchDisplayControllerWillBeginSearch(
180            &self,
181            controller: &UISearchDisplayController,
182        );
183
184        #[deprecated]
185        #[optional]
186        #[unsafe(method(searchDisplayControllerDidBeginSearch:))]
187        #[unsafe(method_family = none)]
188        unsafe fn searchDisplayControllerDidBeginSearch(
189            &self,
190            controller: &UISearchDisplayController,
191        );
192
193        #[deprecated]
194        #[optional]
195        #[unsafe(method(searchDisplayControllerWillEndSearch:))]
196        #[unsafe(method_family = none)]
197        unsafe fn searchDisplayControllerWillEndSearch(
198            &self,
199            controller: &UISearchDisplayController,
200        );
201
202        #[deprecated]
203        #[optional]
204        #[unsafe(method(searchDisplayControllerDidEndSearch:))]
205        #[unsafe(method_family = none)]
206        unsafe fn searchDisplayControllerDidEndSearch(
207            &self,
208            controller: &UISearchDisplayController,
209        );
210
211        #[cfg(all(
212            feature = "UIResponder",
213            feature = "UIScrollView",
214            feature = "UITableView",
215            feature = "UIView"
216        ))]
217        #[deprecated]
218        #[optional]
219        #[unsafe(method(searchDisplayController:didLoadSearchResultsTableView:))]
220        #[unsafe(method_family = none)]
221        unsafe fn searchDisplayController_didLoadSearchResultsTableView(
222            &self,
223            controller: &UISearchDisplayController,
224            table_view: &UITableView,
225        );
226
227        #[cfg(all(
228            feature = "UIResponder",
229            feature = "UIScrollView",
230            feature = "UITableView",
231            feature = "UIView"
232        ))]
233        #[deprecated]
234        #[optional]
235        #[unsafe(method(searchDisplayController:willUnloadSearchResultsTableView:))]
236        #[unsafe(method_family = none)]
237        unsafe fn searchDisplayController_willUnloadSearchResultsTableView(
238            &self,
239            controller: &UISearchDisplayController,
240            table_view: &UITableView,
241        );
242
243        #[cfg(all(
244            feature = "UIResponder",
245            feature = "UIScrollView",
246            feature = "UITableView",
247            feature = "UIView"
248        ))]
249        #[deprecated]
250        #[optional]
251        #[unsafe(method(searchDisplayController:willShowSearchResultsTableView:))]
252        #[unsafe(method_family = none)]
253        unsafe fn searchDisplayController_willShowSearchResultsTableView(
254            &self,
255            controller: &UISearchDisplayController,
256            table_view: &UITableView,
257        );
258
259        #[cfg(all(
260            feature = "UIResponder",
261            feature = "UIScrollView",
262            feature = "UITableView",
263            feature = "UIView"
264        ))]
265        #[deprecated]
266        #[optional]
267        #[unsafe(method(searchDisplayController:didShowSearchResultsTableView:))]
268        #[unsafe(method_family = none)]
269        unsafe fn searchDisplayController_didShowSearchResultsTableView(
270            &self,
271            controller: &UISearchDisplayController,
272            table_view: &UITableView,
273        );
274
275        #[cfg(all(
276            feature = "UIResponder",
277            feature = "UIScrollView",
278            feature = "UITableView",
279            feature = "UIView"
280        ))]
281        #[deprecated]
282        #[optional]
283        #[unsafe(method(searchDisplayController:willHideSearchResultsTableView:))]
284        #[unsafe(method_family = none)]
285        unsafe fn searchDisplayController_willHideSearchResultsTableView(
286            &self,
287            controller: &UISearchDisplayController,
288            table_view: &UITableView,
289        );
290
291        #[cfg(all(
292            feature = "UIResponder",
293            feature = "UIScrollView",
294            feature = "UITableView",
295            feature = "UIView"
296        ))]
297        #[deprecated]
298        #[optional]
299        #[unsafe(method(searchDisplayController:didHideSearchResultsTableView:))]
300        #[unsafe(method_family = none)]
301        unsafe fn searchDisplayController_didHideSearchResultsTableView(
302            &self,
303            controller: &UISearchDisplayController,
304            table_view: &UITableView,
305        );
306
307        #[deprecated]
308        #[optional]
309        #[unsafe(method(searchDisplayController:shouldReloadTableForSearchString:))]
310        #[unsafe(method_family = none)]
311        unsafe fn searchDisplayController_shouldReloadTableForSearchString(
312            &self,
313            controller: &UISearchDisplayController,
314            search_string: Option<&NSString>,
315        ) -> bool;
316
317        #[deprecated]
318        #[optional]
319        #[unsafe(method(searchDisplayController:shouldReloadTableForSearchScope:))]
320        #[unsafe(method_family = none)]
321        unsafe fn searchDisplayController_shouldReloadTableForSearchScope(
322            &self,
323            controller: &UISearchDisplayController,
324            search_option: NSInteger,
325        ) -> bool;
326    }
327);