objc2_ui_kit/generated/
UITabGroup.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 UITabGroupSidebarAppearance(pub NSUInteger);
15impl UITabGroupSidebarAppearance {
16 #[doc(alias = "UITabGroupSidebarAppearanceAutomatic")]
19 pub const Automatic: Self = Self(0);
20 #[doc(alias = "UITabGroupSidebarAppearanceInline")]
22 pub const Inline: Self = Self(1);
23 #[doc(alias = "UITabGroupSidebarAppearanceRootSection")]
25 pub const RootSection: Self = Self(2);
26}
27
28unsafe impl Encode for UITabGroupSidebarAppearance {
29 const ENCODING: Encoding = NSUInteger::ENCODING;
30}
31
32unsafe impl RefEncode for UITabGroupSidebarAppearance {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37 #[unsafe(super(UITab, NSObject))]
39 #[thread_kind = MainThreadOnly]
40 #[derive(Debug, PartialEq, Eq, Hash)]
41 #[cfg(feature = "UITab")]
42 pub struct UITabGroup;
43);
44
45#[cfg(feature = "UITab")]
46extern_conformance!(
47 unsafe impl NSObjectProtocol for UITabGroup {}
48);
49
50#[cfg(feature = "UITab")]
51impl UITabGroup {
52 extern_methods!(
53 #[unsafe(method(selectedChild))]
55 #[unsafe(method_family = none)]
56 pub fn selectedChild(&self) -> Option<Retained<UITab>>;
57
58 #[unsafe(method(setSelectedChild:))]
60 #[unsafe(method_family = none)]
61 pub fn setSelectedChild(&self, selected_child: Option<&UITab>);
62
63 #[unsafe(method(defaultChildIdentifier))]
66 #[unsafe(method_family = none)]
67 pub fn defaultChildIdentifier(&self) -> Option<Retained<NSString>>;
68
69 #[unsafe(method(setDefaultChildIdentifier:))]
73 #[unsafe(method_family = none)]
74 pub fn setDefaultChildIdentifier(&self, default_child_identifier: Option<&NSString>);
75
76 #[unsafe(method(children))]
78 #[unsafe(method_family = none)]
79 pub fn children(&self) -> Retained<NSArray<UITab>>;
80
81 #[unsafe(method(setChildren:))]
85 #[unsafe(method_family = none)]
86 pub fn setChildren(&self, children: &NSArray<UITab>);
87
88 #[unsafe(method(displayOrderIdentifiers))]
92 #[unsafe(method_family = none)]
93 pub fn displayOrderIdentifiers(&self) -> Retained<NSArray<NSString>>;
94
95 #[unsafe(method(setDisplayOrderIdentifiers:))]
99 #[unsafe(method_family = none)]
100 pub fn setDisplayOrderIdentifiers(&self, display_order_identifiers: &NSArray<NSString>);
101
102 #[unsafe(method(allowsReordering))]
106 #[unsafe(method_family = none)]
107 pub fn allowsReordering(&self) -> bool;
108
109 #[unsafe(method(setAllowsReordering:))]
111 #[unsafe(method_family = none)]
112 pub fn setAllowsReordering(&self, allows_reordering: bool);
113
114 #[unsafe(method(displayOrder))]
118 #[unsafe(method_family = none)]
119 pub fn displayOrder(&self) -> Retained<NSArray<UITab>>;
120
121 #[unsafe(method(tabForIdentifier:))]
124 #[unsafe(method_family = none)]
125 pub fn tabForIdentifier(&self, identifier: &NSString) -> Option<Retained<UITab>>;
126
127 #[cfg(all(
128 feature = "UINavigationController",
129 feature = "UIResponder",
130 feature = "UIViewController"
131 ))]
132 #[unsafe(method(managingNavigationController))]
145 #[unsafe(method_family = none)]
146 pub fn managingNavigationController(&self) -> Option<Retained<UINavigationController>>;
147
148 #[cfg(all(
149 feature = "UINavigationController",
150 feature = "UIResponder",
151 feature = "UIViewController"
152 ))]
153 #[unsafe(method(setManagingNavigationController:))]
155 #[unsafe(method_family = none)]
156 pub fn setManagingNavigationController(
157 &self,
158 managing_navigation_controller: Option<&UINavigationController>,
159 );
160
161 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
162 #[unsafe(method(sidebarActions))]
164 #[unsafe(method_family = none)]
165 pub fn sidebarActions(&self) -> Retained<NSArray<UIAction>>;
166
167 #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
168 #[unsafe(method(setSidebarActions:))]
172 #[unsafe(method_family = none)]
173 pub fn setSidebarActions(&self, sidebar_actions: &NSArray<UIAction>);
174
175 #[unsafe(method(sidebarAppearance))]
177 #[unsafe(method_family = none)]
178 pub fn sidebarAppearance(&self) -> UITabGroupSidebarAppearance;
179
180 #[unsafe(method(setSidebarAppearance:))]
182 #[unsafe(method_family = none)]
183 pub fn setSidebarAppearance(&self, sidebar_appearance: UITabGroupSidebarAppearance);
184
185 #[cfg(all(
186 feature = "UIImage",
187 feature = "UIResponder",
188 feature = "UIViewController",
189 feature = "block2"
190 ))]
191 #[unsafe(method(initWithTitle:image:identifier:children:viewControllerProvider:))]
197 #[unsafe(method_family = init)]
198 pub unsafe fn initWithTitle_image_identifier_children_viewControllerProvider(
199 this: Allocated<Self>,
200 title: &NSString,
201 image: Option<&UIImage>,
202 identifier: &NSString,
203 children: &NSArray<UITab>,
204 view_controller_provider: Option<
205 &block2::DynBlock<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
206 >,
207 ) -> Retained<Self>;
208 );
209}
210
211#[cfg(feature = "UITab")]
213impl UITabGroup {
214 extern_methods!(
215 #[cfg(all(
216 feature = "UIImage",
217 feature = "UIResponder",
218 feature = "UIViewController",
219 feature = "block2"
220 ))]
221 #[unsafe(method(initWithTitle:image:identifier:viewControllerProvider:))]
229 #[unsafe(method_family = init)]
230 pub unsafe fn initWithTitle_image_identifier_viewControllerProvider(
231 this: Allocated<Self>,
232 title: &NSString,
233 image: Option<&UIImage>,
234 identifier: &NSString,
235 view_controller_provider: Option<
236 &block2::DynBlock<dyn Fn(NonNull<UITab>) -> NonNull<UIViewController>>,
237 >,
238 ) -> Retained<Self>;
239
240 #[unsafe(method(init))]
241 #[unsafe(method_family = init)]
242 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
243
244 #[unsafe(method(new))]
245 #[unsafe(method_family = new)]
246 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
247 );
248}