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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITabBarSystemItem(pub NSInteger);
impl UITabBarSystemItem {
    #[doc(alias = "UITabBarSystemItemMore")]
    pub const More: Self = Self(0);
    #[doc(alias = "UITabBarSystemItemFavorites")]
    pub const Favorites: Self = Self(1);
    #[doc(alias = "UITabBarSystemItemFeatured")]
    pub const Featured: Self = Self(2);
    #[doc(alias = "UITabBarSystemItemTopRated")]
    pub const TopRated: Self = Self(3);
    #[doc(alias = "UITabBarSystemItemRecents")]
    pub const Recents: Self = Self(4);
    #[doc(alias = "UITabBarSystemItemContacts")]
    pub const Contacts: Self = Self(5);
    #[doc(alias = "UITabBarSystemItemHistory")]
    pub const History: Self = Self(6);
    #[doc(alias = "UITabBarSystemItemBookmarks")]
    pub const Bookmarks: Self = Self(7);
    #[doc(alias = "UITabBarSystemItemSearch")]
    pub const Search: Self = Self(8);
    #[doc(alias = "UITabBarSystemItemDownloads")]
    pub const Downloads: Self = Self(9);
    #[doc(alias = "UITabBarSystemItemMostRecent")]
    pub const MostRecent: Self = Self(10);
    #[doc(alias = "UITabBarSystemItemMostViewed")]
    pub const MostViewed: Self = Self(11);
}

unsafe impl Encode for UITabBarSystemItem {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UITabBarSystemItem {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "UIBarItem")]
    pub struct UITabBarItem;

    #[cfg(feature = "UIBarItem")]
    unsafe impl ClassType for UITabBarItem {
        #[inherits(NSObject)]
        type Super = UIBarItem;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(feature = "UIBarItem")]
unsafe impl NSCoding for UITabBarItem {}

#[cfg(feature = "UIBarItem")]
unsafe impl NSObjectProtocol for UITabBarItem {}

#[cfg(all(feature = "UIAppearance", feature = "UIBarItem"))]
unsafe impl UIAppearance for UITabBarItem {}

extern_methods!(
    #[cfg(feature = "UIBarItem")]
    unsafe impl UITabBarItem {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Init initWithTitle:image:tag:)]
        pub unsafe fn initWithTitle_image_tag(
            this: Allocated<Self>,
            title: Option<&NSString>,
            image: Option<&UIImage>,
            tag: NSInteger,
        ) -> Retained<Self>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Init initWithTitle:image:selectedImage:)]
        pub unsafe fn initWithTitle_image_selectedImage(
            this: Allocated<Self>,
            title: Option<&NSString>,
            image: Option<&UIImage>,
            selected_image: Option<&UIImage>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithTabBarSystemItem:tag:)]
        pub unsafe fn initWithTabBarSystemItem_tag(
            this: Allocated<Self>,
            system_item: UITabBarSystemItem,
            tag: NSInteger,
        ) -> Retained<Self>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other selectedImage)]
        pub unsafe fn selectedImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[method(setSelectedImage:)]
        pub unsafe fn setSelectedImage(&self, selected_image: Option<&UIImage>);

        #[method_id(@__retain_semantics Other badgeValue)]
        pub unsafe fn badgeValue(&self) -> Option<Retained<NSString>>;

        #[method(setBadgeValue:)]
        pub unsafe fn setBadgeValue(&self, badge_value: Option<&NSString>);

        #[cfg(feature = "UIImage")]
        #[deprecated = "Use initWithTitle:image:selectedImage: or the image and selectedImage properties along with UIImageRenderingModeAlwaysOriginal"]
        #[method(setFinishedSelectedImage:withFinishedUnselectedImage:)]
        pub unsafe fn setFinishedSelectedImage_withFinishedUnselectedImage(
            &self,
            selected_image: Option<&UIImage>,
            unselected_image: Option<&UIImage>,
        );

        #[cfg(feature = "UIImage")]
        #[deprecated]
        #[method_id(@__retain_semantics Other finishedSelectedImage)]
        pub unsafe fn finishedSelectedImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[deprecated]
        #[method_id(@__retain_semantics Other finishedUnselectedImage)]
        pub unsafe fn finishedUnselectedImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIGeometry")]
        #[method(titlePositionAdjustment)]
        pub unsafe fn titlePositionAdjustment(&self) -> UIOffset;

        #[cfg(feature = "UIGeometry")]
        #[method(setTitlePositionAdjustment:)]
        pub unsafe fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other badgeColor)]
        pub unsafe fn badgeColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        #[method(setBadgeColor:)]
        pub unsafe fn setBadgeColor(&self, badge_color: Option<&UIColor>);

        #[cfg(feature = "UIControl")]
        #[method(setBadgeTextAttributes:forState:)]
        pub unsafe fn setBadgeTextAttributes_forState(
            &self,
            text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
            state: UIControlState,
        );

        #[cfg(feature = "UIControl")]
        #[method_id(@__retain_semantics Other badgeTextAttributesForState:)]
        pub unsafe fn badgeTextAttributesForState(
            &self,
            state: UIControlState,
        ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
        #[method_id(@__retain_semantics Other standardAppearance)]
        pub unsafe fn standardAppearance(&self) -> Option<Retained<UITabBarAppearance>>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
        #[method(setStandardAppearance:)]
        pub unsafe fn setStandardAppearance(
            &self,
            standard_appearance: Option<&UITabBarAppearance>,
        );

        #[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
        #[method_id(@__retain_semantics Other scrollEdgeAppearance)]
        pub unsafe fn scrollEdgeAppearance(&self) -> Option<Retained<UITabBarAppearance>>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UITabBarAppearance"))]
        #[method(setScrollEdgeAppearance:)]
        pub unsafe fn setScrollEdgeAppearance(
            &self,
            scroll_edge_appearance: Option<&UITabBarAppearance>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "UIBarItem")]
    unsafe impl UITabBarItem {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);

extern_methods!(
    /// SpringLoading
    #[cfg(feature = "UIBarItem")]
    unsafe impl UITabBarItem {}
);

#[cfg(all(feature = "UIBarItem", feature = "UISpringLoadedInteractionSupporting"))]
unsafe impl UISpringLoadedInteractionSupporting for UITabBarItem {}