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::*;
extern_class!(
#[unsafe(super(UIView, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub struct UIToolbar;
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for UIToolbar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSCoding for UIToolbar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UIToolbar {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearance for UIToolbar {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIToolbar {}
);
#[cfg(all(feature = "UIBarCommon", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIBarPositioning for UIToolbar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UICoordinateSpace for UIToolbar {}
);
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIDynamicItem for UIToolbar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIToolbar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItem for UIToolbar {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIFocusItemContainer for UIToolbar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIToolbar {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIToolbar {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIToolbar {
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(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(items))]
#[unsafe(method_family = none)]
pub fn items(&self) -> Option<Retained<NSArray<UIBarButtonItem>>>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(setItems:))]
#[unsafe(method_family = none)]
pub fn setItems(&self, items: Option<&NSArray<UIBarButtonItem>>);
#[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 = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(setItems:animated:))]
#[unsafe(method_family = none)]
pub fn setItems_animated(&self, items: Option<&NSArray<UIBarButtonItem>>, animated: 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(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(setBackgroundImage:forToolbarPosition:barMetrics:))]
#[unsafe(method_family = none)]
pub fn setBackgroundImage_forToolbarPosition_barMetrics(
&self,
background_image: Option<&UIImage>,
top_or_bottom: UIBarPosition,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(backgroundImageForToolbarPosition:barMetrics:))]
#[unsafe(method_family = none)]
pub fn backgroundImageForToolbarPosition_barMetrics(
&self,
top_or_bottom: UIBarPosition,
bar_metrics: UIBarMetrics,
) -> Option<Retained<UIImage>>;
#[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(setShadowImage:forToolbarPosition:))]
#[unsafe(method_family = none)]
pub fn setShadowImage_forToolbarPosition(
&self,
shadow_image: Option<&UIImage>,
top_or_bottom: UIBarPosition,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
#[unsafe(method(shadowImageForToolbarPosition:))]
#[unsafe(method_family = none)]
pub fn shadowImageForToolbarPosition(
&self,
top_or_bottom: UIBarPosition,
) -> Option<Retained<UIImage>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(standardAppearance))]
#[unsafe(method_family = none)]
pub fn standardAppearance(&self) -> Retained<UIToolbarAppearance>;
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(setStandardAppearance:))]
#[unsafe(method_family = none)]
pub fn setStandardAppearance(&self, standard_appearance: &UIToolbarAppearance);
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(compactAppearance))]
#[unsafe(method_family = none)]
pub fn compactAppearance(&self) -> Option<Retained<UIToolbarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(setCompactAppearance:))]
#[unsafe(method_family = none)]
pub fn setCompactAppearance(&self, compact_appearance: Option<&UIToolbarAppearance>);
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(scrollEdgeAppearance))]
#[unsafe(method_family = none)]
pub fn scrollEdgeAppearance(&self) -> Option<Retained<UIToolbarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(setScrollEdgeAppearance:))]
#[unsafe(method_family = none)]
pub fn setScrollEdgeAppearance(&self, scroll_edge_appearance: Option<&UIToolbarAppearance>);
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(compactScrollEdgeAppearance))]
#[unsafe(method_family = none)]
pub fn compactScrollEdgeAppearance(&self) -> Option<Retained<UIToolbarAppearance>>;
#[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
#[unsafe(method(setCompactScrollEdgeAppearance:))]
#[unsafe(method_family = none)]
pub fn setCompactScrollEdgeAppearance(
&self,
compact_scroll_edge_appearance: Option<&UIToolbarAppearance>,
);
#[cfg(feature = "UIBarCommon")]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UIToolbarDelegate>>>;
#[cfg(feature = "UIBarCommon")]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UIToolbarDelegate>>);
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIToolbar {
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 UIToolbar {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
#[cfg(feature = "UIBarCommon")]
pub unsafe trait UIToolbarDelegate: UIBarPositioningDelegate + MainThreadOnly {}
);