1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-symbols")]
10use objc2_symbols::*;
11
12use crate::*;
13
14#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct UIBarButtonItemStyle(pub NSInteger);
19impl UIBarButtonItemStyle {
20 #[doc(alias = "UIBarButtonItemStylePlain")]
21 pub const Plain: Self = Self(0);
22 #[deprecated]
23 #[doc(alias = "UIBarButtonItemStyleBordered")]
24 pub const Bordered: Self = Self(1);
25 #[doc(alias = "UIBarButtonItemStyleDone")]
26 pub const Done: Self = Self(2);
27}
28
29unsafe impl Encode for UIBarButtonItemStyle {
30 const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for UIBarButtonItemStyle {
34 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct UIBarButtonSystemItem(pub NSInteger);
42impl UIBarButtonSystemItem {
43 #[doc(alias = "UIBarButtonSystemItemDone")]
44 pub const Done: Self = Self(0);
45 #[doc(alias = "UIBarButtonSystemItemCancel")]
46 pub const Cancel: Self = Self(1);
47 #[doc(alias = "UIBarButtonSystemItemEdit")]
48 pub const Edit: Self = Self(2);
49 #[doc(alias = "UIBarButtonSystemItemSave")]
50 pub const Save: Self = Self(3);
51 #[doc(alias = "UIBarButtonSystemItemAdd")]
52 pub const Add: Self = Self(4);
53 #[doc(alias = "UIBarButtonSystemItemFlexibleSpace")]
54 pub const FlexibleSpace: Self = Self(5);
55 #[doc(alias = "UIBarButtonSystemItemFixedSpace")]
56 pub const FixedSpace: Self = Self(6);
57 #[doc(alias = "UIBarButtonSystemItemCompose")]
58 pub const Compose: Self = Self(7);
59 #[doc(alias = "UIBarButtonSystemItemReply")]
60 pub const Reply: Self = Self(8);
61 #[doc(alias = "UIBarButtonSystemItemAction")]
62 pub const Action: Self = Self(9);
63 #[doc(alias = "UIBarButtonSystemItemOrganize")]
64 pub const Organize: Self = Self(10);
65 #[doc(alias = "UIBarButtonSystemItemBookmarks")]
66 pub const Bookmarks: Self = Self(11);
67 #[doc(alias = "UIBarButtonSystemItemSearch")]
68 pub const Search: Self = Self(12);
69 #[doc(alias = "UIBarButtonSystemItemRefresh")]
70 pub const Refresh: Self = Self(13);
71 #[doc(alias = "UIBarButtonSystemItemStop")]
72 pub const Stop: Self = Self(14);
73 #[doc(alias = "UIBarButtonSystemItemCamera")]
74 pub const Camera: Self = Self(15);
75 #[doc(alias = "UIBarButtonSystemItemTrash")]
76 pub const Trash: Self = Self(16);
77 #[doc(alias = "UIBarButtonSystemItemPlay")]
78 pub const Play: Self = Self(17);
79 #[doc(alias = "UIBarButtonSystemItemPause")]
80 pub const Pause: Self = Self(18);
81 #[doc(alias = "UIBarButtonSystemItemRewind")]
82 pub const Rewind: Self = Self(19);
83 #[doc(alias = "UIBarButtonSystemItemFastForward")]
84 pub const FastForward: Self = Self(20);
85 #[doc(alias = "UIBarButtonSystemItemUndo")]
86 pub const Undo: Self = Self(21);
87 #[doc(alias = "UIBarButtonSystemItemRedo")]
88 pub const Redo: Self = Self(22);
89 #[deprecated]
90 #[doc(alias = "UIBarButtonSystemItemPageCurl")]
91 pub const PageCurl: Self = Self(23);
92 #[doc(alias = "UIBarButtonSystemItemClose")]
93 pub const Close: Self = Self(24);
94 #[doc(alias = "UIBarButtonSystemItemWritingTools")]
95 pub const WritingTools: Self = Self(25);
96}
97
98unsafe impl Encode for UIBarButtonSystemItem {
99 const ENCODING: Encoding = NSInteger::ENCODING;
100}
101
102unsafe impl RefEncode for UIBarButtonSystemItem {
103 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
104}
105
106extern_class!(
107 #[unsafe(super(UIBarItem, NSObject))]
109 #[thread_kind = MainThreadOnly]
110 #[derive(Debug, PartialEq, Eq, Hash)]
111 #[cfg(feature = "UIBarItem")]
112 pub struct UIBarButtonItem;
113);
114
115#[cfg(feature = "UIBarItem")]
116unsafe impl NSCoding for UIBarButtonItem {}
117
118#[cfg(feature = "UIBarItem")]
119unsafe impl NSObjectProtocol for UIBarButtonItem {}
120
121#[cfg(all(feature = "UIAppearance", feature = "UIBarItem"))]
122unsafe impl UIAppearance for UIBarButtonItem {}
123
124#[cfg(feature = "UIBarItem")]
125impl UIBarButtonItem {
126 extern_methods!(
127 #[unsafe(method(init))]
128 #[unsafe(method_family = init)]
129 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
130
131 #[unsafe(method(initWithCoder:))]
132 #[unsafe(method_family = init)]
133 pub unsafe fn initWithCoder(
134 this: Allocated<Self>,
135 coder: &NSCoder,
136 ) -> Option<Retained<Self>>;
137
138 #[cfg(feature = "UIImage")]
139 #[unsafe(method(initWithImage:style:target:action:))]
140 #[unsafe(method_family = init)]
141 pub unsafe fn initWithImage_style_target_action(
142 this: Allocated<Self>,
143 image: Option<&UIImage>,
144 style: UIBarButtonItemStyle,
145 target: Option<&AnyObject>,
146 action: Option<Sel>,
147 ) -> Retained<Self>;
148
149 #[cfg(feature = "UIImage")]
150 #[unsafe(method(initWithImage:landscapeImagePhone:style:target:action:))]
151 #[unsafe(method_family = init)]
152 pub unsafe fn initWithImage_landscapeImagePhone_style_target_action(
153 this: Allocated<Self>,
154 image: Option<&UIImage>,
155 landscape_image_phone: Option<&UIImage>,
156 style: UIBarButtonItemStyle,
157 target: Option<&AnyObject>,
158 action: Option<Sel>,
159 ) -> Retained<Self>;
160
161 #[unsafe(method(initWithTitle:style:target:action:))]
162 #[unsafe(method_family = init)]
163 pub unsafe fn initWithTitle_style_target_action(
164 this: Allocated<Self>,
165 title: Option<&NSString>,
166 style: UIBarButtonItemStyle,
167 target: Option<&AnyObject>,
168 action: Option<Sel>,
169 ) -> Retained<Self>;
170
171 #[unsafe(method(initWithBarButtonSystemItem:target:action:))]
172 #[unsafe(method_family = init)]
173 pub unsafe fn initWithBarButtonSystemItem_target_action(
174 this: Allocated<Self>,
175 system_item: UIBarButtonSystemItem,
176 target: Option<&AnyObject>,
177 action: Option<Sel>,
178 ) -> Retained<Self>;
179
180 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
181 #[unsafe(method(initWithCustomView:))]
182 #[unsafe(method_family = init)]
183 pub unsafe fn initWithCustomView(
184 this: Allocated<Self>,
185 custom_view: &UIView,
186 ) -> Retained<Self>;
187
188 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
189 #[unsafe(method(initWithBarButtonSystemItem:primaryAction:))]
193 #[unsafe(method_family = init)]
194 pub unsafe fn initWithBarButtonSystemItem_primaryAction(
195 this: Allocated<Self>,
196 system_item: UIBarButtonSystemItem,
197 primary_action: Option<&UIAction>,
198 ) -> Retained<Self>;
199
200 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
201 #[unsafe(method(initWithPrimaryAction:))]
203 #[unsafe(method_family = init)]
204 pub unsafe fn initWithPrimaryAction(
205 this: Allocated<Self>,
206 primary_action: Option<&UIAction>,
207 ) -> Retained<Self>;
208
209 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
210 #[unsafe(method(initWithBarButtonSystemItem:menu:))]
212 #[unsafe(method_family = init)]
213 pub unsafe fn initWithBarButtonSystemItem_menu(
214 this: Allocated<Self>,
215 system_item: UIBarButtonSystemItem,
216 menu: Option<&UIMenu>,
217 ) -> Retained<Self>;
218
219 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
220 #[unsafe(method(initWithTitle:menu:))]
222 #[unsafe(method_family = init)]
223 pub unsafe fn initWithTitle_menu(
224 this: Allocated<Self>,
225 title: Option<&NSString>,
226 menu: Option<&UIMenu>,
227 ) -> Retained<Self>;
228
229 #[cfg(all(feature = "UIImage", feature = "UIMenu", feature = "UIMenuElement"))]
230 #[unsafe(method(initWithImage:menu:))]
232 #[unsafe(method_family = init)]
233 pub unsafe fn initWithImage_menu(
234 this: Allocated<Self>,
235 image: Option<&UIImage>,
236 menu: Option<&UIMenu>,
237 ) -> Retained<Self>;
238
239 #[cfg(all(feature = "UIAction", feature = "UIMenu", feature = "UIMenuElement"))]
240 #[unsafe(method(initWithPrimaryAction:menu:))]
242 #[unsafe(method_family = init)]
243 pub unsafe fn initWithPrimaryAction_menu(
244 this: Allocated<Self>,
245 primary_action: Option<&UIAction>,
246 menu: Option<&UIMenu>,
247 ) -> Retained<Self>;
248
249 #[cfg(all(feature = "UIAction", feature = "UIMenu", feature = "UIMenuElement"))]
250 #[unsafe(method(initWithBarButtonSystemItem:primaryAction:menu:))]
254 #[unsafe(method_family = init)]
255 pub unsafe fn initWithBarButtonSystemItem_primaryAction_menu(
256 this: Allocated<Self>,
257 system_item: UIBarButtonSystemItem,
258 primary_action: Option<&UIAction>,
259 menu: Option<&UIMenu>,
260 ) -> Retained<Self>;
261
262 #[cfg(all(feature = "UIImage", feature = "UIMenu", feature = "UIMenuElement"))]
263 #[unsafe(method(initWithTitle:image:target:action:menu:))]
265 #[unsafe(method_family = init)]
266 pub unsafe fn initWithTitle_image_target_action_menu(
267 this: Allocated<Self>,
268 title: Option<&NSString>,
269 image: Option<&UIImage>,
270 target: Option<&AnyObject>,
271 action: Option<Sel>,
272 menu: Option<&UIMenu>,
273 ) -> Retained<Self>;
274
275 #[cfg(feature = "objc2-core-foundation")]
276 #[unsafe(method(fixedSpaceItemOfWidth:))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn fixedSpaceItemOfWidth(
280 width: CGFloat,
281 mtm: MainThreadMarker,
282 ) -> Retained<Self>;
283
284 #[unsafe(method(flexibleSpaceItem))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn flexibleSpaceItem(mtm: MainThreadMarker) -> Retained<Self>;
288
289 #[unsafe(method(style))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn style(&self) -> UIBarButtonItemStyle;
292
293 #[unsafe(method(setStyle:))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn setStyle(&self, style: UIBarButtonItemStyle);
297
298 #[cfg(feature = "objc2-core-foundation")]
299 #[unsafe(method(width))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn width(&self) -> CGFloat;
302
303 #[cfg(feature = "objc2-core-foundation")]
304 #[unsafe(method(setWidth:))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn setWidth(&self, width: CGFloat);
308
309 #[unsafe(method(possibleTitles))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn possibleTitles(&self) -> Option<Retained<NSSet<NSString>>>;
312
313 #[unsafe(method(setPossibleTitles:))]
315 #[unsafe(method_family = none)]
316 pub unsafe fn setPossibleTitles(&self, possible_titles: Option<&NSSet<NSString>>);
317
318 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
319 #[unsafe(method(customView))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn customView(&self) -> Option<Retained<UIView>>;
322
323 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
324 #[unsafe(method(setCustomView:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn setCustomView(&self, custom_view: Option<&UIView>);
328
329 #[unsafe(method(action))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn action(&self) -> Option<Sel>;
332
333 #[unsafe(method(setAction:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn setAction(&self, action: Option<Sel>);
337
338 #[unsafe(method(target))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
341
342 #[unsafe(method(setTarget:))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
347
348 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
349 #[unsafe(method(primaryAction))]
357 #[unsafe(method_family = none)]
358 pub unsafe fn primaryAction(&self) -> Option<Retained<UIAction>>;
359
360 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
361 #[unsafe(method(setPrimaryAction:))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn setPrimaryAction(&self, primary_action: Option<&UIAction>);
365
366 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
367 #[unsafe(method(menu))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn menu(&self) -> Option<Retained<UIMenu>>;
371
372 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
373 #[unsafe(method(setMenu:))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn setMenu(&self, menu: Option<&UIMenu>);
377
378 #[cfg(feature = "UIContextMenuConfiguration")]
379 #[unsafe(method(preferredMenuElementOrder))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn preferredMenuElementOrder(&self) -> UIContextMenuConfigurationElementOrder;
383
384 #[cfg(feature = "UIContextMenuConfiguration")]
385 #[unsafe(method(setPreferredMenuElementOrder:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn setPreferredMenuElementOrder(
389 &self,
390 preferred_menu_element_order: UIContextMenuConfigurationElementOrder,
391 );
392
393 #[unsafe(method(changesSelectionAsPrimaryAction))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn changesSelectionAsPrimaryAction(&self) -> bool;
399
400 #[unsafe(method(setChangesSelectionAsPrimaryAction:))]
402 #[unsafe(method_family = none)]
403 pub unsafe fn setChangesSelectionAsPrimaryAction(
404 &self,
405 changes_selection_as_primary_action: bool,
406 );
407
408 #[unsafe(method(isSelected))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn isSelected(&self) -> bool;
411
412 #[unsafe(method(setSelected:))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn setSelected(&self, selected: bool);
416
417 #[unsafe(method(isHidden))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn isHidden(&self) -> bool;
421
422 #[unsafe(method(setHidden:))]
424 #[unsafe(method_family = none)]
425 pub unsafe fn setHidden(&self, hidden: bool);
426
427 #[unsafe(method(isSymbolAnimationEnabled))]
429 #[unsafe(method_family = none)]
430 pub unsafe fn isSymbolAnimationEnabled(&self) -> bool;
431
432 #[unsafe(method(setSymbolAnimationEnabled:))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool);
436
437 #[cfg(feature = "UIMenuElement")]
438 #[unsafe(method(menuRepresentation))]
440 #[unsafe(method_family = none)]
441 pub unsafe fn menuRepresentation(&self) -> Option<Retained<UIMenuElement>>;
442
443 #[cfg(feature = "UIMenuElement")]
444 #[unsafe(method(setMenuRepresentation:))]
446 #[unsafe(method_family = none)]
447 pub unsafe fn setMenuRepresentation(&self, menu_representation: Option<&UIMenuElement>);
448
449 #[cfg(feature = "UIBarButtonItemGroup")]
450 #[unsafe(method(creatingFixedGroup))]
452 #[unsafe(method_family = none)]
453 pub unsafe fn creatingFixedGroup(&self) -> Retained<UIBarButtonItemGroup>;
454
455 #[cfg(feature = "UIBarButtonItemGroup")]
456 #[unsafe(method(creatingMovableGroupWithCustomizationIdentifier:))]
458 #[unsafe(method_family = none)]
459 pub unsafe fn creatingMovableGroupWithCustomizationIdentifier(
460 &self,
461 customization_identifier: &NSString,
462 ) -> Retained<UIBarButtonItemGroup>;
463
464 #[cfg(feature = "UIBarButtonItemGroup")]
465 #[unsafe(method(creatingOptionalGroupWithCustomizationIdentifier:inDefaultCustomization:))]
467 #[unsafe(method_family = none)]
468 pub unsafe fn creatingOptionalGroupWithCustomizationIdentifier_inDefaultCustomization(
469 &self,
470 customization_identifier: &NSString,
471 in_default_customization: bool,
472 ) -> Retained<UIBarButtonItemGroup>;
473
474 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
475 #[unsafe(method(setBackgroundImage:forState:barMetrics:))]
476 #[unsafe(method_family = none)]
477 pub unsafe fn setBackgroundImage_forState_barMetrics(
478 &self,
479 background_image: Option<&UIImage>,
480 state: UIControlState,
481 bar_metrics: UIBarMetrics,
482 );
483
484 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
485 #[unsafe(method(backgroundImageForState:barMetrics:))]
486 #[unsafe(method_family = none)]
487 pub unsafe fn backgroundImageForState_barMetrics(
488 &self,
489 state: UIControlState,
490 bar_metrics: UIBarMetrics,
491 ) -> Option<Retained<UIImage>>;
492
493 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
494 #[unsafe(method(setBackgroundImage:forState:style:barMetrics:))]
495 #[unsafe(method_family = none)]
496 pub unsafe fn setBackgroundImage_forState_style_barMetrics(
497 &self,
498 background_image: Option<&UIImage>,
499 state: UIControlState,
500 style: UIBarButtonItemStyle,
501 bar_metrics: UIBarMetrics,
502 );
503
504 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
505 #[unsafe(method(backgroundImageForState:style:barMetrics:))]
506 #[unsafe(method_family = none)]
507 pub unsafe fn backgroundImageForState_style_barMetrics(
508 &self,
509 state: UIControlState,
510 style: UIBarButtonItemStyle,
511 bar_metrics: UIBarMetrics,
512 ) -> Option<Retained<UIImage>>;
513
514 #[cfg(feature = "UIColor")]
515 #[unsafe(method(tintColor))]
516 #[unsafe(method_family = none)]
517 pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
518
519 #[cfg(feature = "UIColor")]
520 #[unsafe(method(setTintColor:))]
522 #[unsafe(method_family = none)]
523 pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
524
525 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
526 #[unsafe(method(setBackgroundVerticalPositionAdjustment:forBarMetrics:))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn setBackgroundVerticalPositionAdjustment_forBarMetrics(
529 &self,
530 adjustment: CGFloat,
531 bar_metrics: UIBarMetrics,
532 );
533
534 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
535 #[unsafe(method(backgroundVerticalPositionAdjustmentForBarMetrics:))]
536 #[unsafe(method_family = none)]
537 pub unsafe fn backgroundVerticalPositionAdjustmentForBarMetrics(
538 &self,
539 bar_metrics: UIBarMetrics,
540 ) -> CGFloat;
541
542 #[cfg(all(
543 feature = "UIBarCommon",
544 feature = "UIGeometry",
545 feature = "objc2-core-foundation"
546 ))]
547 #[unsafe(method(setTitlePositionAdjustment:forBarMetrics:))]
548 #[unsafe(method_family = none)]
549 pub unsafe fn setTitlePositionAdjustment_forBarMetrics(
550 &self,
551 adjustment: UIOffset,
552 bar_metrics: UIBarMetrics,
553 );
554
555 #[cfg(all(
556 feature = "UIBarCommon",
557 feature = "UIGeometry",
558 feature = "objc2-core-foundation"
559 ))]
560 #[unsafe(method(titlePositionAdjustmentForBarMetrics:))]
561 #[unsafe(method_family = none)]
562 pub unsafe fn titlePositionAdjustmentForBarMetrics(
563 &self,
564 bar_metrics: UIBarMetrics,
565 ) -> UIOffset;
566
567 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
568 #[unsafe(method(setBackButtonBackgroundImage:forState:barMetrics:))]
569 #[unsafe(method_family = none)]
570 pub unsafe fn setBackButtonBackgroundImage_forState_barMetrics(
571 &self,
572 background_image: Option<&UIImage>,
573 state: UIControlState,
574 bar_metrics: UIBarMetrics,
575 );
576
577 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
578 #[unsafe(method(backButtonBackgroundImageForState:barMetrics:))]
579 #[unsafe(method_family = none)]
580 pub unsafe fn backButtonBackgroundImageForState_barMetrics(
581 &self,
582 state: UIControlState,
583 bar_metrics: UIBarMetrics,
584 ) -> Option<Retained<UIImage>>;
585
586 #[cfg(all(
587 feature = "UIBarCommon",
588 feature = "UIGeometry",
589 feature = "objc2-core-foundation"
590 ))]
591 #[unsafe(method(setBackButtonTitlePositionAdjustment:forBarMetrics:))]
592 #[unsafe(method_family = none)]
593 pub unsafe fn setBackButtonTitlePositionAdjustment_forBarMetrics(
594 &self,
595 adjustment: UIOffset,
596 bar_metrics: UIBarMetrics,
597 );
598
599 #[cfg(all(
600 feature = "UIBarCommon",
601 feature = "UIGeometry",
602 feature = "objc2-core-foundation"
603 ))]
604 #[unsafe(method(backButtonTitlePositionAdjustmentForBarMetrics:))]
605 #[unsafe(method_family = none)]
606 pub unsafe fn backButtonTitlePositionAdjustmentForBarMetrics(
607 &self,
608 bar_metrics: UIBarMetrics,
609 ) -> UIOffset;
610
611 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
612 #[unsafe(method(setBackButtonBackgroundVerticalPositionAdjustment:forBarMetrics:))]
613 #[unsafe(method_family = none)]
614 pub unsafe fn setBackButtonBackgroundVerticalPositionAdjustment_forBarMetrics(
615 &self,
616 adjustment: CGFloat,
617 bar_metrics: UIBarMetrics,
618 );
619
620 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
621 #[unsafe(method(backButtonBackgroundVerticalPositionAdjustmentForBarMetrics:))]
622 #[unsafe(method_family = none)]
623 pub unsafe fn backButtonBackgroundVerticalPositionAdjustmentForBarMetrics(
624 &self,
625 bar_metrics: UIBarMetrics,
626 ) -> CGFloat;
627 );
628}
629
630#[cfg(feature = "UIBarItem")]
632impl UIBarButtonItem {
633 extern_methods!(
634 #[unsafe(method(new))]
635 #[unsafe(method_family = new)]
636 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
637 );
638}
639
640#[cfg(feature = "UIBarItem")]
642impl UIBarButtonItem {
643 extern_methods!();
644}
645
646#[cfg(all(feature = "UIBarItem", feature = "UISpringLoadedInteractionSupporting"))]
647unsafe impl UISpringLoadedInteractionSupporting for UIBarButtonItem {}
648
649#[cfg(feature = "UIBarItem")]
650impl UIBarButtonItem {
651 extern_methods!(
652 #[cfg(feature = "objc2-symbols")]
653 #[unsafe(method(addSymbolEffect:))]
656 #[unsafe(method_family = none)]
657 pub unsafe fn addSymbolEffect(&self, symbol_effect: &NSSymbolEffect);
658
659 #[cfg(feature = "objc2-symbols")]
660 #[unsafe(method(addSymbolEffect:options:))]
663 #[unsafe(method_family = none)]
664 pub unsafe fn addSymbolEffect_options(
665 &self,
666 symbol_effect: &NSSymbolEffect,
667 options: &NSSymbolEffectOptions,
668 );
669
670 #[cfg(feature = "objc2-symbols")]
671 #[unsafe(method(addSymbolEffect:options:animated:))]
674 #[unsafe(method_family = none)]
675 pub unsafe fn addSymbolEffect_options_animated(
676 &self,
677 symbol_effect: &NSSymbolEffect,
678 options: &NSSymbolEffectOptions,
679 animated: bool,
680 );
681
682 #[cfg(feature = "objc2-symbols")]
683 #[unsafe(method(removeSymbolEffectOfType:))]
685 #[unsafe(method_family = none)]
686 pub unsafe fn removeSymbolEffectOfType(&self, symbol_effect: &NSSymbolEffect);
687
688 #[cfg(feature = "objc2-symbols")]
689 #[unsafe(method(removeSymbolEffectOfType:options:))]
691 #[unsafe(method_family = none)]
692 pub unsafe fn removeSymbolEffectOfType_options(
693 &self,
694 symbol_effect: &NSSymbolEffect,
695 options: &NSSymbolEffectOptions,
696 );
697
698 #[cfg(feature = "objc2-symbols")]
699 #[unsafe(method(removeSymbolEffectOfType:options:animated:))]
701 #[unsafe(method_family = none)]
702 pub unsafe fn removeSymbolEffectOfType_options_animated(
703 &self,
704 symbol_effect: &NSSymbolEffect,
705 options: &NSSymbolEffectOptions,
706 animated: bool,
707 );
708
709 #[unsafe(method(removeAllSymbolEffects))]
711 #[unsafe(method_family = none)]
712 pub unsafe fn removeAllSymbolEffects(&self);
713
714 #[cfg(feature = "objc2-symbols")]
715 #[unsafe(method(removeAllSymbolEffectsWithOptions:))]
717 #[unsafe(method_family = none)]
718 pub unsafe fn removeAllSymbolEffectsWithOptions(&self, options: &NSSymbolEffectOptions);
719
720 #[cfg(feature = "objc2-symbols")]
721 #[unsafe(method(removeAllSymbolEffectsWithOptions:animated:))]
723 #[unsafe(method_family = none)]
724 pub unsafe fn removeAllSymbolEffectsWithOptions_animated(
725 &self,
726 options: &NSSymbolEffectOptions,
727 animated: bool,
728 );
729
730 #[cfg(all(feature = "UIImage", feature = "objc2-symbols"))]
731 #[unsafe(method(setSymbolImage:withContentTransition:))]
734 #[unsafe(method_family = none)]
735 pub unsafe fn setSymbolImage_withContentTransition(
736 &self,
737 symbol_image: &UIImage,
738 transition: &NSSymbolContentTransition,
739 );
740
741 #[cfg(all(feature = "UIImage", feature = "objc2-symbols"))]
742 #[unsafe(method(setSymbolImage:withContentTransition:options:))]
745 #[unsafe(method_family = none)]
746 pub unsafe fn setSymbolImage_withContentTransition_options(
747 &self,
748 symbol_image: &UIImage,
749 transition: &NSSymbolContentTransition,
750 options: &NSSymbolEffectOptions,
751 );
752 );
753}