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 UINavigationBarNSToolbarSection(pub NSInteger);
impl UINavigationBarNSToolbarSection {
#[doc(alias = "UINavigationBarNSToolbarSectionNone")]
pub const None: Self = Self(0);
#[doc(alias = "UINavigationBarNSToolbarSectionSidebar")]
pub const Sidebar: Self = Self(1);
#[doc(alias = "UINavigationBarNSToolbarSectionSupplementary")]
pub const Supplementary: Self = Self(2);
#[doc(alias = "UINavigationBarNSToolbarSectionContent")]
pub const Content: Self = Self(3);
}
unsafe impl Encode for UINavigationBarNSToolbarSection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UINavigationBarNSToolbarSection {
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 UINavigationBar;
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for UINavigationBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSCoding for UINavigationBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UINavigationBar {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearance for UINavigationBar {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UINavigationBar {}
);
#[cfg(all(feature = "UIBarCommon", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIBarPositioning for UINavigationBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UICoordinateSpace for UINavigationBar {}
);
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIDynamicItem for UINavigationBar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UINavigationBar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItem for UINavigationBar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItemContainer for UINavigationBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UINavigationBar {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UINavigationBar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UINavigationBar {
extern_methods!(
#[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);
#[cfg(feature = "UIBarCommon")]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UINavigationBarDelegate>>>;
#[cfg(feature = "UIBarCommon")]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UINavigationBarDelegate>>);
#[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(feature = "UINavigationItem")]
#[unsafe(method(pushNavigationItem:animated:))]
#[unsafe(method_family = none)]
pub fn pushNavigationItem_animated(&self, item: &UINavigationItem, animated: bool);
#[cfg(feature = "UINavigationItem")]
#[unsafe(method(popNavigationItemAnimated:))]
#[unsafe(method_family = none)]
pub fn popNavigationItemAnimated(
&self,
animated: bool,
) -> Option<Retained<UINavigationItem>>;
#[cfg(feature = "UINavigationItem")]
#[unsafe(method(topItem))]
#[unsafe(method_family = none)]
pub fn topItem(&self) -> Option<Retained<UINavigationItem>>;
#[cfg(feature = "UINavigationItem")]
#[unsafe(method(backItem))]
#[unsafe(method_family = none)]
pub fn backItem(&self) -> Option<Retained<UINavigationItem>>;
#[cfg(feature = "UINavigationItem")]
#[unsafe(method(items))]
#[unsafe(method_family = none)]
pub fn items(&self) -> Option<Retained<NSArray<UINavigationItem>>>;
#[cfg(feature = "UINavigationItem")]
#[unsafe(method(setItems:))]
#[unsafe(method_family = none)]
pub fn setItems(&self, items: Option<&NSArray<UINavigationItem>>);
#[cfg(feature = "UINavigationItem")]
#[unsafe(method(setItems:animated:))]
#[unsafe(method_family = none)]
pub fn setItems_animated(&self, items: Option<&NSArray<UINavigationItem>>, animated: bool);
#[unsafe(method(prefersLargeTitles))]
#[unsafe(method_family = none)]
pub fn prefersLargeTitles(&self) -> bool;
#[unsafe(method(setPrefersLargeTitles:))]
#[unsafe(method_family = none)]
pub fn setPrefersLargeTitles(&self, prefers_large_titles: bool);
#[unsafe(method(currentNSToolbarSection))]
#[unsafe(method_family = none)]
pub fn currentNSToolbarSection(&self) -> UINavigationBarNSToolbarSection;
#[cfg(feature = "UIBehavioralStyle")]
#[unsafe(method(behavioralStyle))]
#[unsafe(method_family = none)]
pub fn behavioralStyle(&self) -> UIBehavioralStyle;
#[cfg(feature = "UIBehavioralStyle")]
#[unsafe(method(preferredBehavioralStyle))]
#[unsafe(method_family = none)]
pub fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
#[cfg(feature = "UIBehavioralStyle")]
#[unsafe(method(setPreferredBehavioralStyle:))]
#[unsafe(method_family = none)]
pub fn setPreferredBehavioralStyle(&self, preferred_behavioral_style: UIBehavioralStyle);
#[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(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(setBackgroundImage:forBarPosition:barMetrics:))]
#[unsafe(method_family = none)]
pub fn setBackgroundImage_forBarPosition_barMetrics(
&self,
background_image: Option<&UIImage>,
bar_position: UIBarPosition,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(backgroundImageForBarPosition:barMetrics:))]
#[unsafe(method_family = none)]
pub fn backgroundImageForBarPosition_barMetrics(
&self,
bar_position: UIBarPosition,
bar_metrics: UIBarMetrics,
) -> Option<Retained<UIImage>>;
#[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(setBackgroundImage:forBarMetrics:))]
#[unsafe(method_family = none)]
pub fn setBackgroundImage_forBarMetrics(
&self,
background_image: Option<&UIImage>,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(backgroundImageForBarMetrics:))]
#[unsafe(method_family = none)]
pub fn backgroundImageForBarMetrics(
&self,
bar_metrics: UIBarMetrics,
) -> Option<Retained<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(titleTextAttributes))]
#[unsafe(method_family = none)]
pub fn titleTextAttributes(
&self,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
#[unsafe(method(setTitleTextAttributes:))]
#[unsafe(method_family = none)]
pub unsafe fn setTitleTextAttributes(
&self,
title_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
);
#[unsafe(method(largeTitleTextAttributes))]
#[unsafe(method_family = none)]
pub fn largeTitleTextAttributes(
&self,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
#[unsafe(method(setLargeTitleTextAttributes:))]
#[unsafe(method_family = none)]
pub unsafe fn setLargeTitleTextAttributes(
&self,
large_title_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
);
#[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
#[unsafe(method(setTitleVerticalPositionAdjustment:forBarMetrics:))]
#[unsafe(method_family = none)]
pub fn setTitleVerticalPositionAdjustment_forBarMetrics(
&self,
adjustment: CGFloat,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
#[unsafe(method(titleVerticalPositionAdjustmentForBarMetrics:))]
#[unsafe(method_family = none)]
pub fn titleVerticalPositionAdjustmentForBarMetrics(
&self,
bar_metrics: UIBarMetrics,
) -> CGFloat;
#[cfg(feature = "UIImage")]
#[unsafe(method(backIndicatorImage))]
#[unsafe(method_family = none)]
pub fn backIndicatorImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setBackIndicatorImage:))]
#[unsafe(method_family = none)]
pub fn setBackIndicatorImage(&self, back_indicator_image: Option<&UIImage>);
#[cfg(feature = "UIImage")]
#[unsafe(method(backIndicatorTransitionMaskImage))]
#[unsafe(method_family = none)]
pub fn backIndicatorTransitionMaskImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setBackIndicatorTransitionMaskImage:))]
#[unsafe(method_family = none)]
pub fn setBackIndicatorTransitionMaskImage(
&self,
back_indicator_transition_mask_image: Option<&UIImage>,
);
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(standardAppearance))]
#[unsafe(method_family = none)]
pub fn standardAppearance(&self) -> Retained<UINavigationBarAppearance>;
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(setStandardAppearance:))]
#[unsafe(method_family = none)]
pub fn setStandardAppearance(&self, standard_appearance: &UINavigationBarAppearance);
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(compactAppearance))]
#[unsafe(method_family = none)]
pub fn compactAppearance(&self) -> Option<Retained<UINavigationBarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(setCompactAppearance:))]
#[unsafe(method_family = none)]
pub fn setCompactAppearance(&self, compact_appearance: Option<&UINavigationBarAppearance>);
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(scrollEdgeAppearance))]
#[unsafe(method_family = none)]
pub fn scrollEdgeAppearance(&self) -> Option<Retained<UINavigationBarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(setScrollEdgeAppearance:))]
#[unsafe(method_family = none)]
pub fn setScrollEdgeAppearance(
&self,
scroll_edge_appearance: Option<&UINavigationBarAppearance>,
);
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(compactScrollEdgeAppearance))]
#[unsafe(method_family = none)]
pub fn compactScrollEdgeAppearance(&self) -> Option<Retained<UINavigationBarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
#[unsafe(method(setCompactScrollEdgeAppearance:))]
#[unsafe(method_family = none)]
pub fn setCompactScrollEdgeAppearance(
&self,
compact_scroll_edge_appearance: Option<&UINavigationBarAppearance>,
);
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UINavigationBar {
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 UINavigationBar {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
#[cfg(feature = "UIBarCommon")]
pub unsafe trait UINavigationBarDelegate:
UIBarPositioningDelegate + MainThreadOnly
{
#[cfg(all(
feature = "UINavigationItem",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[unsafe(method(navigationBar:shouldPushItem:))]
#[unsafe(method_family = none)]
fn navigationBar_shouldPushItem(
&self,
navigation_bar: &UINavigationBar,
item: &UINavigationItem,
) -> bool;
#[cfg(all(
feature = "UINavigationItem",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[unsafe(method(navigationBar:didPushItem:))]
#[unsafe(method_family = none)]
fn navigationBar_didPushItem(
&self,
navigation_bar: &UINavigationBar,
item: &UINavigationItem,
);
#[cfg(all(
feature = "UINavigationItem",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[unsafe(method(navigationBar:shouldPopItem:))]
#[unsafe(method_family = none)]
fn navigationBar_shouldPopItem(
&self,
navigation_bar: &UINavigationBar,
item: &UINavigationItem,
) -> bool;
#[cfg(all(
feature = "UINavigationItem",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[unsafe(method(navigationBar:didPopItem:))]
#[unsafe(method_family = none)]
fn navigationBar_didPopItem(
&self,
navigation_bar: &UINavigationBar,
item: &UINavigationItem,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[unsafe(method(navigationBarNSToolbarSection:))]
#[unsafe(method_family = none)]
fn navigationBarNSToolbarSection(
&self,
navigation_bar: &UINavigationBar,
) -> UINavigationBarNSToolbarSection;
}
);