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 #[doc(alias = "UIBarButtonItemStyleProminent")]
29 pub const Prominent: Self = Self(2);
30 #[doc(alias = "UIBarButtonItemStyleBordered")]
37 #[deprecated]
38 pub const Bordered: Self = Self(1);
39 #[doc(alias = "UIBarButtonItemStyleDone")]
46 #[deprecated]
47 pub const Done: Self = Self(UIBarButtonItemStyle::Prominent.0);
48}
49
50unsafe impl Encode for UIBarButtonItemStyle {
51 const ENCODING: Encoding = NSInteger::ENCODING;
52}
53
54unsafe impl RefEncode for UIBarButtonItemStyle {
55 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58#[repr(transparent)]
61#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
62pub struct UIBarButtonSystemItem(pub NSInteger);
63impl UIBarButtonSystemItem {
64 #[doc(alias = "UIBarButtonSystemItemDone")]
65 pub const Done: Self = Self(0);
66 #[doc(alias = "UIBarButtonSystemItemCancel")]
67 pub const Cancel: Self = Self(1);
68 #[doc(alias = "UIBarButtonSystemItemEdit")]
69 pub const Edit: Self = Self(2);
70 #[doc(alias = "UIBarButtonSystemItemSave")]
71 pub const Save: Self = Self(3);
72 #[doc(alias = "UIBarButtonSystemItemAdd")]
73 pub const Add: Self = Self(4);
74 #[doc(alias = "UIBarButtonSystemItemFlexibleSpace")]
75 pub const FlexibleSpace: Self = Self(5);
76 #[doc(alias = "UIBarButtonSystemItemFixedSpace")]
77 pub const FixedSpace: Self = Self(6);
78 #[doc(alias = "UIBarButtonSystemItemCompose")]
79 pub const Compose: Self = Self(7);
80 #[doc(alias = "UIBarButtonSystemItemReply")]
81 pub const Reply: Self = Self(8);
82 #[doc(alias = "UIBarButtonSystemItemAction")]
83 pub const Action: Self = Self(9);
84 #[doc(alias = "UIBarButtonSystemItemOrganize")]
85 pub const Organize: Self = Self(10);
86 #[doc(alias = "UIBarButtonSystemItemBookmarks")]
87 pub const Bookmarks: Self = Self(11);
88 #[doc(alias = "UIBarButtonSystemItemSearch")]
89 pub const Search: Self = Self(12);
90 #[doc(alias = "UIBarButtonSystemItemRefresh")]
91 pub const Refresh: Self = Self(13);
92 #[doc(alias = "UIBarButtonSystemItemStop")]
93 pub const Stop: Self = Self(14);
94 #[doc(alias = "UIBarButtonSystemItemCamera")]
95 pub const Camera: Self = Self(15);
96 #[doc(alias = "UIBarButtonSystemItemTrash")]
97 pub const Trash: Self = Self(16);
98 #[doc(alias = "UIBarButtonSystemItemPlay")]
99 pub const Play: Self = Self(17);
100 #[doc(alias = "UIBarButtonSystemItemPause")]
101 pub const Pause: Self = Self(18);
102 #[doc(alias = "UIBarButtonSystemItemRewind")]
103 pub const Rewind: Self = Self(19);
104 #[doc(alias = "UIBarButtonSystemItemFastForward")]
105 pub const FastForward: Self = Self(20);
106 #[doc(alias = "UIBarButtonSystemItemUndo")]
107 pub const Undo: Self = Self(21);
108 #[doc(alias = "UIBarButtonSystemItemRedo")]
109 pub const Redo: Self = Self(22);
110 #[doc(alias = "UIBarButtonSystemItemPageCurl")]
111 #[deprecated]
112 pub const PageCurl: Self = Self(23);
113 #[doc(alias = "UIBarButtonSystemItemClose")]
114 pub const Close: Self = Self(24);
115 #[doc(alias = "UIBarButtonSystemItemWritingTools")]
116 pub const WritingTools: Self = Self(25);
117}
118
119unsafe impl Encode for UIBarButtonSystemItem {
120 const ENCODING: Encoding = NSInteger::ENCODING;
121}
122
123unsafe impl RefEncode for UIBarButtonSystemItem {
124 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
125}
126
127extern_class!(
128 #[unsafe(super(UIBarItem, NSObject))]
130 #[thread_kind = MainThreadOnly]
131 #[derive(Debug, PartialEq, Eq, Hash)]
132 #[cfg(feature = "UIBarItem")]
133 pub struct UIBarButtonItem;
134);
135
136#[cfg(feature = "UIBarItem")]
137extern_conformance!(
138 unsafe impl NSCoding for UIBarButtonItem {}
139);
140
141#[cfg(feature = "UIBarItem")]
142extern_conformance!(
143 unsafe impl NSObjectProtocol for UIBarButtonItem {}
144);
145
146#[cfg(all(feature = "UIAppearance", feature = "UIBarItem"))]
147extern_conformance!(
148 unsafe impl UIAppearance for UIBarButtonItem {}
149);
150
151#[cfg(feature = "UIBarItem")]
152impl UIBarButtonItem {
153 extern_methods!(
154 #[unsafe(method(init))]
155 #[unsafe(method_family = init)]
156 pub fn init(this: Allocated<Self>) -> Retained<Self>;
157
158 #[unsafe(method(initWithCoder:))]
162 #[unsafe(method_family = init)]
163 pub unsafe fn initWithCoder(
164 this: Allocated<Self>,
165 coder: &NSCoder,
166 ) -> Option<Retained<Self>>;
167
168 #[cfg(feature = "UIImage")]
169 #[unsafe(method(initWithImage:style:target:action:))]
174 #[unsafe(method_family = init)]
175 pub unsafe fn initWithImage_style_target_action(
176 this: Allocated<Self>,
177 image: Option<&UIImage>,
178 style: UIBarButtonItemStyle,
179 target: Option<&AnyObject>,
180 action: Option<Sel>,
181 ) -> Retained<Self>;
182
183 #[cfg(feature = "UIImage")]
184 #[unsafe(method(initWithImage:landscapeImagePhone:style:target:action:))]
189 #[unsafe(method_family = init)]
190 pub unsafe fn initWithImage_landscapeImagePhone_style_target_action(
191 this: Allocated<Self>,
192 image: Option<&UIImage>,
193 landscape_image_phone: Option<&UIImage>,
194 style: UIBarButtonItemStyle,
195 target: Option<&AnyObject>,
196 action: Option<Sel>,
197 ) -> Retained<Self>;
198
199 #[unsafe(method(initWithTitle:style:target:action:))]
204 #[unsafe(method_family = init)]
205 pub unsafe fn initWithTitle_style_target_action(
206 this: Allocated<Self>,
207 title: Option<&NSString>,
208 style: UIBarButtonItemStyle,
209 target: Option<&AnyObject>,
210 action: Option<Sel>,
211 ) -> Retained<Self>;
212
213 #[unsafe(method(initWithBarButtonSystemItem:target:action:))]
218 #[unsafe(method_family = init)]
219 pub unsafe fn initWithBarButtonSystemItem_target_action(
220 this: Allocated<Self>,
221 system_item: UIBarButtonSystemItem,
222 target: Option<&AnyObject>,
223 action: Option<Sel>,
224 ) -> Retained<Self>;
225
226 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
227 #[unsafe(method(initWithCustomView:))]
228 #[unsafe(method_family = init)]
229 pub fn initWithCustomView(this: Allocated<Self>, custom_view: &UIView) -> Retained<Self>;
230
231 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
232 #[unsafe(method(initWithBarButtonSystemItem:primaryAction:))]
236 #[unsafe(method_family = init)]
237 pub fn initWithBarButtonSystemItem_primaryAction(
238 this: Allocated<Self>,
239 system_item: UIBarButtonSystemItem,
240 primary_action: Option<&UIAction>,
241 ) -> Retained<Self>;
242
243 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
244 #[unsafe(method(initWithPrimaryAction:))]
246 #[unsafe(method_family = init)]
247 pub fn initWithPrimaryAction(
248 this: Allocated<Self>,
249 primary_action: Option<&UIAction>,
250 ) -> Retained<Self>;
251
252 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
253 #[unsafe(method(initWithBarButtonSystemItem:menu:))]
255 #[unsafe(method_family = init)]
256 pub fn initWithBarButtonSystemItem_menu(
257 this: Allocated<Self>,
258 system_item: UIBarButtonSystemItem,
259 menu: Option<&UIMenu>,
260 ) -> Retained<Self>;
261
262 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
263 #[unsafe(method(initWithTitle:menu:))]
265 #[unsafe(method_family = init)]
266 pub fn initWithTitle_menu(
267 this: Allocated<Self>,
268 title: Option<&NSString>,
269 menu: Option<&UIMenu>,
270 ) -> Retained<Self>;
271
272 #[cfg(all(feature = "UIImage", feature = "UIMenu", feature = "UIMenuElement"))]
273 #[unsafe(method(initWithImage:menu:))]
275 #[unsafe(method_family = init)]
276 pub fn initWithImage_menu(
277 this: Allocated<Self>,
278 image: Option<&UIImage>,
279 menu: Option<&UIMenu>,
280 ) -> Retained<Self>;
281
282 #[cfg(all(feature = "UIAction", feature = "UIMenu", feature = "UIMenuElement"))]
283 #[unsafe(method(initWithPrimaryAction:menu:))]
285 #[unsafe(method_family = init)]
286 pub fn initWithPrimaryAction_menu(
287 this: Allocated<Self>,
288 primary_action: Option<&UIAction>,
289 menu: Option<&UIMenu>,
290 ) -> Retained<Self>;
291
292 #[cfg(all(feature = "UIAction", feature = "UIMenu", feature = "UIMenuElement"))]
293 #[unsafe(method(initWithBarButtonSystemItem:primaryAction:menu:))]
297 #[unsafe(method_family = init)]
298 pub fn initWithBarButtonSystemItem_primaryAction_menu(
299 this: Allocated<Self>,
300 system_item: UIBarButtonSystemItem,
301 primary_action: Option<&UIAction>,
302 menu: Option<&UIMenu>,
303 ) -> Retained<Self>;
304
305 #[cfg(all(feature = "UIImage", feature = "UIMenu", feature = "UIMenuElement"))]
306 #[unsafe(method(initWithTitle:image:target:action:menu:))]
313 #[unsafe(method_family = init)]
314 pub unsafe fn initWithTitle_image_target_action_menu(
315 this: Allocated<Self>,
316 title: Option<&NSString>,
317 image: Option<&UIImage>,
318 target: Option<&AnyObject>,
319 action: Option<Sel>,
320 menu: Option<&UIMenu>,
321 ) -> Retained<Self>;
322
323 #[cfg(feature = "objc2-core-foundation")]
324 #[unsafe(method(fixedSpaceItemOfWidth:))]
326 #[unsafe(method_family = none)]
327 pub fn fixedSpaceItemOfWidth(width: CGFloat, mtm: MainThreadMarker) -> Retained<Self>;
328
329 #[unsafe(method(flexibleSpaceItem))]
331 #[unsafe(method_family = none)]
332 pub fn flexibleSpaceItem(mtm: MainThreadMarker) -> Retained<Self>;
333
334 #[unsafe(method(fixedSpaceItem))]
339 #[unsafe(method_family = none)]
340 pub fn fixedSpaceItem(mtm: MainThreadMarker) -> Retained<Self>;
341
342 #[unsafe(method(style))]
343 #[unsafe(method_family = none)]
344 pub fn style(&self) -> UIBarButtonItemStyle;
345
346 #[unsafe(method(setStyle:))]
348 #[unsafe(method_family = none)]
349 pub fn setStyle(&self, style: UIBarButtonItemStyle);
350
351 #[cfg(feature = "objc2-core-foundation")]
352 #[unsafe(method(width))]
353 #[unsafe(method_family = none)]
354 pub fn width(&self) -> CGFloat;
355
356 #[cfg(feature = "objc2-core-foundation")]
357 #[unsafe(method(setWidth:))]
359 #[unsafe(method_family = none)]
360 pub fn setWidth(&self, width: CGFloat);
361
362 #[unsafe(method(possibleTitles))]
363 #[unsafe(method_family = none)]
364 pub fn possibleTitles(&self) -> Option<Retained<NSSet<NSString>>>;
365
366 #[unsafe(method(setPossibleTitles:))]
370 #[unsafe(method_family = none)]
371 pub fn setPossibleTitles(&self, possible_titles: Option<&NSSet<NSString>>);
372
373 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
374 #[unsafe(method(customView))]
375 #[unsafe(method_family = none)]
376 pub fn customView(&self) -> Option<Retained<UIView>>;
377
378 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
379 #[unsafe(method(setCustomView:))]
381 #[unsafe(method_family = none)]
382 pub fn setCustomView(&self, custom_view: Option<&UIView>);
383
384 #[unsafe(method(action))]
388 #[unsafe(method_family = none)]
389 pub unsafe fn action(&self) -> Option<Sel>;
390
391 #[unsafe(method(setAction:))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn setAction(&self, action: Option<Sel>);
400
401 #[unsafe(method(target))]
402 #[unsafe(method_family = none)]
403 pub fn target(&self) -> Option<Retained<AnyObject>>;
404
405 #[unsafe(method(setTarget:))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
415
416 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
417 #[unsafe(method(primaryAction))]
425 #[unsafe(method_family = none)]
426 pub fn primaryAction(&self) -> Option<Retained<UIAction>>;
427
428 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
429 #[unsafe(method(setPrimaryAction:))]
433 #[unsafe(method_family = none)]
434 pub fn setPrimaryAction(&self, primary_action: Option<&UIAction>);
435
436 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
437 #[unsafe(method(menu))]
439 #[unsafe(method_family = none)]
440 pub fn menu(&self) -> Option<Retained<UIMenu>>;
441
442 #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
443 #[unsafe(method(setMenu:))]
447 #[unsafe(method_family = none)]
448 pub fn setMenu(&self, menu: Option<&UIMenu>);
449
450 #[cfg(feature = "UIContextMenuConfiguration")]
451 #[unsafe(method(preferredMenuElementOrder))]
453 #[unsafe(method_family = none)]
454 pub fn preferredMenuElementOrder(&self) -> UIContextMenuConfigurationElementOrder;
455
456 #[cfg(feature = "UIContextMenuConfiguration")]
457 #[unsafe(method(setPreferredMenuElementOrder:))]
459 #[unsafe(method_family = none)]
460 pub fn setPreferredMenuElementOrder(
461 &self,
462 preferred_menu_element_order: UIContextMenuConfigurationElementOrder,
463 );
464
465 #[unsafe(method(changesSelectionAsPrimaryAction))]
469 #[unsafe(method_family = none)]
470 pub fn changesSelectionAsPrimaryAction(&self) -> bool;
471
472 #[unsafe(method(setChangesSelectionAsPrimaryAction:))]
474 #[unsafe(method_family = none)]
475 pub fn setChangesSelectionAsPrimaryAction(&self, changes_selection_as_primary_action: bool);
476
477 #[unsafe(method(isSelected))]
478 #[unsafe(method_family = none)]
479 pub fn isSelected(&self) -> bool;
480
481 #[unsafe(method(setSelected:))]
483 #[unsafe(method_family = none)]
484 pub fn setSelected(&self, selected: bool);
485
486 #[unsafe(method(isHidden))]
488 #[unsafe(method_family = none)]
489 pub fn isHidden(&self) -> bool;
490
491 #[unsafe(method(setHidden:))]
493 #[unsafe(method_family = none)]
494 pub fn setHidden(&self, hidden: bool);
495
496 #[unsafe(method(isSymbolAnimationEnabled))]
498 #[unsafe(method_family = none)]
499 pub fn isSymbolAnimationEnabled(&self) -> bool;
500
501 #[unsafe(method(setSymbolAnimationEnabled:))]
503 #[unsafe(method_family = none)]
504 pub fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool);
505
506 #[cfg(feature = "UIMenuElement")]
507 #[unsafe(method(menuRepresentation))]
509 #[unsafe(method_family = none)]
510 pub fn menuRepresentation(&self) -> Option<Retained<UIMenuElement>>;
511
512 #[cfg(feature = "UIMenuElement")]
513 #[unsafe(method(setMenuRepresentation:))]
517 #[unsafe(method_family = none)]
518 pub fn setMenuRepresentation(&self, menu_representation: Option<&UIMenuElement>);
519
520 #[unsafe(method(hidesSharedBackground))]
531 #[unsafe(method_family = none)]
532 pub fn hidesSharedBackground(&self) -> bool;
533
534 #[unsafe(method(setHidesSharedBackground:))]
536 #[unsafe(method_family = none)]
537 pub fn setHidesSharedBackground(&self, hides_shared_background: bool);
538
539 #[unsafe(method(sharesBackground))]
547 #[unsafe(method_family = none)]
548 pub fn sharesBackground(&self) -> bool;
549
550 #[unsafe(method(setSharesBackground:))]
552 #[unsafe(method_family = none)]
553 pub fn setSharesBackground(&self, shares_background: bool);
554
555 #[unsafe(method(identifier))]
568 #[unsafe(method_family = none)]
569 pub fn identifier(&self) -> Option<Retained<NSString>>;
570
571 #[unsafe(method(setIdentifier:))]
575 #[unsafe(method_family = none)]
576 pub fn setIdentifier(&self, identifier: Option<&NSString>);
577
578 #[cfg(feature = "UIBarButtonItemGroup")]
579 #[unsafe(method(creatingFixedGroup))]
581 #[unsafe(method_family = none)]
582 pub fn creatingFixedGroup(&self) -> Retained<UIBarButtonItemGroup>;
583
584 #[cfg(feature = "UIBarButtonItemGroup")]
585 #[unsafe(method(creatingMovableGroupWithCustomizationIdentifier:))]
587 #[unsafe(method_family = none)]
588 pub fn creatingMovableGroupWithCustomizationIdentifier(
589 &self,
590 customization_identifier: &NSString,
591 ) -> Retained<UIBarButtonItemGroup>;
592
593 #[cfg(feature = "UIBarButtonItemGroup")]
594 #[unsafe(method(creatingOptionalGroupWithCustomizationIdentifier:inDefaultCustomization:))]
596 #[unsafe(method_family = none)]
597 pub fn creatingOptionalGroupWithCustomizationIdentifier_inDefaultCustomization(
598 &self,
599 customization_identifier: &NSString,
600 in_default_customization: bool,
601 ) -> Retained<UIBarButtonItemGroup>;
602
603 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
604 #[unsafe(method(setBackgroundImage:forState:barMetrics:))]
605 #[unsafe(method_family = none)]
606 pub fn setBackgroundImage_forState_barMetrics(
607 &self,
608 background_image: Option<&UIImage>,
609 state: UIControlState,
610 bar_metrics: UIBarMetrics,
611 );
612
613 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
614 #[unsafe(method(backgroundImageForState:barMetrics:))]
615 #[unsafe(method_family = none)]
616 pub fn backgroundImageForState_barMetrics(
617 &self,
618 state: UIControlState,
619 bar_metrics: UIBarMetrics,
620 ) -> Option<Retained<UIImage>>;
621
622 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
623 #[unsafe(method(setBackgroundImage:forState:style:barMetrics:))]
624 #[unsafe(method_family = none)]
625 pub fn setBackgroundImage_forState_style_barMetrics(
626 &self,
627 background_image: Option<&UIImage>,
628 state: UIControlState,
629 style: UIBarButtonItemStyle,
630 bar_metrics: UIBarMetrics,
631 );
632
633 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
634 #[unsafe(method(backgroundImageForState:style:barMetrics:))]
635 #[unsafe(method_family = none)]
636 pub fn backgroundImageForState_style_barMetrics(
637 &self,
638 state: UIControlState,
639 style: UIBarButtonItemStyle,
640 bar_metrics: UIBarMetrics,
641 ) -> Option<Retained<UIImage>>;
642
643 #[cfg(feature = "UIColor")]
644 #[unsafe(method(tintColor))]
645 #[unsafe(method_family = none)]
646 pub fn tintColor(&self) -> Option<Retained<UIColor>>;
647
648 #[cfg(feature = "UIColor")]
649 #[unsafe(method(setTintColor:))]
651 #[unsafe(method_family = none)]
652 pub fn setTintColor(&self, tint_color: Option<&UIColor>);
653
654 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
655 #[unsafe(method(setBackgroundVerticalPositionAdjustment:forBarMetrics:))]
656 #[unsafe(method_family = none)]
657 pub fn setBackgroundVerticalPositionAdjustment_forBarMetrics(
658 &self,
659 adjustment: CGFloat,
660 bar_metrics: UIBarMetrics,
661 );
662
663 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
664 #[unsafe(method(backgroundVerticalPositionAdjustmentForBarMetrics:))]
665 #[unsafe(method_family = none)]
666 pub fn backgroundVerticalPositionAdjustmentForBarMetrics(
667 &self,
668 bar_metrics: UIBarMetrics,
669 ) -> CGFloat;
670
671 #[cfg(all(
672 feature = "UIBarCommon",
673 feature = "UIGeometry",
674 feature = "objc2-core-foundation"
675 ))]
676 #[unsafe(method(setTitlePositionAdjustment:forBarMetrics:))]
677 #[unsafe(method_family = none)]
678 pub fn setTitlePositionAdjustment_forBarMetrics(
679 &self,
680 adjustment: UIOffset,
681 bar_metrics: UIBarMetrics,
682 );
683
684 #[cfg(all(
685 feature = "UIBarCommon",
686 feature = "UIGeometry",
687 feature = "objc2-core-foundation"
688 ))]
689 #[unsafe(method(titlePositionAdjustmentForBarMetrics:))]
690 #[unsafe(method_family = none)]
691 pub fn titlePositionAdjustmentForBarMetrics(&self, bar_metrics: UIBarMetrics) -> UIOffset;
692
693 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
694 #[unsafe(method(setBackButtonBackgroundImage:forState:barMetrics:))]
695 #[unsafe(method_family = none)]
696 pub fn setBackButtonBackgroundImage_forState_barMetrics(
697 &self,
698 background_image: Option<&UIImage>,
699 state: UIControlState,
700 bar_metrics: UIBarMetrics,
701 );
702
703 #[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
704 #[unsafe(method(backButtonBackgroundImageForState:barMetrics:))]
705 #[unsafe(method_family = none)]
706 pub fn backButtonBackgroundImageForState_barMetrics(
707 &self,
708 state: UIControlState,
709 bar_metrics: UIBarMetrics,
710 ) -> Option<Retained<UIImage>>;
711
712 #[cfg(all(
713 feature = "UIBarCommon",
714 feature = "UIGeometry",
715 feature = "objc2-core-foundation"
716 ))]
717 #[unsafe(method(setBackButtonTitlePositionAdjustment:forBarMetrics:))]
718 #[unsafe(method_family = none)]
719 pub fn setBackButtonTitlePositionAdjustment_forBarMetrics(
720 &self,
721 adjustment: UIOffset,
722 bar_metrics: UIBarMetrics,
723 );
724
725 #[cfg(all(
726 feature = "UIBarCommon",
727 feature = "UIGeometry",
728 feature = "objc2-core-foundation"
729 ))]
730 #[unsafe(method(backButtonTitlePositionAdjustmentForBarMetrics:))]
731 #[unsafe(method_family = none)]
732 pub fn backButtonTitlePositionAdjustmentForBarMetrics(
733 &self,
734 bar_metrics: UIBarMetrics,
735 ) -> UIOffset;
736
737 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
738 #[unsafe(method(setBackButtonBackgroundVerticalPositionAdjustment:forBarMetrics:))]
739 #[unsafe(method_family = none)]
740 pub fn setBackButtonBackgroundVerticalPositionAdjustment_forBarMetrics(
741 &self,
742 adjustment: CGFloat,
743 bar_metrics: UIBarMetrics,
744 );
745
746 #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
747 #[unsafe(method(backButtonBackgroundVerticalPositionAdjustmentForBarMetrics:))]
748 #[unsafe(method_family = none)]
749 pub fn backButtonBackgroundVerticalPositionAdjustmentForBarMetrics(
750 &self,
751 bar_metrics: UIBarMetrics,
752 ) -> CGFloat;
753 );
754}
755
756#[cfg(feature = "UIBarItem")]
758impl UIBarButtonItem {
759 extern_methods!(
760 #[unsafe(method(new))]
761 #[unsafe(method_family = new)]
762 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
763 );
764}
765
766#[cfg(feature = "UIBarItem")]
768impl UIBarButtonItem {
769 extern_methods!();
770}
771
772#[cfg(all(feature = "UIBarItem", feature = "UISpringLoadedInteractionSupporting"))]
773extern_conformance!(
774 unsafe impl UISpringLoadedInteractionSupporting for UIBarButtonItem {}
775);
776
777#[cfg(feature = "UIBarItem")]
778impl UIBarButtonItem {
779 extern_methods!(
780 #[cfg(feature = "objc2-symbols")]
781 #[unsafe(method(addSymbolEffect:))]
784 #[unsafe(method_family = none)]
785 pub fn addSymbolEffect(&self, symbol_effect: &NSSymbolEffect);
786
787 #[cfg(feature = "objc2-symbols")]
788 #[unsafe(method(addSymbolEffect:options:))]
791 #[unsafe(method_family = none)]
792 pub fn addSymbolEffect_options(
793 &self,
794 symbol_effect: &NSSymbolEffect,
795 options: &NSSymbolEffectOptions,
796 );
797
798 #[cfg(feature = "objc2-symbols")]
799 #[unsafe(method(addSymbolEffect:options:animated:))]
802 #[unsafe(method_family = none)]
803 pub fn addSymbolEffect_options_animated(
804 &self,
805 symbol_effect: &NSSymbolEffect,
806 options: &NSSymbolEffectOptions,
807 animated: bool,
808 );
809
810 #[cfg(feature = "objc2-symbols")]
811 #[unsafe(method(removeSymbolEffectOfType:))]
813 #[unsafe(method_family = none)]
814 pub fn removeSymbolEffectOfType(&self, symbol_effect: &NSSymbolEffect);
815
816 #[cfg(feature = "objc2-symbols")]
817 #[unsafe(method(removeSymbolEffectOfType:options:))]
819 #[unsafe(method_family = none)]
820 pub fn removeSymbolEffectOfType_options(
821 &self,
822 symbol_effect: &NSSymbolEffect,
823 options: &NSSymbolEffectOptions,
824 );
825
826 #[cfg(feature = "objc2-symbols")]
827 #[unsafe(method(removeSymbolEffectOfType:options:animated:))]
829 #[unsafe(method_family = none)]
830 pub fn removeSymbolEffectOfType_options_animated(
831 &self,
832 symbol_effect: &NSSymbolEffect,
833 options: &NSSymbolEffectOptions,
834 animated: bool,
835 );
836
837 #[unsafe(method(removeAllSymbolEffects))]
839 #[unsafe(method_family = none)]
840 pub fn removeAllSymbolEffects(&self);
841
842 #[cfg(feature = "objc2-symbols")]
843 #[unsafe(method(removeAllSymbolEffectsWithOptions:))]
845 #[unsafe(method_family = none)]
846 pub fn removeAllSymbolEffectsWithOptions(&self, options: &NSSymbolEffectOptions);
847
848 #[cfg(feature = "objc2-symbols")]
849 #[unsafe(method(removeAllSymbolEffectsWithOptions:animated:))]
851 #[unsafe(method_family = none)]
852 pub fn removeAllSymbolEffectsWithOptions_animated(
853 &self,
854 options: &NSSymbolEffectOptions,
855 animated: bool,
856 );
857
858 #[cfg(all(feature = "UIImage", feature = "objc2-symbols"))]
859 #[unsafe(method(setSymbolImage:withContentTransition:))]
862 #[unsafe(method_family = none)]
863 pub fn setSymbolImage_withContentTransition(
864 &self,
865 symbol_image: &UIImage,
866 transition: &NSSymbolContentTransition,
867 );
868
869 #[cfg(all(feature = "UIImage", feature = "objc2-symbols"))]
870 #[unsafe(method(setSymbolImage:withContentTransition:options:))]
873 #[unsafe(method_family = none)]
874 pub fn setSymbolImage_withContentTransition_options(
875 &self,
876 symbol_image: &UIImage,
877 transition: &NSSymbolContentTransition,
878 options: &NSSymbolEffectOptions,
879 );
880 );
881}