use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITabBarItemPositioning(pub NSInteger);
impl UITabBarItemPositioning {
#[doc(alias = "UITabBarItemPositioningAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UITabBarItemPositioningFill")]
pub const Fill: Self = Self(1);
#[doc(alias = "UITabBarItemPositioningCentered")]
pub const Centered: Self = Self(2);
}
unsafe impl Encode for UITabBarItemPositioning {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UITabBarItemPositioning {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIView, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub struct UITabBar;
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for UITabBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSCoding for UITabBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UITabBar {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearance for UITabBar {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UITabBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UICoordinateSpace for UITabBar {}
);
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIDynamicItem for UITabBar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UITabBar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItem for UITabBar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItemContainer for UITabBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UITabBar {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UITabBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UITabBar {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UITabBarDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UITabBarDelegate>>);
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(items))]
#[unsafe(method_family = none)]
pub fn items(&self) -> Option<Retained<NSArray<UITabBarItem>>>;
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(setItems:))]
#[unsafe(method_family = none)]
pub fn setItems(&self, items: Option<&NSArray<UITabBarItem>>);
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(selectedItem))]
#[unsafe(method_family = none)]
pub fn selectedItem(&self) -> Option<Retained<UITabBarItem>>;
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(setSelectedItem:))]
#[unsafe(method_family = none)]
pub fn setSelectedItem(&self, selected_item: Option<&UITabBarItem>);
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(setItems:animated:))]
#[unsafe(method_family = none)]
pub fn setItems_animated(&self, items: Option<&NSArray<UITabBarItem>>, animated: bool);
#[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
#[unsafe(method(beginCustomizingItems:))]
#[unsafe(method_family = none)]
pub fn beginCustomizingItems(&self, items: &NSArray<UITabBarItem>);
#[unsafe(method(endCustomizingAnimated:))]
#[unsafe(method_family = none)]
pub fn endCustomizingAnimated(&self, animated: bool) -> bool;
#[unsafe(method(isCustomizing))]
#[unsafe(method_family = none)]
pub fn isCustomizing(&self) -> bool;
#[cfg(feature = "UIColor")]
#[unsafe(method(tintColor))]
#[unsafe(method_family = none)]
pub fn tintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setTintColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
#[cfg(feature = "UIColor")]
#[unsafe(method(barTintColor))]
#[unsafe(method_family = none)]
pub fn barTintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setBarTintColor:))]
#[unsafe(method_family = none)]
pub fn setBarTintColor(&self, bar_tint_color: Option<&UIColor>);
#[cfg(feature = "UIColor")]
#[unsafe(method(unselectedItemTintColor))]
#[unsafe(method_family = none)]
pub fn unselectedItemTintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setUnselectedItemTintColor:))]
#[unsafe(method_family = none)]
pub fn setUnselectedItemTintColor(&self, unselected_item_tint_color: Option<&UIColor>);
#[cfg(feature = "UIColor")]
#[deprecated]
#[unsafe(method(selectedImageTintColor))]
#[unsafe(method_family = none)]
pub fn selectedImageTintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[deprecated]
#[unsafe(method(setSelectedImageTintColor:))]
#[unsafe(method_family = none)]
pub fn setSelectedImageTintColor(&self, selected_image_tint_color: Option<&UIColor>);
#[cfg(feature = "UIImage")]
#[unsafe(method(backgroundImage))]
#[unsafe(method_family = none)]
pub fn backgroundImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setBackgroundImage:))]
#[unsafe(method_family = none)]
pub fn setBackgroundImage(&self, background_image: Option<&UIImage>);
#[cfg(feature = "UIImage")]
#[unsafe(method(selectionIndicatorImage))]
#[unsafe(method_family = none)]
pub fn selectionIndicatorImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setSelectionIndicatorImage:))]
#[unsafe(method_family = none)]
pub fn setSelectionIndicatorImage(&self, selection_indicator_image: Option<&UIImage>);
#[cfg(feature = "UIImage")]
#[unsafe(method(shadowImage))]
#[unsafe(method_family = none)]
pub fn shadowImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setShadowImage:))]
#[unsafe(method_family = none)]
pub fn setShadowImage(&self, shadow_image: Option<&UIImage>);
#[unsafe(method(itemPositioning))]
#[unsafe(method_family = none)]
pub fn itemPositioning(&self) -> UITabBarItemPositioning;
#[unsafe(method(setItemPositioning:))]
#[unsafe(method_family = none)]
pub fn setItemPositioning(&self, item_positioning: UITabBarItemPositioning);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(itemWidth))]
#[unsafe(method_family = none)]
pub fn itemWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setItemWidth:))]
#[unsafe(method_family = none)]
pub fn setItemWidth(&self, item_width: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(itemSpacing))]
#[unsafe(method_family = none)]
pub fn itemSpacing(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setItemSpacing:))]
#[unsafe(method_family = none)]
pub fn setItemSpacing(&self, item_spacing: CGFloat);
#[cfg(feature = "UIInterface")]
#[unsafe(method(barStyle))]
#[unsafe(method_family = none)]
pub fn barStyle(&self) -> UIBarStyle;
#[cfg(feature = "UIInterface")]
#[unsafe(method(setBarStyle:))]
#[unsafe(method_family = none)]
pub fn setBarStyle(&self, bar_style: UIBarStyle);
#[unsafe(method(isTranslucent))]
#[unsafe(method_family = none)]
pub fn isTranslucent(&self) -> bool;
#[unsafe(method(setTranslucent:))]
#[unsafe(method_family = none)]
pub fn setTranslucent(&self, translucent: bool);
#[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
#[unsafe(method(standardAppearance))]
#[unsafe(method_family = none)]
pub fn standardAppearance(&self) -> Retained<UITabBarAppearance>;
#[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
#[unsafe(method(setStandardAppearance:))]
#[unsafe(method_family = none)]
pub fn setStandardAppearance(&self, standard_appearance: &UITabBarAppearance);
#[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
#[unsafe(method(scrollEdgeAppearance))]
#[unsafe(method_family = none)]
pub fn scrollEdgeAppearance(&self) -> Option<Retained<UITabBarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
#[unsafe(method(setScrollEdgeAppearance:))]
#[unsafe(method_family = none)]
pub fn setScrollEdgeAppearance(&self, scroll_edge_appearance: Option<&UITabBarAppearance>);
#[unsafe(method(leadingAccessoryView))]
#[unsafe(method_family = none)]
pub fn leadingAccessoryView(&self) -> Retained<UIView>;
#[unsafe(method(trailingAccessoryView))]
#[unsafe(method_family = none)]
pub fn trailingAccessoryView(&self) -> Retained<UIView>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UITabBar {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UITabBar {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait UITabBarDelegate: NSObjectProtocol + MainThreadOnly {
#[cfg(all(
feature = "UIBarItem",
feature = "UIResponder",
feature = "UITabBarItem",
feature = "UIView"
))]
#[optional]
#[unsafe(method(tabBar:didSelectItem:))]
#[unsafe(method_family = none)]
fn tabBar_didSelectItem(&self, tab_bar: &UITabBar, item: &UITabBarItem);
#[cfg(all(
feature = "UIBarItem",
feature = "UIResponder",
feature = "UITabBarItem",
feature = "UIView"
))]
#[optional]
#[unsafe(method(tabBar:willBeginCustomizingItems:))]
#[unsafe(method_family = none)]
fn tabBar_willBeginCustomizingItems(
&self,
tab_bar: &UITabBar,
items: &NSArray<UITabBarItem>,
);
#[cfg(all(
feature = "UIBarItem",
feature = "UIResponder",
feature = "UITabBarItem",
feature = "UIView"
))]
#[optional]
#[unsafe(method(tabBar:didBeginCustomizingItems:))]
#[unsafe(method_family = none)]
fn tabBar_didBeginCustomizingItems(
&self,
tab_bar: &UITabBar,
items: &NSArray<UITabBarItem>,
);
#[cfg(all(
feature = "UIBarItem",
feature = "UIResponder",
feature = "UITabBarItem",
feature = "UIView"
))]
#[optional]
#[unsafe(method(tabBar:willEndCustomizingItems:changed:))]
#[unsafe(method_family = none)]
fn tabBar_willEndCustomizingItems_changed(
&self,
tab_bar: &UITabBar,
items: &NSArray<UITabBarItem>,
changed: bool,
);
#[cfg(all(
feature = "UIBarItem",
feature = "UIResponder",
feature = "UITabBarItem",
feature = "UIView"
))]
#[optional]
#[unsafe(method(tabBar:didEndCustomizingItems:changed:))]
#[unsafe(method_family = none)]
fn tabBar_didEndCustomizingItems_changed(
&self,
tab_bar: &UITabBar,
items: &NSArray<UITabBarItem>,
changed: bool,
);
}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UITabBar {
extern_methods!();
}
#[cfg(all(
feature = "UIResponder",
feature = "UISpringLoadedInteractionSupporting",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UISpringLoadedInteractionSupporting for UITabBar {}
);