objc2_ui_kit/generated/
UIToolbarAppearance.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitoolbarappearance?language=objc)
12    #[unsafe(super(UIBarAppearance, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UIBarAppearance")]
16    pub struct UIToolbarAppearance;
17);
18
19#[cfg(feature = "UIBarAppearance")]
20extern_conformance!(
21    unsafe impl NSCoding for UIToolbarAppearance {}
22);
23
24#[cfg(feature = "UIBarAppearance")]
25extern_conformance!(
26    unsafe impl NSCopying for UIToolbarAppearance {}
27);
28
29#[cfg(feature = "UIBarAppearance")]
30unsafe impl CopyingHelper for UIToolbarAppearance {
31    type Result = Self;
32}
33
34#[cfg(feature = "UIBarAppearance")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for UIToolbarAppearance {}
37);
38
39#[cfg(feature = "UIBarAppearance")]
40extern_conformance!(
41    unsafe impl NSSecureCoding for UIToolbarAppearance {}
42);
43
44#[cfg(feature = "UIBarAppearance")]
45impl UIToolbarAppearance {
46    extern_methods!(
47        #[cfg(feature = "UIBarButtonItemAppearance")]
48        /// The appearance for plain-style bar button items
49        #[unsafe(method(buttonAppearance))]
50        #[unsafe(method_family = none)]
51        pub fn buttonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
52
53        #[cfg(feature = "UIBarButtonItemAppearance")]
54        /// Setter for [`buttonAppearance`][Self::buttonAppearance].
55        ///
56        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
57        #[unsafe(method(setButtonAppearance:))]
58        #[unsafe(method_family = none)]
59        pub fn setButtonAppearance(&self, button_appearance: &UIBarButtonItemAppearance);
60
61        #[cfg(feature = "UIBarButtonItemAppearance")]
62        /// The appearance attributes for Prominent buttons.
63        ///
64        /// Use this property to configure the appearance of bar button items that use `UIBarButtonItemStyleProminent`.
65        /// If the navigation bar doesn't have any buttons using this style, this property has no effect.
66        #[unsafe(method(prominentButtonAppearance))]
67        #[unsafe(method_family = none)]
68        pub fn prominentButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
69
70        #[cfg(feature = "UIBarButtonItemAppearance")]
71        /// Setter for [`prominentButtonAppearance`][Self::prominentButtonAppearance].
72        ///
73        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
74        #[unsafe(method(setProminentButtonAppearance:))]
75        #[unsafe(method_family = none)]
76        pub fn setProminentButtonAppearance(
77            &self,
78            prominent_button_appearance: &UIBarButtonItemAppearance,
79        );
80
81        #[cfg(feature = "UIBarButtonItemAppearance")]
82        /// The appearance for done-style bar button items
83        #[deprecated]
84        #[unsafe(method(doneButtonAppearance))]
85        #[unsafe(method_family = none)]
86        pub fn doneButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
87
88        #[cfg(feature = "UIBarButtonItemAppearance")]
89        /// Setter for [`doneButtonAppearance`][Self::doneButtonAppearance].
90        ///
91        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
92        #[deprecated]
93        #[unsafe(method(setDoneButtonAppearance:))]
94        #[unsafe(method_family = none)]
95        pub fn setDoneButtonAppearance(&self, done_button_appearance: &UIBarButtonItemAppearance);
96    );
97}
98
99/// Methods declared on superclass `UIBarAppearance`.
100#[cfg(feature = "UIBarAppearance")]
101impl UIToolbarAppearance {
102    extern_methods!(
103        /// Constructs a new bar appearance, configured with default values and targeting the device idiom.
104        #[unsafe(method(init))]
105        #[unsafe(method_family = init)]
106        pub fn init(this: Allocated<Self>) -> Retained<Self>;
107
108        #[cfg(feature = "UIDevice")]
109        /// Constructs a new bar appearance, targeting the passed-in idiom as a hint. Not all platforms support all available idioms. See the idiom property to determine the resolved idiom.
110        #[unsafe(method(initWithIdiom:))]
111        #[unsafe(method_family = init)]
112        pub fn initWithIdiom(this: Allocated<Self>, idiom: UIUserInterfaceIdiom) -> Retained<Self>;
113
114        /// Constructs a new bar appearance, copying all relevant properties from the given appearance object. This initializer is useful for migrating configuration between UIBarAppearance subclasses. For example, you can initialize a UINavigationBarAppearance with a UIToolbarAppearance instance, and shared attributes will be identical between the two.
115        #[unsafe(method(initWithBarAppearance:))]
116        #[unsafe(method_family = init)]
117        pub fn initWithBarAppearance(
118            this: Allocated<Self>,
119            bar_appearance: &UIBarAppearance,
120        ) -> Retained<Self>;
121
122        /// # Safety
123        ///
124        /// `coder` possibly has further requirements.
125        #[unsafe(method(initWithCoder:))]
126        #[unsafe(method_family = init)]
127        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
128    );
129}
130
131/// Methods declared on superclass `NSObject`.
132#[cfg(feature = "UIBarAppearance")]
133impl UIToolbarAppearance {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
138    );
139}