objc2_ui_kit/generated/
UITab.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UITabPlacement(pub NSInteger);
15impl UITabPlacement {
16 #[doc(alias = "UITabPlacementAutomatic")]
18 pub const Automatic: Self = Self(0);
19 #[doc(alias = "UITabPlacementDefault")]
21 pub const Default: Self = Self(1);
22 #[doc(alias = "UITabPlacementOptional")]
24 pub const Optional: Self = Self(2);
25 #[doc(alias = "UITabPlacementMovable")]
27 pub const Movable: Self = Self(3);
28 #[doc(alias = "UITabPlacementPinned")]
31 pub const Pinned: Self = Self(4);
32 #[doc(alias = "UITabPlacementFixed")]
35 pub const Fixed: Self = Self(5);
36 #[doc(alias = "UITabPlacementSidebarOnly")]
38 pub const SidebarOnly: Self = Self(6);
39}
40
41unsafe impl Encode for UITabPlacement {
42 const ENCODING: Encoding = NSInteger::ENCODING;
43}
44
45unsafe impl RefEncode for UITabPlacement {
46 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
47}
48
49extern_class!(
50 #[unsafe(super(NSObject))]
52 #[thread_kind = MainThreadOnly]
53 #[derive(Debug, PartialEq, Eq, Hash)]
54 pub struct UITab;
55);
56
57unsafe impl NSObjectProtocol for UITab {}
58
59impl UITab {
60 extern_methods!(
61 #[unsafe(method(identifier))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn identifier(&self) -> Retained<NSString>;
65
66 #[unsafe(method(title))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn title(&self) -> Retained<NSString>;
70
71 #[unsafe(method(setTitle:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setTitle(&self, title: &NSString);
75
76 #[cfg(feature = "UIImage")]
77 #[unsafe(method(image))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
81
82 #[cfg(feature = "UIImage")]
83 #[unsafe(method(setImage:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn setImage(&self, image: Option<&UIImage>);
87
88 #[unsafe(method(subtitle))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
92
93 #[unsafe(method(setSubtitle:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
97
98 #[unsafe(method(badgeValue))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn badgeValue(&self) -> Option<Retained<NSString>>;
102
103 #[unsafe(method(setBadgeValue:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setBadgeValue(&self, badge_value: Option<&NSString>);
107
108 #[unsafe(method(preferredPlacement))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn preferredPlacement(&self) -> UITabPlacement;
113
114 #[unsafe(method(setPreferredPlacement:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn setPreferredPlacement(&self, preferred_placement: UITabPlacement);
118
119 #[unsafe(method(userInfo))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
123
124 #[unsafe(method(setUserInfo:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
128
129 #[cfg(feature = "UITabGroup")]
130 #[unsafe(method(parent))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn parent(&self) -> Option<Retained<UITabGroup>>;
134
135 #[cfg(all(
136 feature = "UIResponder",
137 feature = "UITabBarController",
138 feature = "UIViewController"
139 ))]
140 #[unsafe(method(tabBarController))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn tabBarController(&self) -> Option<Retained<UITabBarController>>;
146
147 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
148 #[unsafe(method(viewController))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn viewController(&self) -> Option<Retained<UIViewController>>;
153
154 #[cfg(feature = "UITabGroup")]
155 #[unsafe(method(managingTabGroup))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn managingTabGroup(&self) -> Option<Retained<UITabGroup>>;
162
163 #[unsafe(method(isHidden))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn isHidden(&self) -> bool;
168
169 #[unsafe(method(setHidden:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn setHidden(&self, hidden: bool);
173
174 #[unsafe(method(isHiddenByDefault))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn isHiddenByDefault(&self) -> bool;
179
180 #[unsafe(method(setHiddenByDefault:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setHiddenByDefault(&self, hidden_by_default: bool);
184
185 #[unsafe(method(allowsHiding))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn allowsHiding(&self) -> bool;
189
190 #[unsafe(method(setAllowsHiding:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn setAllowsHiding(&self, allows_hiding: bool);
194
195 #[cfg(all(
196 feature = "UIImage",
197 feature = "UIResponder",
198 feature = "UIViewController",
199 feature = "block2"
200 ))]
201 #[unsafe(method(initWithTitle:image:identifier:viewControllerProvider:))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn initWithTitle_image_identifier_viewControllerProvider(
207 this: Allocated<Self>,
208 title: &NSString,
209 image: Option<&UIImage>,
210 identifier: &NSString,
211 view_controller_provider: Option<
212 &block2::Block<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
213 >,
214 ) -> Retained<Self>;
215
216 #[unsafe(method(init))]
217 #[unsafe(method_family = init)]
218 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
219
220 #[unsafe(method(new))]
221 #[unsafe(method_family = new)]
222 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
223 );
224}
225
226impl UITab {
228 extern_methods!();
229}
230
231#[cfg(feature = "UIPopoverPresentationControllerSourceItem")]
232unsafe impl UIPopoverPresentationControllerSourceItem for UITab {}
233
234impl UITab {
236 extern_methods!();
237}
238
239#[cfg(feature = "UISpringLoadedInteractionSupporting")]
240unsafe impl UISpringLoadedInteractionSupporting for UITab {}
241
242impl UITab {
244 extern_methods!();
245}
246
247#[cfg(feature = "UIAccessibilityIdentification")]
248unsafe impl UIAccessibilityIdentification for UITab {}
249
250#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
252impl UIViewController {
253 extern_methods!(
254 #[unsafe(method(tab))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn tab(&self) -> Option<Retained<UITab>>;
258 );
259}