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