objc2_ui_kit/generated/
UITabBarAppearance.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct UITabBarItemStateAppearance;
18);
19
20extern_conformance!(
21 unsafe impl NSObjectProtocol for UITabBarItemStateAppearance {}
22);
23
24impl UITabBarItemStateAppearance {
25 extern_methods!(
26 #[unsafe(method(init))]
27 #[unsafe(method_family = init)]
28 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30 #[unsafe(method(new))]
31 #[unsafe(method_family = new)]
32 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
33
34 #[unsafe(method(titleTextAttributes))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn titleTextAttributes(
38 &self,
39 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
40
41 #[unsafe(method(setTitleTextAttributes:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn setTitleTextAttributes(
45 &self,
46 title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
47 );
48
49 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
50 #[unsafe(method(titlePositionAdjustment))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn titlePositionAdjustment(&self) -> UIOffset;
54
55 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
56 #[unsafe(method(setTitlePositionAdjustment:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
60
61 #[cfg(feature = "UIColor")]
62 #[unsafe(method(iconColor))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn iconColor(&self) -> Option<Retained<UIColor>>;
66
67 #[cfg(feature = "UIColor")]
68 #[unsafe(method(setIconColor:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn setIconColor(&self, icon_color: Option<&UIColor>);
72
73 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
74 #[unsafe(method(badgePositionAdjustment))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn badgePositionAdjustment(&self) -> UIOffset;
78
79 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
80 #[unsafe(method(setBadgePositionAdjustment:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setBadgePositionAdjustment(&self, badge_position_adjustment: UIOffset);
84
85 #[cfg(feature = "UIColor")]
86 #[unsafe(method(badgeBackgroundColor))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn badgeBackgroundColor(&self) -> Option<Retained<UIColor>>;
90
91 #[cfg(feature = "UIColor")]
92 #[unsafe(method(setBadgeBackgroundColor:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn setBadgeBackgroundColor(&self, badge_background_color: Option<&UIColor>);
96
97 #[unsafe(method(badgeTextAttributes))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn badgeTextAttributes(
101 &self,
102 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
103
104 #[unsafe(method(setBadgeTextAttributes:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setBadgeTextAttributes(
108 &self,
109 badge_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
110 );
111
112 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
113 #[unsafe(method(badgeTitlePositionAdjustment))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn badgeTitlePositionAdjustment(&self) -> UIOffset;
117
118 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
119 #[unsafe(method(setBadgeTitlePositionAdjustment:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn setBadgeTitlePositionAdjustment(
123 &self,
124 badge_title_position_adjustment: UIOffset,
125 );
126 );
127}
128
129#[repr(transparent)]
132#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
133pub struct UITabBarItemAppearanceStyle(pub NSInteger);
134impl UITabBarItemAppearanceStyle {
135 #[doc(alias = "UITabBarItemAppearanceStyleStacked")]
136 pub const Stacked: Self = Self(0);
137 #[doc(alias = "UITabBarItemAppearanceStyleInline")]
138 pub const Inline: Self = Self(1);
139 #[doc(alias = "UITabBarItemAppearanceStyleCompactInline")]
140 pub const CompactInline: Self = Self(2);
141}
142
143unsafe impl Encode for UITabBarItemAppearanceStyle {
144 const ENCODING: Encoding = NSInteger::ENCODING;
145}
146
147unsafe impl RefEncode for UITabBarItemAppearanceStyle {
148 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
149}
150
151extern_class!(
152 #[unsafe(super(NSObject))]
154 #[thread_kind = MainThreadOnly]
155 #[derive(Debug, PartialEq, Eq, Hash)]
156 pub struct UITabBarItemAppearance;
157);
158
159extern_conformance!(
160 unsafe impl NSCoding for UITabBarItemAppearance {}
161);
162
163extern_conformance!(
164 unsafe impl NSCopying for UITabBarItemAppearance {}
165);
166
167unsafe impl CopyingHelper for UITabBarItemAppearance {
168 type Result = Self;
169}
170
171extern_conformance!(
172 unsafe impl NSObjectProtocol for UITabBarItemAppearance {}
173);
174
175extern_conformance!(
176 unsafe impl NSSecureCoding for UITabBarItemAppearance {}
177);
178
179impl UITabBarItemAppearance {
180 extern_methods!(
181 #[unsafe(method(init))]
183 #[unsafe(method_family = init)]
184 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
185
186 #[unsafe(method(initWithStyle:))]
188 #[unsafe(method_family = init)]
189 pub unsafe fn initWithStyle(
190 this: Allocated<Self>,
191 style: UITabBarItemAppearanceStyle,
192 ) -> Retained<Self>;
193
194 #[unsafe(method(initWithCoder:))]
195 #[unsafe(method_family = init)]
196 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
197
198 #[unsafe(method(copy))]
199 #[unsafe(method_family = copy)]
200 pub unsafe fn copy(&self) -> Retained<Self>;
201
202 #[unsafe(method(configureWithDefaultForStyle:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn configureWithDefaultForStyle(&self, style: UITabBarItemAppearanceStyle);
206
207 #[unsafe(method(normal))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn normal(&self) -> Retained<UITabBarItemStateAppearance>;
211
212 #[unsafe(method(selected))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn selected(&self) -> Retained<UITabBarItemStateAppearance>;
216
217 #[unsafe(method(disabled))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn disabled(&self) -> Retained<UITabBarItemStateAppearance>;
221
222 #[unsafe(method(focused))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn focused(&self) -> Retained<UITabBarItemStateAppearance>;
226 );
227}
228
229impl UITabBarItemAppearance {
231 extern_methods!(
232 #[unsafe(method(new))]
233 #[unsafe(method_family = new)]
234 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
235 );
236}
237
238extern_class!(
239 #[unsafe(super(UIBarAppearance, NSObject))]
241 #[thread_kind = MainThreadOnly]
242 #[derive(Debug, PartialEq, Eq, Hash)]
243 #[cfg(feature = "UIBarAppearance")]
244 pub struct UITabBarAppearance;
245);
246
247#[cfg(feature = "UIBarAppearance")]
248extern_conformance!(
249 unsafe impl NSCoding for UITabBarAppearance {}
250);
251
252#[cfg(feature = "UIBarAppearance")]
253extern_conformance!(
254 unsafe impl NSCopying for UITabBarAppearance {}
255);
256
257#[cfg(feature = "UIBarAppearance")]
258unsafe impl CopyingHelper for UITabBarAppearance {
259 type Result = Self;
260}
261
262#[cfg(feature = "UIBarAppearance")]
263extern_conformance!(
264 unsafe impl NSObjectProtocol for UITabBarAppearance {}
265);
266
267#[cfg(feature = "UIBarAppearance")]
268extern_conformance!(
269 unsafe impl NSSecureCoding for UITabBarAppearance {}
270);
271
272#[cfg(feature = "UIBarAppearance")]
273impl UITabBarAppearance {
274 extern_methods!(
275 #[unsafe(method(stackedLayoutAppearance))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn stackedLayoutAppearance(&self) -> Retained<UITabBarItemAppearance>;
279
280 #[unsafe(method(setStackedLayoutAppearance:))]
282 #[unsafe(method_family = none)]
283 pub unsafe fn setStackedLayoutAppearance(
284 &self,
285 stacked_layout_appearance: &UITabBarItemAppearance,
286 );
287
288 #[unsafe(method(inlineLayoutAppearance))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn inlineLayoutAppearance(&self) -> Retained<UITabBarItemAppearance>;
292
293 #[unsafe(method(setInlineLayoutAppearance:))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn setInlineLayoutAppearance(
297 &self,
298 inline_layout_appearance: &UITabBarItemAppearance,
299 );
300
301 #[unsafe(method(compactInlineLayoutAppearance))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn compactInlineLayoutAppearance(&self) -> Retained<UITabBarItemAppearance>;
305
306 #[unsafe(method(setCompactInlineLayoutAppearance:))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn setCompactInlineLayoutAppearance(
310 &self,
311 compact_inline_layout_appearance: &UITabBarItemAppearance,
312 );
313
314 #[cfg(feature = "UIColor")]
315 #[unsafe(method(selectionIndicatorTintColor))]
317 #[unsafe(method_family = none)]
318 pub unsafe fn selectionIndicatorTintColor(&self) -> Option<Retained<UIColor>>;
319
320 #[cfg(feature = "UIColor")]
321 #[unsafe(method(setSelectionIndicatorTintColor:))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn setSelectionIndicatorTintColor(
325 &self,
326 selection_indicator_tint_color: Option<&UIColor>,
327 );
328
329 #[cfg(feature = "UIImage")]
330 #[unsafe(method(selectionIndicatorImage))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn selectionIndicatorImage(&self) -> Option<Retained<UIImage>>;
334
335 #[cfg(feature = "UIImage")]
336 #[unsafe(method(setSelectionIndicatorImage:))]
338 #[unsafe(method_family = none)]
339 pub unsafe fn setSelectionIndicatorImage(
340 &self,
341 selection_indicator_image: Option<&UIImage>,
342 );
343
344 #[cfg(feature = "UITabBar")]
345 #[unsafe(method(stackedItemPositioning))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn stackedItemPositioning(&self) -> UITabBarItemPositioning;
349
350 #[cfg(feature = "UITabBar")]
351 #[unsafe(method(setStackedItemPositioning:))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn setStackedItemPositioning(
355 &self,
356 stacked_item_positioning: UITabBarItemPositioning,
357 );
358
359 #[cfg(feature = "objc2-core-foundation")]
360 #[unsafe(method(stackedItemWidth))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn stackedItemWidth(&self) -> CGFloat;
363
364 #[cfg(feature = "objc2-core-foundation")]
365 #[unsafe(method(setStackedItemWidth:))]
367 #[unsafe(method_family = none)]
368 pub unsafe fn setStackedItemWidth(&self, stacked_item_width: CGFloat);
369
370 #[cfg(feature = "objc2-core-foundation")]
371 #[unsafe(method(stackedItemSpacing))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn stackedItemSpacing(&self) -> CGFloat;
374
375 #[cfg(feature = "objc2-core-foundation")]
376 #[unsafe(method(setStackedItemSpacing:))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn setStackedItemSpacing(&self, stacked_item_spacing: CGFloat);
380 );
381}
382
383#[cfg(feature = "UIBarAppearance")]
385impl UITabBarAppearance {
386 extern_methods!(
387 #[unsafe(method(init))]
389 #[unsafe(method_family = init)]
390 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
391
392 #[cfg(feature = "UIDevice")]
393 #[unsafe(method(initWithIdiom:))]
395 #[unsafe(method_family = init)]
396 pub unsafe fn initWithIdiom(
397 this: Allocated<Self>,
398 idiom: UIUserInterfaceIdiom,
399 ) -> Retained<Self>;
400
401 #[unsafe(method(initWithBarAppearance:))]
403 #[unsafe(method_family = init)]
404 pub unsafe fn initWithBarAppearance(
405 this: Allocated<Self>,
406 bar_appearance: &UIBarAppearance,
407 ) -> Retained<Self>;
408
409 #[unsafe(method(initWithCoder:))]
410 #[unsafe(method_family = init)]
411 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
412 );
413}
414
415#[cfg(feature = "UIBarAppearance")]
417impl UITabBarAppearance {
418 extern_methods!(
419 #[unsafe(method(new))]
420 #[unsafe(method_family = new)]
421 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
422 );
423}