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