objc2_ui_kit/generated/
UIBarButtonItemBadge.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct UIBarButtonItemBadge;
18);
19
20extern_conformance!(
21 unsafe impl NSCoding for UIBarButtonItemBadge {}
22);
23
24extern_conformance!(
25 unsafe impl NSCopying for UIBarButtonItemBadge {}
26);
27
28unsafe impl CopyingHelper for UIBarButtonItemBadge {
29 type Result = Self;
30}
31
32extern_conformance!(
33 unsafe impl NSObjectProtocol for UIBarButtonItemBadge {}
34);
35
36extern_conformance!(
37 unsafe impl NSSecureCoding for UIBarButtonItemBadge {}
38);
39
40impl UIBarButtonItemBadge {
41 extern_methods!(
42 #[unsafe(method(badgeWithCount:))]
47 #[unsafe(method_family = none)]
48 pub fn badgeWithCount(count: NSUInteger, mtm: MainThreadMarker) -> Retained<Self>;
49
50 #[unsafe(method(badgeWithString:))]
52 #[unsafe(method_family = none)]
53 pub fn badgeWithString(string_value: &NSString, mtm: MainThreadMarker) -> Retained<Self>;
54
55 #[unsafe(method(indicatorBadge))]
58 #[unsafe(method_family = none)]
59 pub fn indicatorBadge(mtm: MainThreadMarker) -> Retained<Self>;
60
61 #[unsafe(method(init))]
62 #[unsafe(method_family = init)]
63 pub fn init(this: Allocated<Self>) -> Retained<Self>;
64
65 #[unsafe(method(stringValue))]
66 #[unsafe(method_family = none)]
67 pub fn stringValue(&self) -> Option<Retained<NSString>>;
68
69 #[cfg(feature = "UIColor")]
70 #[unsafe(method(backgroundColor))]
72 #[unsafe(method_family = none)]
73 pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
74
75 #[cfg(feature = "UIColor")]
76 #[unsafe(method(setBackgroundColor:))]
78 #[unsafe(method_family = none)]
79 pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
80
81 #[cfg(feature = "UIColor")]
82 #[unsafe(method(foregroundColor))]
84 #[unsafe(method_family = none)]
85 pub fn foregroundColor(&self) -> Option<Retained<UIColor>>;
86
87 #[cfg(feature = "UIColor")]
88 #[unsafe(method(setForegroundColor:))]
90 #[unsafe(method_family = none)]
91 pub fn setForegroundColor(&self, foreground_color: Option<&UIColor>);
92
93 #[cfg(feature = "UIFont")]
94 #[unsafe(method(font))]
96 #[unsafe(method_family = none)]
97 pub fn font(&self) -> Option<Retained<UIFont>>;
98
99 #[cfg(feature = "UIFont")]
100 #[unsafe(method(setFont:))]
102 #[unsafe(method_family = none)]
103 pub fn setFont(&self, font: Option<&UIFont>);
104 );
105}
106
107impl UIBarButtonItemBadge {
109 extern_methods!(
110 #[unsafe(method(new))]
111 #[unsafe(method_family = new)]
112 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
113 );
114}
115
116#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
118impl UIBarButtonItem {
119 extern_methods!(
120 #[unsafe(method(badge))]
122 #[unsafe(method_family = none)]
123 pub fn badge(&self) -> Option<Retained<UIBarButtonItemBadge>>;
124
125 #[unsafe(method(setBadge:))]
127 #[unsafe(method_family = none)]
128 pub fn setBadge(&self, badge: Option<&UIBarButtonItemBadge>);
129 );
130}