objc2_ui_kit/generated/
UINavigationBarAppearance.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/uinavigationbarappearance?language=objc)
12    #[unsafe(super(UIBarAppearance, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UIBarAppearance")]
16    pub struct UINavigationBarAppearance;
17);
18
19#[cfg(feature = "UIBarAppearance")]
20extern_conformance!(
21    unsafe impl NSCoding for UINavigationBarAppearance {}
22);
23
24#[cfg(feature = "UIBarAppearance")]
25extern_conformance!(
26    unsafe impl NSCopying for UINavigationBarAppearance {}
27);
28
29#[cfg(feature = "UIBarAppearance")]
30unsafe impl CopyingHelper for UINavigationBarAppearance {
31    type Result = Self;
32}
33
34#[cfg(feature = "UIBarAppearance")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for UINavigationBarAppearance {}
37);
38
39#[cfg(feature = "UIBarAppearance")]
40extern_conformance!(
41    unsafe impl NSSecureCoding for UINavigationBarAppearance {}
42);
43
44#[cfg(feature = "UIBarAppearance")]
45impl UINavigationBarAppearance {
46    extern_methods!(
47        /// Inline Title text attributes. If the font or color are unspecified, appropriate defaults are supplied.
48        #[unsafe(method(titleTextAttributes))]
49        #[unsafe(method_family = none)]
50        pub fn titleTextAttributes(
51            &self,
52        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
53
54        /// Setter for [`titleTextAttributes`][Self::titleTextAttributes].
55        ///
56        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
57        ///
58        /// # Safety
59        ///
60        /// `title_text_attributes` generic should be of the correct type.
61        #[unsafe(method(setTitleTextAttributes:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setTitleTextAttributes(
64            &self,
65            title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
66        );
67
68        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
69        /// An additional adjustment to the inline title's position.
70        #[unsafe(method(titlePositionAdjustment))]
71        #[unsafe(method_family = none)]
72        pub fn titlePositionAdjustment(&self) -> UIOffset;
73
74        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
75        /// Setter for [`titlePositionAdjustment`][Self::titlePositionAdjustment].
76        #[unsafe(method(setTitlePositionAdjustment:))]
77        #[unsafe(method_family = none)]
78        pub fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
79
80        /// The default text attributes to apply to the subtitle rendered in the navigation bar.
81        #[unsafe(method(subtitleTextAttributes))]
82        #[unsafe(method_family = none)]
83        pub fn subtitleTextAttributes(
84            &self,
85        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
86
87        /// Setter for [`subtitleTextAttributes`][Self::subtitleTextAttributes].
88        ///
89        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
90        ///
91        /// # Safety
92        ///
93        /// `subtitle_text_attributes` generic should be of the correct type.
94        #[unsafe(method(setSubtitleTextAttributes:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setSubtitleTextAttributes(
97            &self,
98            subtitle_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
99        );
100
101        /// Large Title text attributes. If the font or color are unspecified, appropriate defaults are supplied.
102        #[unsafe(method(largeTitleTextAttributes))]
103        #[unsafe(method_family = none)]
104        pub fn largeTitleTextAttributes(
105            &self,
106        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
107
108        /// Setter for [`largeTitleTextAttributes`][Self::largeTitleTextAttributes].
109        ///
110        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
111        ///
112        /// # Safety
113        ///
114        /// `large_title_text_attributes` generic should be of the correct type.
115        #[unsafe(method(setLargeTitleTextAttributes:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn setLargeTitleTextAttributes(
118            &self,
119            large_title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
120        );
121
122        /// The default text attributes to apply to the subtitle when it’s rendered under
123        /// the large title.
124        #[unsafe(method(largeSubtitleTextAttributes))]
125        #[unsafe(method_family = none)]
126        pub fn largeSubtitleTextAttributes(
127            &self,
128        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
129
130        /// Setter for [`largeSubtitleTextAttributes`][Self::largeSubtitleTextAttributes].
131        ///
132        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
133        ///
134        /// # Safety
135        ///
136        /// `large_subtitle_text_attributes` generic should be of the correct type.
137        #[unsafe(method(setLargeSubtitleTextAttributes:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn setLargeSubtitleTextAttributes(
140            &self,
141            large_subtitle_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
142        );
143
144        #[cfg(feature = "UIBarButtonItemAppearance")]
145        /// The appearance for plain-style bar button items
146        #[unsafe(method(buttonAppearance))]
147        #[unsafe(method_family = none)]
148        pub fn buttonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
149
150        #[cfg(feature = "UIBarButtonItemAppearance")]
151        /// Setter for [`buttonAppearance`][Self::buttonAppearance].
152        ///
153        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
154        #[unsafe(method(setButtonAppearance:))]
155        #[unsafe(method_family = none)]
156        pub fn setButtonAppearance(&self, button_appearance: &UIBarButtonItemAppearance);
157
158        #[cfg(feature = "UIBarButtonItemAppearance")]
159        /// The appearance attributes for Prominent buttons.
160        ///
161        /// Use this property to configure the appearance of bar button items that use `UIBarButtonItemStyleProminent`.
162        /// If the navigation bar doesn't have any buttons using this style, this property has no effect.
163        #[unsafe(method(prominentButtonAppearance))]
164        #[unsafe(method_family = none)]
165        pub fn prominentButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
166
167        #[cfg(feature = "UIBarButtonItemAppearance")]
168        /// Setter for [`prominentButtonAppearance`][Self::prominentButtonAppearance].
169        ///
170        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
171        #[unsafe(method(setProminentButtonAppearance:))]
172        #[unsafe(method_family = none)]
173        pub fn setProminentButtonAppearance(
174            &self,
175            prominent_button_appearance: &UIBarButtonItemAppearance,
176        );
177
178        #[cfg(feature = "UIBarButtonItemAppearance")]
179        /// The appearance for back buttons. Defaults are drawn from buttonAppearance when appropriate.
180        #[unsafe(method(backButtonAppearance))]
181        #[unsafe(method_family = none)]
182        pub fn backButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
183
184        #[cfg(feature = "UIBarButtonItemAppearance")]
185        /// Setter for [`backButtonAppearance`][Self::backButtonAppearance].
186        ///
187        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
188        #[unsafe(method(setBackButtonAppearance:))]
189        #[unsafe(method_family = none)]
190        pub fn setBackButtonAppearance(&self, back_button_appearance: &UIBarButtonItemAppearance);
191
192        #[cfg(feature = "UIImage")]
193        /// The image shown on the leading edge of the back button.
194        #[unsafe(method(backIndicatorImage))]
195        #[unsafe(method_family = none)]
196        pub fn backIndicatorImage(&self) -> Retained<UIImage>;
197
198        #[cfg(feature = "UIImage")]
199        /// This image is used to mask content flowing underneath the backIndicatorImage during push
200        /// &
201        /// pop transitions
202        #[unsafe(method(backIndicatorTransitionMaskImage))]
203        #[unsafe(method_family = none)]
204        pub fn backIndicatorTransitionMaskImage(&self) -> Retained<UIImage>;
205
206        #[cfg(feature = "UIImage")]
207        /// Set the backIndicatorImage
208        /// &
209        /// backIndicatorTransitionMaskImage images. If either image is nil, then both images will be reset to their default.
210        #[unsafe(method(setBackIndicatorImage:transitionMaskImage:))]
211        #[unsafe(method_family = none)]
212        pub fn setBackIndicatorImage_transitionMaskImage(
213            &self,
214            back_indicator_image: Option<&UIImage>,
215            back_indicator_transition_mask_image: Option<&UIImage>,
216        );
217
218        #[cfg(feature = "UIBarButtonItemAppearance")]
219        /// The appearance for done-style bar button items
220        #[deprecated]
221        #[unsafe(method(doneButtonAppearance))]
222        #[unsafe(method_family = none)]
223        pub fn doneButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;
224
225        #[cfg(feature = "UIBarButtonItemAppearance")]
226        /// Setter for [`doneButtonAppearance`][Self::doneButtonAppearance].
227        ///
228        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
229        #[deprecated]
230        #[unsafe(method(setDoneButtonAppearance:))]
231        #[unsafe(method_family = none)]
232        pub fn setDoneButtonAppearance(&self, done_button_appearance: &UIBarButtonItemAppearance);
233    );
234}
235
236/// Methods declared on superclass `UIBarAppearance`.
237#[cfg(feature = "UIBarAppearance")]
238impl UINavigationBarAppearance {
239    extern_methods!(
240        /// Constructs a new bar appearance, configured with default values and targeting the device idiom.
241        #[unsafe(method(init))]
242        #[unsafe(method_family = init)]
243        pub fn init(this: Allocated<Self>) -> Retained<Self>;
244
245        #[cfg(feature = "UIDevice")]
246        /// 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.
247        #[unsafe(method(initWithIdiom:))]
248        #[unsafe(method_family = init)]
249        pub fn initWithIdiom(this: Allocated<Self>, idiom: UIUserInterfaceIdiom) -> Retained<Self>;
250
251        /// 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.
252        #[unsafe(method(initWithBarAppearance:))]
253        #[unsafe(method_family = init)]
254        pub fn initWithBarAppearance(
255            this: Allocated<Self>,
256            bar_appearance: &UIBarAppearance,
257        ) -> Retained<Self>;
258
259        /// # Safety
260        ///
261        /// `coder` possibly has further requirements.
262        #[unsafe(method(initWithCoder:))]
263        #[unsafe(method_family = init)]
264        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
265    );
266}
267
268/// Methods declared on superclass `NSObject`.
269#[cfg(feature = "UIBarAppearance")]
270impl UINavigationBarAppearance {
271    extern_methods!(
272        #[unsafe(method(new))]
273        #[unsafe(method_family = new)]
274        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
275    );
276}