//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisearchdisplaycontroller?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
    pub struct UISearchDisplayController;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for UISearchDisplayController {}
);

impl UISearchDisplayController {
    extern_methods!(
        #[cfg(all(
            feature = "UIResponder",
            feature = "UISearchBar",
            feature = "UIView",
            feature = "UIViewController"
        ))]
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(initWithSearchBar:contentsController:))]
        #[unsafe(method_family = init)]
        pub fn initWithSearchBar_contentsController(
            this: Allocated<Self>,
            search_bar: &UISearchBar,
            view_controller: &UIViewController,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UISearchDisplayDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// # Safety
        ///
        /// This is unretained, you must ensure the object is kept alive while in use.
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UISearchDisplayDelegate>>,
        );

        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(isActive))]
        #[unsafe(method_family = none)]
        pub fn isActive(&self) -> bool;

        /// Setter for [`isActive`][Self::isActive].
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(setActive:))]
        #[unsafe(method_family = none)]
        pub fn setActive(&self, active: bool);

        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(setActive:animated:))]
        #[unsafe(method_family = none)]
        pub fn setActive_animated(&self, visible: bool, animated: bool);

        #[cfg(all(feature = "UIResponder", feature = "UISearchBar", feature = "UIView"))]
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(searchBar))]
        #[unsafe(method_family = none)]
        pub fn searchBar(&self) -> Retained<UISearchBar>;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(searchContentsController))]
        #[unsafe(method_family = none)]
        pub fn searchContentsController(&self) -> Retained<UIViewController>;

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(searchResultsTableView))]
        #[unsafe(method_family = none)]
        pub fn searchResultsTableView(&self) -> Retained<UITableView>;

        #[cfg(feature = "UITableView")]
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(searchResultsDataSource))]
        #[unsafe(method_family = none)]
        pub fn searchResultsDataSource(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UITableViewDataSource>>>;

        #[cfg(feature = "UITableView")]
        /// Setter for [`searchResultsDataSource`][Self::searchResultsDataSource].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(setSearchResultsDataSource:))]
        #[unsafe(method_family = none)]
        pub fn setSearchResultsDataSource(
            &self,
            search_results_data_source: Option<&ProtocolObject<dyn UITableViewDataSource>>,
        );

        #[cfg(all(feature = "UIScrollView", feature = "UITableView"))]
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(searchResultsDelegate))]
        #[unsafe(method_family = none)]
        pub fn searchResultsDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UITableViewDelegate>>>;

        #[cfg(all(feature = "UIScrollView", feature = "UITableView"))]
        /// Setter for [`searchResultsDelegate`][Self::searchResultsDelegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "UISearchDisplayController has been replaced with UISearchController"]
        #[unsafe(method(setSearchResultsDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setSearchResultsDelegate(
            &self,
            search_results_delegate: Option<&ProtocolObject<dyn UITableViewDelegate>>,
        );

        #[unsafe(method(searchResultsTitle))]
        #[unsafe(method_family = none)]
        pub fn searchResultsTitle(&self) -> Option<Retained<NSString>>;

        /// Setter for [`searchResultsTitle`][Self::searchResultsTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSearchResultsTitle:))]
        #[unsafe(method_family = none)]
        pub fn setSearchResultsTitle(&self, search_results_title: Option<&NSString>);

        #[unsafe(method(displaysSearchBarInNavigationBar))]
        #[unsafe(method_family = none)]
        pub fn displaysSearchBarInNavigationBar(&self) -> bool;

        /// Setter for [`displaysSearchBarInNavigationBar`][Self::displaysSearchBarInNavigationBar].
        #[unsafe(method(setDisplaysSearchBarInNavigationBar:))]
        #[unsafe(method_family = none)]
        pub fn setDisplaysSearchBarInNavigationBar(
            &self,
            displays_search_bar_in_navigation_bar: bool,
        );

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(navigationItem))]
        #[unsafe(method_family = none)]
        pub fn navigationItem(&self) -> Option<Retained<UINavigationItem>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UISearchDisplayController {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisearchdisplaydelegate?language=objc)
    pub unsafe trait UISearchDisplayDelegate: NSObjectProtocol + MainThreadOnly {
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayControllerWillBeginSearch:))]
        #[unsafe(method_family = none)]
        fn searchDisplayControllerWillBeginSearch(&self, controller: &UISearchDisplayController);

        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayControllerDidBeginSearch:))]
        #[unsafe(method_family = none)]
        fn searchDisplayControllerDidBeginSearch(&self, controller: &UISearchDisplayController);

        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayControllerWillEndSearch:))]
        #[unsafe(method_family = none)]
        fn searchDisplayControllerWillEndSearch(&self, controller: &UISearchDisplayController);

        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayControllerDidEndSearch:))]
        #[unsafe(method_family = none)]
        fn searchDisplayControllerDidEndSearch(&self, controller: &UISearchDisplayController);

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:didLoadSearchResultsTableView:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_didLoadSearchResultsTableView(
            &self,
            controller: &UISearchDisplayController,
            table_view: &UITableView,
        );

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:willUnloadSearchResultsTableView:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_willUnloadSearchResultsTableView(
            &self,
            controller: &UISearchDisplayController,
            table_view: &UITableView,
        );

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:willShowSearchResultsTableView:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_willShowSearchResultsTableView(
            &self,
            controller: &UISearchDisplayController,
            table_view: &UITableView,
        );

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:didShowSearchResultsTableView:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_didShowSearchResultsTableView(
            &self,
            controller: &UISearchDisplayController,
            table_view: &UITableView,
        );

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:willHideSearchResultsTableView:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_willHideSearchResultsTableView(
            &self,
            controller: &UISearchDisplayController,
            table_view: &UITableView,
        );

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIScrollView",
            feature = "UITableView",
            feature = "UIView"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:didHideSearchResultsTableView:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_didHideSearchResultsTableView(
            &self,
            controller: &UISearchDisplayController,
            table_view: &UITableView,
        );

        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:shouldReloadTableForSearchString:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_shouldReloadTableForSearchString(
            &self,
            controller: &UISearchDisplayController,
            search_string: Option<&NSString>,
        ) -> bool;

        #[deprecated]
        #[optional]
        #[unsafe(method(searchDisplayController:shouldReloadTableForSearchScope:))]
        #[unsafe(method_family = none)]
        fn searchDisplayController_shouldReloadTableForSearchScope(
            &self,
            controller: &UISearchDisplayController,
            search_option: NSInteger,
        ) -> bool;
    }
);
