use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITabBarControllerMode(pub NSInteger);
impl UITabBarControllerMode {
#[doc(alias = "UITabBarControllerModeAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UITabBarControllerModeTabBar")]
pub const TabBar: Self = Self(1);
#[doc(alias = "UITabBarControllerModeTabSidebar")]
pub const TabSidebar: Self = Self(2);
}
unsafe impl Encode for UITabBarControllerMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UITabBarControllerMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITabBarMinimizeBehavior(pub NSInteger);
impl UITabBarMinimizeBehavior {
#[doc(alias = "UITabBarMinimizeBehaviorAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UITabBarMinimizeBehaviorNever")]
pub const Never: Self = Self(1);
#[doc(alias = "UITabBarMinimizeBehaviorOnScrollDown")]
pub const OnScrollDown: Self = Self(2);
#[doc(alias = "UITabBarMinimizeBehaviorOnScrollUp")]
pub const OnScrollUp: Self = Self(3);
}
unsafe impl Encode for UITabBarMinimizeBehavior {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UITabBarMinimizeBehavior {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIViewController, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UITabBarController;
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSCoding for UITabBarController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UITabBarController {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UITabBarController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIContentContainer for UITabBarController {}
);
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UITabBarController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UITabBarController {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITabBar",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UITabBarDelegate for UITabBarController {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UITabBarController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITabBarController {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UITabBarControllerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UITabBarControllerDelegate>>,
);
#[unsafe(method(mode))]
#[unsafe(method_family = none)]
pub fn mode(&self) -> UITabBarControllerMode;
#[unsafe(method(setMode:))]
#[unsafe(method_family = none)]
pub fn setMode(&self, mode: UITabBarControllerMode);
#[cfg(feature = "UITabBarControllerSidebar")]
#[unsafe(method(sidebar))]
#[unsafe(method_family = none)]
pub fn sidebar(&self) -> Retained<UITabBarControllerSidebar>;
#[unsafe(method(customizationIdentifier))]
#[unsafe(method_family = none)]
pub fn customizationIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setCustomizationIdentifier:))]
#[unsafe(method_family = none)]
pub fn setCustomizationIdentifier(&self, customization_identifier: Option<&NSString>);
#[unsafe(method(compactTabIdentifiers))]
#[unsafe(method_family = none)]
pub fn compactTabIdentifiers(&self) -> Option<Retained<NSArray<NSString>>>;
#[unsafe(method(setCompactTabIdentifiers:))]
#[unsafe(method_family = none)]
pub fn setCompactTabIdentifiers(&self, compact_tab_identifiers: Option<&NSArray<NSString>>);
#[cfg(feature = "UITab")]
#[unsafe(method(selectedTab))]
#[unsafe(method_family = none)]
pub fn selectedTab(&self) -> Option<Retained<UITab>>;
#[cfg(feature = "UITab")]
#[unsafe(method(setSelectedTab:))]
#[unsafe(method_family = none)]
pub fn setSelectedTab(&self, selected_tab: Option<&UITab>);
#[cfg(feature = "UITab")]
#[unsafe(method(tabs))]
#[unsafe(method_family = none)]
pub fn tabs(&self) -> Retained<NSArray<UITab>>;
#[cfg(feature = "UITab")]
#[unsafe(method(setTabs:))]
#[unsafe(method_family = none)]
pub fn setTabs(&self, tabs: &NSArray<UITab>);
#[cfg(feature = "UITab")]
#[unsafe(method(setTabs:animated:))]
#[unsafe(method_family = none)]
pub fn setTabs_animated(&self, tabs: &NSArray<UITab>, animated: bool);
#[cfg(feature = "UITab")]
#[unsafe(method(tabForIdentifier:))]
#[unsafe(method_family = none)]
pub fn tabForIdentifier(&self, identifier: &NSString) -> Option<Retained<UITab>>;
#[cfg(feature = "UITab")]
#[unsafe(method(initWithTabs:))]
#[unsafe(method_family = init)]
pub fn initWithTabs(this: Allocated<Self>, tabs: &NSArray<UITab>) -> Retained<Self>;
#[unsafe(method(tabBarMinimizeBehavior))]
#[unsafe(method_family = none)]
pub fn tabBarMinimizeBehavior(&self) -> UITabBarMinimizeBehavior;
#[unsafe(method(setTabBarMinimizeBehavior:))]
#[unsafe(method_family = none)]
pub fn setTabBarMinimizeBehavior(
&self,
tab_bar_minimize_behavior: UITabBarMinimizeBehavior,
);
#[unsafe(method(isTabBarHidden))]
#[unsafe(method_family = none)]
pub fn isTabBarHidden(&self) -> bool;
#[unsafe(method(setTabBarHidden:))]
#[unsafe(method_family = none)]
pub fn setTabBarHidden(&self, tab_bar_hidden: bool);
#[unsafe(method(setTabBarHidden:animated:))]
#[unsafe(method_family = none)]
pub fn setTabBarHidden_animated(&self, hidden: bool, animated: bool);
#[cfg(feature = "UILayoutGuide")]
#[unsafe(method(contentLayoutGuide))]
#[unsafe(method_family = none)]
pub fn contentLayoutGuide(&self) -> Retained<UILayoutGuide>;
#[cfg(feature = "UITabAccessory")]
#[unsafe(method(bottomAccessory))]
#[unsafe(method_family = none)]
pub fn bottomAccessory(&self) -> Option<Retained<UITabAccessory>>;
#[cfg(feature = "UITabAccessory")]
#[unsafe(method(setBottomAccessory:))]
#[unsafe(method_family = none)]
pub fn setBottomAccessory(&self, bottom_accessory: Option<&UITabAccessory>);
#[cfg(feature = "UITabAccessory")]
#[unsafe(method(setBottomAccessory:animated:))]
#[unsafe(method_family = none)]
pub fn setBottomAccessory_animated(
&self,
bottom_accessory: Option<&UITabAccessory>,
animated: bool,
);
#[unsafe(method(viewControllers))]
#[unsafe(method_family = none)]
pub fn viewControllers(&self) -> Option<Retained<NSArray<UIViewController>>>;
#[unsafe(method(setViewControllers:))]
#[unsafe(method_family = none)]
pub fn setViewControllers(&self, view_controllers: Option<&NSArray<UIViewController>>);
#[unsafe(method(setViewControllers:animated:))]
#[unsafe(method_family = none)]
pub fn setViewControllers_animated(
&self,
view_controllers: Option<&NSArray<UIViewController>>,
animated: bool,
);
#[unsafe(method(selectedViewController))]
#[unsafe(method_family = none)]
pub unsafe fn selectedViewController(&self) -> Option<Retained<UIViewController>>;
#[unsafe(method(setSelectedViewController:))]
#[unsafe(method_family = none)]
pub unsafe fn setSelectedViewController(
&self,
selected_view_controller: Option<&UIViewController>,
);
#[unsafe(method(selectedIndex))]
#[unsafe(method_family = none)]
pub fn selectedIndex(&self) -> NSUInteger;
#[unsafe(method(setSelectedIndex:))]
#[unsafe(method_family = none)]
pub fn setSelectedIndex(&self, selected_index: NSUInteger);
#[cfg(feature = "UINavigationController")]
#[unsafe(method(moreNavigationController))]
#[unsafe(method_family = none)]
pub fn moreNavigationController(&self) -> Retained<UINavigationController>;
#[unsafe(method(customizableViewControllers))]
#[unsafe(method_family = none)]
pub fn customizableViewControllers(&self) -> Option<Retained<NSArray<UIViewController>>>;
#[unsafe(method(setCustomizableViewControllers:))]
#[unsafe(method_family = none)]
pub fn setCustomizableViewControllers(
&self,
customizable_view_controllers: Option<&NSArray<UIViewController>>,
);
#[cfg(all(feature = "UITabBar", feature = "UIView"))]
#[unsafe(method(tabBar))]
#[unsafe(method_family = none)]
pub fn tabBar(&self) -> Retained<UITabBar>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITabBarController {
extern_methods!(
#[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>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITabBarController {
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!(
pub unsafe trait UITabBarControllerDelegate: NSObjectProtocol + MainThreadOnly {
#[cfg(all(
feature = "UIResponder",
feature = "UITab",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:shouldSelectTab:))]
#[unsafe(method_family = none)]
fn tabBarController_shouldSelectTab(
&self,
tab_bar_controller: &UITabBarController,
tab: &UITab,
) -> bool;
#[cfg(all(
feature = "UIResponder",
feature = "UITab",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:didSelectTab:previousTab:))]
#[unsafe(method_family = none)]
fn tabBarController_didSelectTab_previousTab(
&self,
tab_bar_controller: &UITabBarController,
selected_tab: &UITab,
previous_tab: Option<&UITab>,
);
#[cfg(all(
feature = "UIDragSession",
feature = "UIDropInteraction",
feature = "UIResponder",
feature = "UITab",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:tab:operationForAcceptingItemsFromDropSession:))]
#[unsafe(method_family = none)]
fn tabBarController_tab_operationForAcceptingItemsFromDropSession(
&self,
tab_bar_controller: &UITabBarController,
tab: &UITab,
session: &ProtocolObject<dyn UIDropSession>,
) -> UIDropOperation;
#[cfg(all(
feature = "UIDragSession",
feature = "UIResponder",
feature = "UITab",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:tab:acceptItemsFromDropSession:))]
#[unsafe(method_family = none)]
fn tabBarController_tab_acceptItemsFromDropSession(
&self,
tab_bar_controller: &UITabBarController,
tab: &UITab,
session: &ProtocolObject<dyn UIDropSession>,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarControllerWillBeginEditing:))]
#[unsafe(method_family = none)]
fn tabBarControllerWillBeginEditing(&self, tab_bar_controller: &UITabBarController);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarControllerDidEndEditing:))]
#[unsafe(method_family = none)]
fn tabBarControllerDidEndEditing(&self, tab_bar_controller: &UITabBarController);
#[cfg(all(
feature = "UIResponder",
feature = "UITab",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:visibilityDidChangeForTabs:))]
#[unsafe(method_family = none)]
fn tabBarController_visibilityDidChangeForTabs(
&self,
tab_bar_controller: &UITabBarController,
tabs: &NSArray<UITab>,
);
#[cfg(all(
feature = "UIResponder",
feature = "UITab",
feature = "UITabGroup",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:displayOrderDidChangeForGroup:))]
#[unsafe(method_family = none)]
fn tabBarController_displayOrderDidChangeForGroup(
&self,
tab_bar_controller: &UITabBarController,
group: &UITabGroup,
);
#[cfg(all(
feature = "UIResponder",
feature = "UITab",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarController:displayedViewControllersForTab:proposedViewControllers:))]
#[unsafe(method_family = none)]
fn tabBarController_displayedViewControllersForTab_proposedViewControllers(
&self,
tab_bar_controller: &UITabBarController,
tab: &UITab,
proposed_view_controllers: &NSArray<UIViewController>,
) -> Retained<NSArray<UIViewController>>;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarController:shouldSelectViewController:))]
#[unsafe(method_family = none)]
fn tabBarController_shouldSelectViewController(
&self,
tab_bar_controller: &UITabBarController,
view_controller: &UIViewController,
) -> bool;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarController:didSelectViewController:))]
#[unsafe(method_family = none)]
fn tabBarController_didSelectViewController(
&self,
tab_bar_controller: &UITabBarController,
view_controller: &UIViewController,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarController:willBeginCustomizingViewControllers:))]
#[unsafe(method_family = none)]
fn tabBarController_willBeginCustomizingViewControllers(
&self,
tab_bar_controller: &UITabBarController,
view_controllers: &NSArray<UIViewController>,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarController:willEndCustomizingViewControllers:changed:))]
#[unsafe(method_family = none)]
fn tabBarController_willEndCustomizingViewControllers_changed(
&self,
tab_bar_controller: &UITabBarController,
view_controllers: &NSArray<UIViewController>,
changed: bool,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(tabBarController:didEndCustomizingViewControllers:changed:))]
#[unsafe(method_family = none)]
fn tabBarController_didEndCustomizingViewControllers_changed(
&self,
tab_bar_controller: &UITabBarController,
view_controllers: &NSArray<UIViewController>,
changed: bool,
);
#[cfg(all(
feature = "UIOrientation",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarControllerSupportedInterfaceOrientations:))]
#[unsafe(method_family = none)]
fn tabBarControllerSupportedInterfaceOrientations(
&self,
tab_bar_controller: &UITabBarController,
) -> UIInterfaceOrientationMask;
#[cfg(all(
feature = "UIOrientation",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(tabBarControllerPreferredInterfaceOrientationForPresentation:))]
#[unsafe(method_family = none)]
fn tabBarControllerPreferredInterfaceOrientationForPresentation(
&self,
tab_bar_controller: &UITabBarController,
) -> UIInterfaceOrientation;
#[cfg(all(
feature = "UIResponder",
feature = "UIViewController",
feature = "UIViewControllerTransitioning"
))]
#[optional]
#[unsafe(method(tabBarController:interactionControllerForAnimationController:))]
#[unsafe(method_family = none)]
fn tabBarController_interactionControllerForAnimationController(
&self,
tab_bar_controller: &UITabBarController,
animation_controller: &ProtocolObject<dyn UIViewControllerAnimatedTransitioning>,
) -> Option<Retained<ProtocolObject<dyn UIViewControllerInteractiveTransitioning>>>;
#[cfg(all(
feature = "UIResponder",
feature = "UIViewController",
feature = "UIViewControllerTransitioning"
))]
#[optional]
#[unsafe(method(tabBarController:animationControllerForTransitionFromViewController:toViewController:))]
#[unsafe(method_family = none)]
fn tabBarController_animationControllerForTransitionFromViewController_toViewController(
&self,
tab_bar_controller: &UITabBarController,
from_vc: &UIViewController,
to_vc: &UIViewController,
) -> Option<Retained<ProtocolObject<dyn UIViewControllerAnimatedTransitioning>>>;
}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIViewController {
extern_methods!(
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(tabBarItem))]
#[unsafe(method_family = none)]
pub fn tabBarItem(&self) -> Option<Retained<UITabBarItem>>;
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(setTabBarItem:))]
#[unsafe(method_family = none)]
pub unsafe fn setTabBarItem(&self, tab_bar_item: Option<&UITabBarItem>);
#[unsafe(method(tabBarController))]
#[unsafe(method_family = none)]
pub fn tabBarController(&self) -> Option<Retained<UITabBarController>>;
#[cfg(all(feature = "UIScrollView", feature = "UIView"))]
#[deprecated = "Use -setContentScrollView:forEdge: instead."]
#[unsafe(method(tabBarObservedScrollView))]
#[unsafe(method_family = none)]
pub fn tabBarObservedScrollView(&self) -> Option<Retained<UIScrollView>>;
#[cfg(all(feature = "UIScrollView", feature = "UIView"))]
#[deprecated = "Use -setContentScrollView:forEdge: instead."]
#[unsafe(method(setTabBarObservedScrollView:))]
#[unsafe(method_family = none)]
pub fn setTabBarObservedScrollView(
&self,
tab_bar_observed_scroll_view: Option<&UIScrollView>,
);
);
}