objc2_ui_kit/generated/
UISearchTab.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/uisearchtab?language=objc)
12    #[unsafe(super(UITab, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UITab")]
16    pub struct UISearchTab;
17);
18
19#[cfg(feature = "UITab")]
20extern_conformance!(
21    unsafe impl NSObjectProtocol for UISearchTab {}
22);
23
24#[cfg(feature = "UITab")]
25impl UISearchTab {
26    extern_methods!(
27        /// Determines if the search tab should automatically activate the embedded search field when the tab becomes visible.
28        ///
29        /// When this property is set to `YES`, the search field will be activated when the tab is selected. Moreover, when search is cancelled,
30        /// the previously selected tab in the tab bar will be restored and selected. The default value is `NO`.
31        #[unsafe(method(automaticallyActivatesSearch))]
32        #[unsafe(method_family = none)]
33        pub fn automaticallyActivatesSearch(&self) -> bool;
34
35        /// Setter for [`automaticallyActivatesSearch`][Self::automaticallyActivatesSearch].
36        #[unsafe(method(setAutomaticallyActivatesSearch:))]
37        #[unsafe(method_family = none)]
38        pub fn setAutomaticallyActivatesSearch(&self, automatically_activates_search: bool);
39
40        #[cfg(all(
41            feature = "UIResponder",
42            feature = "UIViewController",
43            feature = "block2"
44        ))]
45        /// Creates a search tab with a system localized title and image.
46        ///
47        /// # Safety
48        ///
49        /// `view_controller_provider` block's return must be a valid pointer.
50        #[unsafe(method(initWithViewControllerProvider:))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn initWithViewControllerProvider(
53            this: Allocated<Self>,
54            view_controller_provider: Option<
55                &block2::DynBlock<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
56            >,
57        ) -> Retained<Self>;
58    );
59}
60
61/// Methods declared on superclass `UITab`.
62#[cfg(feature = "UITab")]
63impl UISearchTab {
64    extern_methods!(
65        #[cfg(all(
66            feature = "UIImage",
67            feature = "UIResponder",
68            feature = "UIViewController",
69            feature = "block2"
70        ))]
71        /// Creates a tab with the specified identifier, title, image, and view controller provider.
72        /// The view controller provider is called when a view controller is requested and is currently nil.
73        /// For root level tabs on `UITabBarController`, the resolved view controller must be non-nil.
74        ///
75        /// # Safety
76        ///
77        /// `view_controller_provider` block's return must be a valid pointer.
78        #[unsafe(method(initWithTitle:image:identifier:viewControllerProvider:))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn initWithTitle_image_identifier_viewControllerProvider(
81            this: Allocated<Self>,
82            title: &NSString,
83            image: Option<&UIImage>,
84            identifier: &NSString,
85            view_controller_provider: Option<
86                &block2::DynBlock<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
87            >,
88        ) -> Retained<Self>;
89
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94        #[unsafe(method(new))]
95        #[unsafe(method_family = new)]
96        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
97    );
98}