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 unsafe fn identifier(&self) -> Retained<NSString>;
67
68 #[unsafe(method(isEnabled))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn isEnabled(&self) -> bool;
73
74 #[unsafe(method(setEnabled:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn setEnabled(&self, enabled: bool);
78
79 #[unsafe(method(title))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn title(&self) -> Retained<NSString>;
83
84 #[unsafe(method(setTitle:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setTitle(&self, title: &NSString);
88
89 #[cfg(feature = "UIImage")]
90 #[unsafe(method(image))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
94
95 #[cfg(feature = "UIImage")]
96 #[unsafe(method(setImage:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn setImage(&self, image: Option<&UIImage>);
100
101 #[unsafe(method(subtitle))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
105
106 #[unsafe(method(setSubtitle:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
110
111 #[unsafe(method(badgeValue))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn badgeValue(&self) -> Option<Retained<NSString>>;
115
116 #[unsafe(method(setBadgeValue:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn setBadgeValue(&self, badge_value: Option<&NSString>);
120
121 #[unsafe(method(preferredPlacement))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn preferredPlacement(&self) -> UITabPlacement;
126
127 #[unsafe(method(setPreferredPlacement:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setPreferredPlacement(&self, preferred_placement: UITabPlacement);
131
132 #[unsafe(method(userInfo))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
136
137 #[unsafe(method(setUserInfo:))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
141
142 #[cfg(feature = "UITabGroup")]
143 #[unsafe(method(parent))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn parent(&self) -> Option<Retained<UITabGroup>>;
147
148 #[cfg(all(
149 feature = "UIResponder",
150 feature = "UITabBarController",
151 feature = "UIViewController"
152 ))]
153 #[unsafe(method(tabBarController))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn tabBarController(&self) -> Option<Retained<UITabBarController>>;
159
160 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
161 #[unsafe(method(viewController))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn viewController(&self) -> Option<Retained<UIViewController>>;
166
167 #[cfg(feature = "UITabGroup")]
168 #[unsafe(method(managingTabGroup))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn managingTabGroup(&self) -> Option<Retained<UITabGroup>>;
175
176 #[unsafe(method(isHidden))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn isHidden(&self) -> bool;
181
182 #[unsafe(method(setHidden:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn setHidden(&self, hidden: bool);
186
187 #[unsafe(method(isHiddenByDefault))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn isHiddenByDefault(&self) -> bool;
192
193 #[unsafe(method(setHiddenByDefault:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn setHiddenByDefault(&self, hidden_by_default: bool);
197
198 #[unsafe(method(allowsHiding))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn allowsHiding(&self) -> bool;
202
203 #[unsafe(method(setAllowsHiding:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn setAllowsHiding(&self, allows_hiding: bool);
207
208 #[unsafe(method(hasVisiblePlacement))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn hasVisiblePlacement(&self) -> bool;
213
214 #[cfg(all(
215 feature = "UIImage",
216 feature = "UIResponder",
217 feature = "UIViewController",
218 feature = "block2"
219 ))]
220 #[unsafe(method(initWithTitle:image:identifier:viewControllerProvider:))]
224 #[unsafe(method_family = init)]
225 pub unsafe fn initWithTitle_image_identifier_viewControllerProvider(
226 this: Allocated<Self>,
227 title: &NSString,
228 image: Option<&UIImage>,
229 identifier: &NSString,
230 view_controller_provider: Option<
231 &block2::DynBlock<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
232 >,
233 ) -> Retained<Self>;
234
235 #[unsafe(method(init))]
236 #[unsafe(method_family = init)]
237 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
238
239 #[unsafe(method(new))]
240 #[unsafe(method_family = new)]
241 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
242 );
243}
244
245impl UITab {
247 extern_methods!();
248}
249
250#[cfg(feature = "UIPopoverPresentationControllerSourceItem")]
251extern_conformance!(
252 unsafe impl UIPopoverPresentationControllerSourceItem for UITab {}
253);
254
255impl UITab {
257 extern_methods!();
258}
259
260#[cfg(feature = "UISpringLoadedInteractionSupporting")]
261extern_conformance!(
262 unsafe impl UISpringLoadedInteractionSupporting for UITab {}
263);
264
265impl UITab {
267 extern_methods!();
268}
269
270#[cfg(feature = "UIAccessibilityIdentification")]
271extern_conformance!(
272 unsafe impl UIAccessibilityIdentification for UITab {}
273);
274
275#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
277impl UIViewController {
278 extern_methods!(
279 #[unsafe(method(tab))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn tab(&self) -> Option<Retained<UITab>>;
283 );
284}