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
57extern_conformance!(
58 unsafe impl NSObjectProtocol for UITab {}
59);
60
61impl UITab {
62 extern_methods!(
63 #[unsafe(method(identifier))]
65 #[unsafe(method_family = none)]
66 pub fn identifier(&self) -> Retained<NSString>;
67
68 #[unsafe(method(isEnabled))]
71 #[unsafe(method_family = none)]
72 pub fn isEnabled(&self) -> bool;
73
74 #[unsafe(method(setEnabled:))]
76 #[unsafe(method_family = none)]
77 pub fn setEnabled(&self, enabled: bool);
78
79 #[unsafe(method(title))]
81 #[unsafe(method_family = none)]
82 pub fn title(&self) -> Retained<NSString>;
83
84 #[unsafe(method(setTitle:))]
88 #[unsafe(method_family = none)]
89 pub fn setTitle(&self, title: &NSString);
90
91 #[cfg(feature = "UIImage")]
92 #[unsafe(method(image))]
94 #[unsafe(method_family = none)]
95 pub fn image(&self) -> Option<Retained<UIImage>>;
96
97 #[cfg(feature = "UIImage")]
98 #[unsafe(method(setImage:))]
100 #[unsafe(method_family = none)]
101 pub fn setImage(&self, image: Option<&UIImage>);
102
103 #[unsafe(method(subtitle))]
105 #[unsafe(method_family = none)]
106 pub fn subtitle(&self) -> Option<Retained<NSString>>;
107
108 #[unsafe(method(setSubtitle:))]
112 #[unsafe(method_family = none)]
113 pub fn setSubtitle(&self, subtitle: Option<&NSString>);
114
115 #[unsafe(method(badgeValue))]
117 #[unsafe(method_family = none)]
118 pub fn badgeValue(&self) -> Option<Retained<NSString>>;
119
120 #[unsafe(method(setBadgeValue:))]
124 #[unsafe(method_family = none)]
125 pub fn setBadgeValue(&self, badge_value: Option<&NSString>);
126
127 #[unsafe(method(preferredPlacement))]
130 #[unsafe(method_family = none)]
131 pub fn preferredPlacement(&self) -> UITabPlacement;
132
133 #[unsafe(method(setPreferredPlacement:))]
135 #[unsafe(method_family = none)]
136 pub fn setPreferredPlacement(&self, preferred_placement: UITabPlacement);
137
138 #[unsafe(method(userInfo))]
140 #[unsafe(method_family = none)]
141 pub fn userInfo(&self) -> Option<Retained<AnyObject>>;
142
143 #[unsafe(method(setUserInfo:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
151
152 #[cfg(feature = "UITabGroup")]
153 #[unsafe(method(parent))]
155 #[unsafe(method_family = none)]
156 pub fn parent(&self) -> Option<Retained<UITabGroup>>;
157
158 #[cfg(all(
159 feature = "UIResponder",
160 feature = "UITabBarController",
161 feature = "UIViewController"
162 ))]
163 #[unsafe(method(tabBarController))]
167 #[unsafe(method_family = none)]
168 pub fn tabBarController(&self) -> Option<Retained<UITabBarController>>;
169
170 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
171 #[unsafe(method(viewController))]
174 #[unsafe(method_family = none)]
175 pub fn viewController(&self) -> Option<Retained<UIViewController>>;
176
177 #[cfg(feature = "UITabGroup")]
178 #[unsafe(method(managingTabGroup))]
183 #[unsafe(method_family = none)]
184 pub fn managingTabGroup(&self) -> Option<Retained<UITabGroup>>;
185
186 #[unsafe(method(isHidden))]
189 #[unsafe(method_family = none)]
190 pub fn isHidden(&self) -> bool;
191
192 #[unsafe(method(setHidden:))]
194 #[unsafe(method_family = none)]
195 pub fn setHidden(&self, hidden: bool);
196
197 #[unsafe(method(isHiddenByDefault))]
200 #[unsafe(method_family = none)]
201 pub fn isHiddenByDefault(&self) -> bool;
202
203 #[unsafe(method(setHiddenByDefault:))]
205 #[unsafe(method_family = none)]
206 pub fn setHiddenByDefault(&self, hidden_by_default: bool);
207
208 #[unsafe(method(allowsHiding))]
210 #[unsafe(method_family = none)]
211 pub fn allowsHiding(&self) -> bool;
212
213 #[unsafe(method(setAllowsHiding:))]
215 #[unsafe(method_family = none)]
216 pub fn setAllowsHiding(&self, allows_hiding: bool);
217
218 #[unsafe(method(hasVisiblePlacement))]
221 #[unsafe(method_family = none)]
222 pub fn hasVisiblePlacement(&self) -> bool;
223
224 #[cfg(all(
225 feature = "UIImage",
226 feature = "UIResponder",
227 feature = "UIViewController",
228 feature = "block2"
229 ))]
230 #[unsafe(method(initWithTitle:image:identifier:viewControllerProvider:))]
238 #[unsafe(method_family = init)]
239 pub unsafe fn initWithTitle_image_identifier_viewControllerProvider(
240 this: Allocated<Self>,
241 title: &NSString,
242 image: Option<&UIImage>,
243 identifier: &NSString,
244 view_controller_provider: Option<
245 &block2::DynBlock<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
246 >,
247 ) -> Retained<Self>;
248
249 #[unsafe(method(init))]
250 #[unsafe(method_family = init)]
251 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
252
253 #[unsafe(method(new))]
254 #[unsafe(method_family = new)]
255 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
256 );
257}
258
259impl UITab {
261 extern_methods!();
262}
263
264#[cfg(feature = "UIPopoverPresentationControllerSourceItem")]
265extern_conformance!(
266 unsafe impl UIPopoverPresentationControllerSourceItem for UITab {}
267);
268
269impl UITab {
271 extern_methods!();
272}
273
274#[cfg(feature = "UISpringLoadedInteractionSupporting")]
275extern_conformance!(
276 unsafe impl UISpringLoadedInteractionSupporting for UITab {}
277);
278
279impl UITab {
281 extern_methods!();
282}
283
284#[cfg(feature = "UIAccessibilityIdentification")]
285extern_conformance!(
286 unsafe impl UIAccessibilityIdentification for UITab {}
287);
288
289#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
291impl UIViewController {
292 extern_methods!(
293 #[unsafe(method(tab))]
295 #[unsafe(method_family = none)]
296 pub fn tab(&self) -> Option<Retained<UITab>>;
297 );
298}