//! 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/uitableviewcontroller?language=objc)
    #[unsafe(super(UIViewController, UIResponder, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
    pub struct UITableViewController;
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl NSCoding for UITableViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UITableViewController {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UITableViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIContentContainer for UITableViewController {}
);

#[cfg(all(
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UITableViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UITableViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIScrollView",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIScrollViewDelegate for UITableViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UITableView",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UITableViewDataSource for UITableViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIScrollView",
    feature = "UITableView",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UITableViewDelegate for UITableViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UITableViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITableViewController {
    extern_methods!(
        #[cfg(feature = "UITableView")]
        #[unsafe(method(initWithStyle:))]
        #[unsafe(method_family = init)]
        pub fn initWithStyle(this: Allocated<Self>, style: UITableViewStyle) -> Retained<Self>;

        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSString>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(all(feature = "UIScrollView", feature = "UITableView", feature = "UIView"))]
        #[unsafe(method(tableView))]
        #[unsafe(method_family = none)]
        pub fn tableView(&self) -> Option<Retained<UITableView>>;

        #[cfg(all(feature = "UIScrollView", feature = "UITableView", feature = "UIView"))]
        /// Setter for [`tableView`][Self::tableView].
        ///
        /// # Safety
        ///
        /// `table_view` might not allow `None`.
        #[unsafe(method(setTableView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTableView(&self, table_view: Option<&UITableView>);

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

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

        #[cfg(all(
            feature = "UIControl",
            feature = "UIRefreshControl",
            feature = "UIView"
        ))]
        #[unsafe(method(refreshControl))]
        #[unsafe(method_family = none)]
        pub fn refreshControl(&self) -> Option<Retained<UIRefreshControl>>;

        #[cfg(all(
            feature = "UIControl",
            feature = "UIRefreshControl",
            feature = "UIView"
        ))]
        /// Setter for [`refreshControl`][Self::refreshControl].
        #[unsafe(method(setRefreshControl:))]
        #[unsafe(method_family = none)]
        pub fn setRefreshControl(&self, refresh_control: Option<&UIRefreshControl>);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITableViewController {
    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>;
    );
}
