objc2_ui_kit/generated/
UICollectionLayoutList.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UICollectionLayoutListAppearance(pub NSInteger);
17impl UICollectionLayoutListAppearance {
18 #[doc(alias = "UICollectionLayoutListAppearancePlain")]
19 pub const Plain: Self = Self(0);
20 #[doc(alias = "UICollectionLayoutListAppearanceGrouped")]
21 pub const Grouped: Self = Self(1);
22 #[doc(alias = "UICollectionLayoutListAppearanceInsetGrouped")]
23 pub const InsetGrouped: Self = Self(2);
24 #[doc(alias = "UICollectionLayoutListAppearanceSidebar")]
25 pub const Sidebar: Self = Self(3);
26 #[doc(alias = "UICollectionLayoutListAppearanceSidebarPlain")]
27 pub const SidebarPlain: Self = Self(4);
28}
29
30unsafe impl Encode for UICollectionLayoutListAppearance {
31 const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for UICollectionLayoutListAppearance {
35 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38#[repr(transparent)]
41#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
42pub struct UICollectionLayoutListHeaderMode(pub NSInteger);
43impl UICollectionLayoutListHeaderMode {
44 #[doc(alias = "UICollectionLayoutListHeaderModeNone")]
46 pub const None: Self = Self(0);
47 #[doc(alias = "UICollectionLayoutListHeaderModeSupplementary")]
49 pub const Supplementary: Self = Self(1);
50 #[doc(alias = "UICollectionLayoutListHeaderModeFirstItemInSection")]
52 pub const FirstItemInSection: Self = Self(2);
53}
54
55unsafe impl Encode for UICollectionLayoutListHeaderMode {
56 const ENCODING: Encoding = NSInteger::ENCODING;
57}
58
59unsafe impl RefEncode for UICollectionLayoutListHeaderMode {
60 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
61}
62
63#[repr(transparent)]
66#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
67pub struct UICollectionLayoutListFooterMode(pub NSInteger);
68impl UICollectionLayoutListFooterMode {
69 #[doc(alias = "UICollectionLayoutListFooterModeNone")]
71 pub const None: Self = Self(0);
72 #[doc(alias = "UICollectionLayoutListFooterModeSupplementary")]
74 pub const Supplementary: Self = Self(1);
75}
76
77unsafe impl Encode for UICollectionLayoutListFooterMode {
78 const ENCODING: Encoding = NSInteger::ENCODING;
79}
80
81unsafe impl RefEncode for UICollectionLayoutListFooterMode {
82 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
83}
84
85#[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
87pub type UICollectionLayoutListSwipeActionsConfigurationProvider =
88 *mut block2::DynBlock<dyn Fn(NonNull<NSIndexPath>) -> *mut UISwipeActionsConfiguration>;
89
90#[cfg(all(feature = "UIListSeparatorConfiguration", feature = "block2"))]
104pub type UICollectionLayoutListItemSeparatorHandler = *mut block2::DynBlock<
105 dyn Fn(
106 NonNull<NSIndexPath>,
107 NonNull<UIListSeparatorConfiguration>,
108 ) -> NonNull<UIListSeparatorConfiguration>,
109>;
110
111#[repr(transparent)]
116#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
117pub struct UICollectionLayoutListContentHuggingElements(pub NSUInteger);
118bitflags::bitflags! {
119 impl UICollectionLayoutListContentHuggingElements: NSUInteger {
120 #[doc(alias = "UICollectionLayoutListContentHuggingElementsNone")]
121 const None = 0;
122 #[doc(alias = "UICollectionLayoutListContentHuggingElementsSupplementaryHeader")]
123 const SupplementaryHeader = 1<<0;
124 }
125}
126
127unsafe impl Encode for UICollectionLayoutListContentHuggingElements {
128 const ENCODING: Encoding = NSUInteger::ENCODING;
129}
130
131unsafe impl RefEncode for UICollectionLayoutListContentHuggingElements {
132 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
133}
134
135extern_class!(
136 #[unsafe(super(NSObject))]
140 #[thread_kind = MainThreadOnly]
141 #[derive(Debug, PartialEq, Eq, Hash)]
142 pub struct UICollectionLayoutListConfiguration;
143);
144
145extern_conformance!(
146 unsafe impl NSCopying for UICollectionLayoutListConfiguration {}
147);
148
149unsafe impl CopyingHelper for UICollectionLayoutListConfiguration {
150 type Result = Self;
151}
152
153extern_conformance!(
154 unsafe impl NSObjectProtocol for UICollectionLayoutListConfiguration {}
155);
156
157impl UICollectionLayoutListConfiguration {
158 extern_methods!(
159 #[unsafe(method(new))]
160 #[unsafe(method_family = new)]
161 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
162
163 #[unsafe(method(init))]
164 #[unsafe(method_family = init)]
165 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167 #[unsafe(method(initWithAppearance:))]
168 #[unsafe(method_family = init)]
169 pub fn initWithAppearance(
170 this: Allocated<Self>,
171 appearance: UICollectionLayoutListAppearance,
172 ) -> Retained<Self>;
173
174 #[unsafe(method(appearance))]
176 #[unsafe(method_family = none)]
177 pub fn appearance(&self) -> UICollectionLayoutListAppearance;
178
179 #[unsafe(method(showsSeparators))]
182 #[unsafe(method_family = none)]
183 pub fn showsSeparators(&self) -> bool;
184
185 #[unsafe(method(setShowsSeparators:))]
187 #[unsafe(method_family = none)]
188 pub fn setShowsSeparators(&self, shows_separators: bool);
189
190 #[cfg(feature = "UIListSeparatorConfiguration")]
191 #[unsafe(method(separatorConfiguration))]
194 #[unsafe(method_family = none)]
195 pub fn separatorConfiguration(&self) -> Retained<UIListSeparatorConfiguration>;
196
197 #[cfg(feature = "UIListSeparatorConfiguration")]
198 #[unsafe(method(setSeparatorConfiguration:))]
202 #[unsafe(method_family = none)]
203 pub fn setSeparatorConfiguration(
204 &self,
205 separator_configuration: &UIListSeparatorConfiguration,
206 );
207
208 #[cfg(all(feature = "UIListSeparatorConfiguration", feature = "block2"))]
209 #[unsafe(method(itemSeparatorHandler))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn itemSeparatorHandler(&self) -> UICollectionLayoutListItemSeparatorHandler;
220
221 #[cfg(all(feature = "UIListSeparatorConfiguration", feature = "block2"))]
222 #[unsafe(method(setItemSeparatorHandler:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn setItemSeparatorHandler(
232 &self,
233 item_separator_handler: UICollectionLayoutListItemSeparatorHandler,
234 );
235
236 #[cfg(feature = "UIColor")]
237 #[unsafe(method(backgroundColor))]
240 #[unsafe(method_family = none)]
241 pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
242
243 #[cfg(feature = "UIColor")]
244 #[unsafe(method(setBackgroundColor:))]
246 #[unsafe(method_family = none)]
247 pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
248
249 #[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
250 #[unsafe(method(leadingSwipeActionsConfigurationProvider))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn leadingSwipeActionsConfigurationProvider(
259 &self,
260 ) -> UICollectionLayoutListSwipeActionsConfigurationProvider;
261
262 #[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
263 #[unsafe(method(setLeadingSwipeActionsConfigurationProvider:))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn setLeadingSwipeActionsConfigurationProvider(
273 &self,
274 leading_swipe_actions_configuration_provider: UICollectionLayoutListSwipeActionsConfigurationProvider,
275 );
276
277 #[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
278 #[unsafe(method(trailingSwipeActionsConfigurationProvider))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn trailingSwipeActionsConfigurationProvider(
287 &self,
288 ) -> UICollectionLayoutListSwipeActionsConfigurationProvider;
289
290 #[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
291 #[unsafe(method(setTrailingSwipeActionsConfigurationProvider:))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn setTrailingSwipeActionsConfigurationProvider(
301 &self,
302 trailing_swipe_actions_configuration_provider: UICollectionLayoutListSwipeActionsConfigurationProvider,
303 );
304
305 #[unsafe(method(headerMode))]
307 #[unsafe(method_family = none)]
308 pub fn headerMode(&self) -> UICollectionLayoutListHeaderMode;
309
310 #[unsafe(method(setHeaderMode:))]
312 #[unsafe(method_family = none)]
313 pub fn setHeaderMode(&self, header_mode: UICollectionLayoutListHeaderMode);
314
315 #[unsafe(method(footerMode))]
317 #[unsafe(method_family = none)]
318 pub fn footerMode(&self) -> UICollectionLayoutListFooterMode;
319
320 #[unsafe(method(setFooterMode:))]
322 #[unsafe(method_family = none)]
323 pub fn setFooterMode(&self, footer_mode: UICollectionLayoutListFooterMode);
324
325 #[cfg(feature = "objc2-core-foundation")]
326 #[unsafe(method(headerTopPadding))]
328 #[unsafe(method_family = none)]
329 pub fn headerTopPadding(&self) -> CGFloat;
330
331 #[cfg(feature = "objc2-core-foundation")]
332 #[unsafe(method(setHeaderTopPadding:))]
334 #[unsafe(method_family = none)]
335 pub fn setHeaderTopPadding(&self, header_top_padding: CGFloat);
336
337 #[unsafe(method(contentHuggingElements))]
342 #[unsafe(method_family = none)]
343 pub fn contentHuggingElements(&self) -> UICollectionLayoutListContentHuggingElements;
344
345 #[unsafe(method(setContentHuggingElements:))]
347 #[unsafe(method_family = none)]
348 pub fn setContentHuggingElements(
349 &self,
350 content_hugging_elements: UICollectionLayoutListContentHuggingElements,
351 );
352 );
353}
354
355#[cfg(feature = "UICollectionViewCompositionalLayout")]
357impl NSCollectionLayoutSection {
358 extern_methods!(
359 #[unsafe(method(sectionWithListConfiguration:layoutEnvironment:))]
361 #[unsafe(method_family = none)]
362 pub fn sectionWithListConfiguration_layoutEnvironment(
363 configuration: &UICollectionLayoutListConfiguration,
364 layout_environment: &ProtocolObject<dyn NSCollectionLayoutEnvironment>,
365 ) -> Retained<Self>;
366 );
367}
368
369#[cfg(all(
371 feature = "UICollectionViewCompositionalLayout",
372 feature = "UICollectionViewLayout"
373))]
374impl UICollectionViewCompositionalLayout {
375 extern_methods!(
376 #[unsafe(method(layoutWithListConfiguration:))]
378 #[unsafe(method_family = none)]
379 pub fn layoutWithListConfiguration(
380 configuration: &UICollectionLayoutListConfiguration,
381 ) -> Retained<Self>;
382 );
383}