objc2_ui_kit/generated/
UICollectionViewCompositionalLayout.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentinsetsreference?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UIContentInsetsReference(pub NSInteger);
20impl UIContentInsetsReference {
21    #[doc(alias = "UIContentInsetsReferenceAutomatic")]
22    pub const Automatic: Self = Self(0);
23    #[doc(alias = "UIContentInsetsReferenceNone")]
24    pub const None: Self = Self(1);
25    #[doc(alias = "UIContentInsetsReferenceSafeArea")]
26    pub const SafeArea: Self = Self(2);
27    #[doc(alias = "UIContentInsetsReferenceLayoutMargins")]
28    pub const LayoutMargins: Self = Self(3);
29    #[doc(alias = "UIContentInsetsReferenceReadableContent")]
30    pub const ReadableContent: Self = Self(4);
31}
32
33unsafe impl Encode for UIContentInsetsReference {
34    const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for UIContentInsetsReference {
38    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41extern_class!(
42    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionviewcompositionallayoutconfiguration?language=objc)
43    #[unsafe(super(NSObject))]
44    #[thread_kind = MainThreadOnly]
45    #[derive(Debug, PartialEq, Eq, Hash)]
46    pub struct UICollectionViewCompositionalLayoutConfiguration;
47);
48
49extern_conformance!(
50    unsafe impl NSCopying for UICollectionViewCompositionalLayoutConfiguration {}
51);
52
53unsafe impl CopyingHelper for UICollectionViewCompositionalLayoutConfiguration {
54    type Result = Self;
55}
56
57extern_conformance!(
58    unsafe impl NSObjectProtocol for UICollectionViewCompositionalLayoutConfiguration {}
59);
60
61impl UICollectionViewCompositionalLayoutConfiguration {
62    extern_methods!(
63        #[cfg(feature = "UICollectionViewLayout")]
64        #[unsafe(method(scrollDirection))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn scrollDirection(&self) -> UICollectionViewScrollDirection;
67
68        #[cfg(feature = "UICollectionViewLayout")]
69        /// Setter for [`scrollDirection`][Self::scrollDirection].
70        #[unsafe(method(setScrollDirection:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setScrollDirection(&self, scroll_direction: UICollectionViewScrollDirection);
73
74        #[cfg(feature = "objc2-core-foundation")]
75        #[unsafe(method(interSectionSpacing))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn interSectionSpacing(&self) -> CGFloat;
78
79        #[cfg(feature = "objc2-core-foundation")]
80        /// Setter for [`interSectionSpacing`][Self::interSectionSpacing].
81        #[unsafe(method(setInterSectionSpacing:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setInterSectionSpacing(&self, inter_section_spacing: CGFloat);
84
85        #[unsafe(method(boundarySupplementaryItems))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn boundarySupplementaryItems(
88            &self,
89        ) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
90
91        /// Setter for [`boundarySupplementaryItems`][Self::boundarySupplementaryItems].
92        #[unsafe(method(setBoundarySupplementaryItems:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setBoundarySupplementaryItems(
95            &self,
96            boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
97        );
98
99        #[unsafe(method(contentInsetsReference))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn contentInsetsReference(&self) -> UIContentInsetsReference;
102
103        /// Setter for [`contentInsetsReference`][Self::contentInsetsReference].
104        #[unsafe(method(setContentInsetsReference:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setContentInsetsReference(
107            &self,
108            content_insets_reference: UIContentInsetsReference,
109        );
110    );
111}
112
113/// Methods declared on superclass `NSObject`.
114impl UICollectionViewCompositionalLayoutConfiguration {
115    extern_methods!(
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(new))]
121        #[unsafe(method_family = new)]
122        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
123    );
124}
125
126/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionviewcompositionallayoutsectionprovider?language=objc)
127#[cfg(feature = "block2")]
128pub type UICollectionViewCompositionalLayoutSectionProvider = *mut block2::DynBlock<
129    dyn Fn(
130        NSInteger,
131        NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
132    ) -> *mut NSCollectionLayoutSection,
133>;
134
135extern_class!(
136    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionviewcompositionallayout?language=objc)
137    #[unsafe(super(UICollectionViewLayout, NSObject))]
138    #[thread_kind = MainThreadOnly]
139    #[derive(Debug, PartialEq, Eq, Hash)]
140    #[cfg(feature = "UICollectionViewLayout")]
141    pub struct UICollectionViewCompositionalLayout;
142);
143
144#[cfg(feature = "UICollectionViewLayout")]
145extern_conformance!(
146    unsafe impl NSCoding for UICollectionViewCompositionalLayout {}
147);
148
149#[cfg(feature = "UICollectionViewLayout")]
150extern_conformance!(
151    unsafe impl NSObjectProtocol for UICollectionViewCompositionalLayout {}
152);
153
154#[cfg(feature = "UICollectionViewLayout")]
155impl UICollectionViewCompositionalLayout {
156    extern_methods!(
157        #[unsafe(method(initWithSection:))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn initWithSection(
160            this: Allocated<Self>,
161            section: &NSCollectionLayoutSection,
162        ) -> Retained<Self>;
163
164        #[unsafe(method(initWithSection:configuration:))]
165        #[unsafe(method_family = init)]
166        pub unsafe fn initWithSection_configuration(
167            this: Allocated<Self>,
168            section: &NSCollectionLayoutSection,
169            configuration: &UICollectionViewCompositionalLayoutConfiguration,
170        ) -> Retained<Self>;
171
172        #[cfg(feature = "block2")]
173        #[unsafe(method(initWithSectionProvider:))]
174        #[unsafe(method_family = init)]
175        pub unsafe fn initWithSectionProvider(
176            this: Allocated<Self>,
177            section_provider: UICollectionViewCompositionalLayoutSectionProvider,
178        ) -> Retained<Self>;
179
180        #[cfg(feature = "block2")]
181        #[unsafe(method(initWithSectionProvider:configuration:))]
182        #[unsafe(method_family = init)]
183        pub unsafe fn initWithSectionProvider_configuration(
184            this: Allocated<Self>,
185            section_provider: UICollectionViewCompositionalLayoutSectionProvider,
186            configuration: &UICollectionViewCompositionalLayoutConfiguration,
187        ) -> Retained<Self>;
188
189        #[unsafe(method(init))]
190        #[unsafe(method_family = init)]
191        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
192
193        #[unsafe(method(new))]
194        #[unsafe(method_family = new)]
195        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
196
197        #[unsafe(method(configuration))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn configuration(
200            &self,
201        ) -> Retained<UICollectionViewCompositionalLayoutConfiguration>;
202
203        /// Setter for [`configuration`][Self::configuration].
204        #[unsafe(method(setConfiguration:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn setConfiguration(
207            &self,
208            configuration: &UICollectionViewCompositionalLayoutConfiguration,
209        );
210    );
211}
212
213/// Methods declared on superclass `UICollectionViewLayout`.
214#[cfg(feature = "UICollectionViewLayout")]
215impl UICollectionViewCompositionalLayout {
216    extern_methods!(
217        #[unsafe(method(initWithCoder:))]
218        #[unsafe(method_family = init)]
219        pub unsafe fn initWithCoder(
220            this: Allocated<Self>,
221            coder: &NSCoder,
222        ) -> Option<Retained<Self>>;
223    );
224}
225
226/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingbehavior?language=objc)
227// NS_ENUM
228#[repr(transparent)]
229#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
230pub struct UICollectionLayoutSectionOrthogonalScrollingBehavior(pub NSInteger);
231impl UICollectionLayoutSectionOrthogonalScrollingBehavior {
232    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorNone")]
233    pub const None: Self = Self(0);
234    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorContinuous")]
235    pub const Continuous: Self = Self(1);
236    #[doc(
237        alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary"
238    )]
239    pub const ContinuousGroupLeadingBoundary: Self = Self(2);
240    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorPaging")]
241    pub const Paging: Self = Self(3);
242    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging")]
243    pub const GroupPaging: Self = Self(4);
244    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered")]
245    pub const GroupPagingCentered: Self = Self(5);
246}
247
248unsafe impl Encode for UICollectionLayoutSectionOrthogonalScrollingBehavior {
249    const ENCODING: Encoding = NSInteger::ENCODING;
250}
251
252unsafe impl RefEncode for UICollectionLayoutSectionOrthogonalScrollingBehavior {
253    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
254}
255
256/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutsectionvisibleitemsinvalidationhandler?language=objc)
257#[cfg(all(
258    feature = "UIDynamicBehavior",
259    feature = "block2",
260    feature = "objc2-core-foundation"
261))]
262pub type NSCollectionLayoutSectionVisibleItemsInvalidationHandler = *mut block2::DynBlock<
263    dyn Fn(
264        NonNull<NSArray<ProtocolObject<dyn NSCollectionLayoutVisibleItem>>>,
265        CGPoint,
266        NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
267    ),
268>;
269
270/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingdecelerationrate?language=objc)
271// NS_TYPED_ENUM
272#[cfg(feature = "objc2-core-foundation")]
273pub type UICollectionLayoutSectionOrthogonalScrollingDecelerationRate = CGFloat;
274
275extern "C" {
276    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingdecelerationrateautomatic?language=objc)
277    #[cfg(feature = "objc2-core-foundation")]
278    pub static UICollectionLayoutSectionOrthogonalScrollingDecelerationRateAutomatic:
279        UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
280}
281
282extern "C" {
283    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingdecelerationratenormal?language=objc)
284    #[cfg(feature = "objc2-core-foundation")]
285    pub static UICollectionLayoutSectionOrthogonalScrollingDecelerationRateNormal:
286        UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
287}
288
289extern "C" {
290    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingdecelerationratefast?language=objc)
291    #[cfg(feature = "objc2-core-foundation")]
292    pub static UICollectionLayoutSectionOrthogonalScrollingDecelerationRateFast:
293        UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
294}
295
296/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingbounce?language=objc)
297// NS_ENUM
298#[repr(transparent)]
299#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
300pub struct UICollectionLayoutSectionOrthogonalScrollingBounce(pub NSInteger);
301impl UICollectionLayoutSectionOrthogonalScrollingBounce {
302    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBounceAutomatic")]
303    pub const Automatic: Self = Self(0);
304    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBounceAlways")]
305    pub const Always: Self = Self(1);
306    #[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBounceNever")]
307    pub const Never: Self = Self(2);
308}
309
310unsafe impl Encode for UICollectionLayoutSectionOrthogonalScrollingBounce {
311    const ENCODING: Encoding = NSInteger::ENCODING;
312}
313
314unsafe impl RefEncode for UICollectionLayoutSectionOrthogonalScrollingBounce {
315    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
316}
317
318extern_class!(
319    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionlayoutsectionorthogonalscrollingproperties?language=objc)
320    #[unsafe(super(NSObject))]
321    #[thread_kind = MainThreadOnly]
322    #[derive(Debug, PartialEq, Eq, Hash)]
323    pub struct UICollectionLayoutSectionOrthogonalScrollingProperties;
324);
325
326extern_conformance!(
327    unsafe impl NSCopying for UICollectionLayoutSectionOrthogonalScrollingProperties {}
328);
329
330unsafe impl CopyingHelper for UICollectionLayoutSectionOrthogonalScrollingProperties {
331    type Result = Self;
332}
333
334extern_conformance!(
335    unsafe impl NSObjectProtocol for UICollectionLayoutSectionOrthogonalScrollingProperties {}
336);
337
338impl UICollectionLayoutSectionOrthogonalScrollingProperties {
339    extern_methods!(
340        #[cfg(feature = "objc2-core-foundation")]
341        /// The orthogonal scroll view's rate of deceleration after the user lifts their finger.
342        #[unsafe(method(decelerationRate))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn decelerationRate(
345            &self,
346        ) -> UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
347
348        #[cfg(feature = "objc2-core-foundation")]
349        /// Setter for [`decelerationRate`][Self::decelerationRate].
350        #[unsafe(method(setDecelerationRate:))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn setDecelerationRate(
353            &self,
354            deceleration_rate: UICollectionLayoutSectionOrthogonalScrollingDecelerationRate,
355        );
356
357        /// The orthogonal scroll view's bounce behavior.
358        #[unsafe(method(bounce))]
359        #[unsafe(method_family = none)]
360        pub unsafe fn bounce(&self) -> UICollectionLayoutSectionOrthogonalScrollingBounce;
361
362        /// Setter for [`bounce`][Self::bounce].
363        #[unsafe(method(setBounce:))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn setBounce(&self, bounce: UICollectionLayoutSectionOrthogonalScrollingBounce);
366    );
367}
368
369/// Methods declared on superclass `NSObject`.
370impl UICollectionLayoutSectionOrthogonalScrollingProperties {
371    extern_methods!(
372        #[unsafe(method(init))]
373        #[unsafe(method_family = init)]
374        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
375
376        #[unsafe(method(new))]
377        #[unsafe(method_family = new)]
378        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
379    );
380}
381
382extern_class!(
383    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutsection?language=objc)
384    #[unsafe(super(NSObject))]
385    #[thread_kind = MainThreadOnly]
386    #[derive(Debug, PartialEq, Eq, Hash)]
387    pub struct NSCollectionLayoutSection;
388);
389
390extern_conformance!(
391    unsafe impl NSCopying for NSCollectionLayoutSection {}
392);
393
394unsafe impl CopyingHelper for NSCollectionLayoutSection {
395    type Result = Self;
396}
397
398extern_conformance!(
399    unsafe impl NSObjectProtocol for NSCollectionLayoutSection {}
400);
401
402impl NSCollectionLayoutSection {
403    extern_methods!(
404        #[unsafe(method(sectionWithGroup:))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn sectionWithGroup(group: &NSCollectionLayoutGroup) -> Retained<Self>;
407
408        #[unsafe(method(init))]
409        #[unsafe(method_family = init)]
410        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
411
412        #[unsafe(method(new))]
413        #[unsafe(method_family = new)]
414        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
415
416        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
417        #[unsafe(method(contentInsets))]
418        #[unsafe(method_family = none)]
419        pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
420
421        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
422        /// Setter for [`contentInsets`][Self::contentInsets].
423        #[unsafe(method(setContentInsets:))]
424        #[unsafe(method_family = none)]
425        pub unsafe fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
426
427        #[cfg(feature = "objc2-core-foundation")]
428        #[unsafe(method(interGroupSpacing))]
429        #[unsafe(method_family = none)]
430        pub unsafe fn interGroupSpacing(&self) -> CGFloat;
431
432        #[cfg(feature = "objc2-core-foundation")]
433        /// Setter for [`interGroupSpacing`][Self::interGroupSpacing].
434        #[unsafe(method(setInterGroupSpacing:))]
435        #[unsafe(method_family = none)]
436        pub unsafe fn setInterGroupSpacing(&self, inter_group_spacing: CGFloat);
437
438        #[unsafe(method(contentInsetsReference))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn contentInsetsReference(&self) -> UIContentInsetsReference;
441
442        /// Setter for [`contentInsetsReference`][Self::contentInsetsReference].
443        #[unsafe(method(setContentInsetsReference:))]
444        #[unsafe(method_family = none)]
445        pub unsafe fn setContentInsetsReference(
446            &self,
447            content_insets_reference: UIContentInsetsReference,
448        );
449
450        /// Specifies the content insets reference for boundary supplementaries in this section.
451        /// The default value of this property is UIContentInsetsReference.automatic, which means that any insets specified on a
452        /// `NSCollectionLayoutBoundarySupplementaryItem`will follow the layout configuration's
453        /// `contentInsetsReference.`
454        #[unsafe(method(supplementaryContentInsetsReference))]
455        #[unsafe(method_family = none)]
456        pub unsafe fn supplementaryContentInsetsReference(&self) -> UIContentInsetsReference;
457
458        /// Setter for [`supplementaryContentInsetsReference`][Self::supplementaryContentInsetsReference].
459        #[unsafe(method(setSupplementaryContentInsetsReference:))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn setSupplementaryContentInsetsReference(
462            &self,
463            supplementary_content_insets_reference: UIContentInsetsReference,
464        );
465
466        #[unsafe(method(orthogonalScrollingBehavior))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn orthogonalScrollingBehavior(
469            &self,
470        ) -> UICollectionLayoutSectionOrthogonalScrollingBehavior;
471
472        /// Setter for [`orthogonalScrollingBehavior`][Self::orthogonalScrollingBehavior].
473        #[unsafe(method(setOrthogonalScrollingBehavior:))]
474        #[unsafe(method_family = none)]
475        pub unsafe fn setOrthogonalScrollingBehavior(
476            &self,
477            orthogonal_scrolling_behavior: UICollectionLayoutSectionOrthogonalScrollingBehavior,
478        );
479
480        #[unsafe(method(orthogonalScrollingProperties))]
481        #[unsafe(method_family = none)]
482        pub unsafe fn orthogonalScrollingProperties(
483            &self,
484        ) -> Retained<UICollectionLayoutSectionOrthogonalScrollingProperties>;
485
486        #[unsafe(method(boundarySupplementaryItems))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn boundarySupplementaryItems(
489            &self,
490        ) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
491
492        /// Setter for [`boundarySupplementaryItems`][Self::boundarySupplementaryItems].
493        #[unsafe(method(setBoundarySupplementaryItems:))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn setBoundarySupplementaryItems(
496            &self,
497            boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
498        );
499
500        #[cfg(all(
501            feature = "UIDynamicBehavior",
502            feature = "block2",
503            feature = "objc2-core-foundation"
504        ))]
505        #[unsafe(method(visibleItemsInvalidationHandler))]
506        #[unsafe(method_family = none)]
507        pub unsafe fn visibleItemsInvalidationHandler(
508            &self,
509        ) -> NSCollectionLayoutSectionVisibleItemsInvalidationHandler;
510
511        #[cfg(all(
512            feature = "UIDynamicBehavior",
513            feature = "block2",
514            feature = "objc2-core-foundation"
515        ))]
516        /// Setter for [`visibleItemsInvalidationHandler`][Self::visibleItemsInvalidationHandler].
517        #[unsafe(method(setVisibleItemsInvalidationHandler:))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn setVisibleItemsInvalidationHandler(
520            &self,
521            visible_items_invalidation_handler: NSCollectionLayoutSectionVisibleItemsInvalidationHandler,
522        );
523
524        #[unsafe(method(decorationItems))]
525        #[unsafe(method_family = none)]
526        pub unsafe fn decorationItems(&self)
527            -> Retained<NSArray<NSCollectionLayoutDecorationItem>>;
528
529        /// Setter for [`decorationItems`][Self::decorationItems].
530        #[unsafe(method(setDecorationItems:))]
531        #[unsafe(method_family = none)]
532        pub unsafe fn setDecorationItems(
533            &self,
534            decoration_items: &NSArray<NSCollectionLayoutDecorationItem>,
535        );
536    );
537}
538
539extern_class!(
540    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutitem?language=objc)
541    #[unsafe(super(NSObject))]
542    #[thread_kind = MainThreadOnly]
543    #[derive(Debug, PartialEq, Eq, Hash)]
544    pub struct NSCollectionLayoutItem;
545);
546
547extern_conformance!(
548    unsafe impl NSCopying for NSCollectionLayoutItem {}
549);
550
551unsafe impl CopyingHelper for NSCollectionLayoutItem {
552    type Result = Self;
553}
554
555extern_conformance!(
556    unsafe impl NSObjectProtocol for NSCollectionLayoutItem {}
557);
558
559impl NSCollectionLayoutItem {
560    extern_methods!(
561        #[unsafe(method(itemWithLayoutSize:))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
564
565        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn itemWithLayoutSize_supplementaryItems(
568            layout_size: &NSCollectionLayoutSize,
569            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
570        ) -> Retained<Self>;
571
572        #[unsafe(method(init))]
573        #[unsafe(method_family = init)]
574        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
575
576        #[unsafe(method(new))]
577        #[unsafe(method_family = new)]
578        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
579
580        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
581        #[unsafe(method(contentInsets))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
584
585        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
586        /// Setter for [`contentInsets`][Self::contentInsets].
587        #[unsafe(method(setContentInsets:))]
588        #[unsafe(method_family = none)]
589        pub unsafe fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
590
591        #[unsafe(method(edgeSpacing))]
592        #[unsafe(method_family = none)]
593        pub unsafe fn edgeSpacing(&self) -> Option<Retained<NSCollectionLayoutEdgeSpacing>>;
594
595        /// Setter for [`edgeSpacing`][Self::edgeSpacing].
596        #[unsafe(method(setEdgeSpacing:))]
597        #[unsafe(method_family = none)]
598        pub unsafe fn setEdgeSpacing(&self, edge_spacing: Option<&NSCollectionLayoutEdgeSpacing>);
599
600        #[unsafe(method(layoutSize))]
601        #[unsafe(method_family = none)]
602        pub unsafe fn layoutSize(&self) -> Retained<NSCollectionLayoutSize>;
603
604        #[unsafe(method(supplementaryItems))]
605        #[unsafe(method_family = none)]
606        pub unsafe fn supplementaryItems(
607            &self,
608        ) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
609    );
610}
611
612extern_class!(
613    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutgroupcustomitem?language=objc)
614    #[unsafe(super(NSObject))]
615    #[thread_kind = MainThreadOnly]
616    #[derive(Debug, PartialEq, Eq, Hash)]
617    pub struct NSCollectionLayoutGroupCustomItem;
618);
619
620extern_conformance!(
621    unsafe impl NSCopying for NSCollectionLayoutGroupCustomItem {}
622);
623
624unsafe impl CopyingHelper for NSCollectionLayoutGroupCustomItem {
625    type Result = Self;
626}
627
628extern_conformance!(
629    unsafe impl NSObjectProtocol for NSCollectionLayoutGroupCustomItem {}
630);
631
632impl NSCollectionLayoutGroupCustomItem {
633    extern_methods!(
634        #[cfg(feature = "objc2-core-foundation")]
635        #[unsafe(method(customItemWithFrame:))]
636        #[unsafe(method_family = none)]
637        pub unsafe fn customItemWithFrame(frame: CGRect, mtm: MainThreadMarker) -> Retained<Self>;
638
639        #[cfg(feature = "objc2-core-foundation")]
640        #[unsafe(method(customItemWithFrame:zIndex:))]
641        #[unsafe(method_family = none)]
642        pub unsafe fn customItemWithFrame_zIndex(
643            frame: CGRect,
644            z_index: NSInteger,
645            mtm: MainThreadMarker,
646        ) -> Retained<Self>;
647
648        #[unsafe(method(init))]
649        #[unsafe(method_family = init)]
650        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
651
652        #[unsafe(method(new))]
653        #[unsafe(method_family = new)]
654        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
655
656        #[cfg(feature = "objc2-core-foundation")]
657        #[unsafe(method(frame))]
658        #[unsafe(method_family = none)]
659        pub unsafe fn frame(&self) -> CGRect;
660
661        #[unsafe(method(zIndex))]
662        #[unsafe(method_family = none)]
663        pub unsafe fn zIndex(&self) -> NSInteger;
664    );
665}
666
667/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutgroupcustomitemprovider?language=objc)
668#[cfg(feature = "block2")]
669pub type NSCollectionLayoutGroupCustomItemProvider = *mut block2::DynBlock<
670    dyn Fn(
671        NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
672    ) -> NonNull<NSArray<NSCollectionLayoutGroupCustomItem>>,
673>;
674
675extern_class!(
676    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutgroup?language=objc)
677    #[unsafe(super(NSCollectionLayoutItem, NSObject))]
678    #[thread_kind = MainThreadOnly]
679    #[derive(Debug, PartialEq, Eq, Hash)]
680    pub struct NSCollectionLayoutGroup;
681);
682
683extern_conformance!(
684    unsafe impl NSCopying for NSCollectionLayoutGroup {}
685);
686
687unsafe impl CopyingHelper for NSCollectionLayoutGroup {
688    type Result = Self;
689}
690
691extern_conformance!(
692    unsafe impl NSObjectProtocol for NSCollectionLayoutGroup {}
693);
694
695impl NSCollectionLayoutGroup {
696    extern_methods!(
697        /// Specifies a group that will horizontally repeat its subitem a fixed number of times.
698        ///
699        /// Parameter `layoutSize`: The group's size.
700        ///
701        /// Parameter `subitem`: The subitem to repeat. It is the caller's responsibility to ensure that the group's
702        /// `layoutSize`can fit
703        /// `count`repetitions of this item.
704        ///
705        /// Parameter `count`: The number of times to repeat the passed in subitem.
706        #[unsafe(method(horizontalGroupWithLayoutSize:repeatingSubitem:count:))]
707        #[unsafe(method_family = none)]
708        pub unsafe fn horizontalGroupWithLayoutSize_repeatingSubitem_count(
709            layout_size: &NSCollectionLayoutSize,
710            subitem: &NSCollectionLayoutItem,
711            count: NSInteger,
712        ) -> Retained<Self>;
713
714        #[unsafe(method(horizontalGroupWithLayoutSize:subitems:))]
715        #[unsafe(method_family = none)]
716        pub unsafe fn horizontalGroupWithLayoutSize_subitems(
717            layout_size: &NSCollectionLayoutSize,
718            subitems: &NSArray<NSCollectionLayoutItem>,
719        ) -> Retained<Self>;
720
721        /// Specifies a group that will vertically repeat its subitem a fixed number of times.
722        ///
723        /// Parameter `layoutSize`: The group's size.
724        ///
725        /// Parameter `subitem`: The subitem to repeat. It is the caller's responsibility to ensure that the group's
726        /// `layoutSize`can fit
727        /// `count`repetitions of this item.
728        ///
729        /// Parameter `count`: The number of times to repeat the passed in subitem.
730        #[unsafe(method(verticalGroupWithLayoutSize:repeatingSubitem:count:))]
731        #[unsafe(method_family = none)]
732        pub unsafe fn verticalGroupWithLayoutSize_repeatingSubitem_count(
733            layout_size: &NSCollectionLayoutSize,
734            subitem: &NSCollectionLayoutItem,
735            count: NSInteger,
736        ) -> Retained<Self>;
737
738        #[unsafe(method(verticalGroupWithLayoutSize:subitems:))]
739        #[unsafe(method_family = none)]
740        pub unsafe fn verticalGroupWithLayoutSize_subitems(
741            layout_size: &NSCollectionLayoutSize,
742            subitems: &NSArray<NSCollectionLayoutItem>,
743        ) -> Retained<Self>;
744
745        #[cfg(feature = "block2")]
746        #[unsafe(method(customGroupWithLayoutSize:itemProvider:))]
747        #[unsafe(method_family = none)]
748        pub unsafe fn customGroupWithLayoutSize_itemProvider(
749            layout_size: &NSCollectionLayoutSize,
750            item_provider: NSCollectionLayoutGroupCustomItemProvider,
751        ) -> Retained<Self>;
752
753        #[unsafe(method(init))]
754        #[unsafe(method_family = init)]
755        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
756
757        #[unsafe(method(new))]
758        #[unsafe(method_family = new)]
759        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
760
761        #[unsafe(method(supplementaryItems))]
762        #[unsafe(method_family = none)]
763        pub unsafe fn supplementaryItems(
764            &self,
765        ) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
766
767        /// Setter for [`supplementaryItems`][Self::supplementaryItems].
768        #[unsafe(method(setSupplementaryItems:))]
769        #[unsafe(method_family = none)]
770        pub unsafe fn setSupplementaryItems(
771            &self,
772            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
773        );
774
775        #[unsafe(method(interItemSpacing))]
776        #[unsafe(method_family = none)]
777        pub unsafe fn interItemSpacing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
778
779        /// Setter for [`interItemSpacing`][Self::interItemSpacing].
780        #[unsafe(method(setInterItemSpacing:))]
781        #[unsafe(method_family = none)]
782        pub unsafe fn setInterItemSpacing(
783            &self,
784            inter_item_spacing: Option<&NSCollectionLayoutSpacing>,
785        );
786
787        #[unsafe(method(subitems))]
788        #[unsafe(method_family = none)]
789        pub unsafe fn subitems(&self) -> Retained<NSArray<NSCollectionLayoutItem>>;
790
791        #[unsafe(method(visualDescription))]
792        #[unsafe(method_family = none)]
793        pub unsafe fn visualDescription(&self) -> Retained<NSString>;
794    );
795}
796
797/// Methods declared on superclass `NSCollectionLayoutItem`.
798impl NSCollectionLayoutGroup {
799    extern_methods!(
800        #[unsafe(method(itemWithLayoutSize:))]
801        #[unsafe(method_family = none)]
802        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
803
804        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
805        #[unsafe(method_family = none)]
806        pub unsafe fn itemWithLayoutSize_supplementaryItems(
807            layout_size: &NSCollectionLayoutSize,
808            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
809        ) -> Retained<Self>;
810    );
811}
812
813extern_class!(
814    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutdimension?language=objc)
815    #[unsafe(super(NSObject))]
816    #[thread_kind = MainThreadOnly]
817    #[derive(Debug, PartialEq, Eq, Hash)]
818    pub struct NSCollectionLayoutDimension;
819);
820
821extern_conformance!(
822    unsafe impl NSCopying for NSCollectionLayoutDimension {}
823);
824
825unsafe impl CopyingHelper for NSCollectionLayoutDimension {
826    type Result = Self;
827}
828
829extern_conformance!(
830    unsafe impl NSObjectProtocol for NSCollectionLayoutDimension {}
831);
832
833impl NSCollectionLayoutDimension {
834    extern_methods!(
835        #[cfg(feature = "objc2-core-foundation")]
836        #[unsafe(method(fractionalWidthDimension:))]
837        #[unsafe(method_family = none)]
838        pub unsafe fn fractionalWidthDimension(
839            fractional_width: CGFloat,
840            mtm: MainThreadMarker,
841        ) -> Retained<Self>;
842
843        #[cfg(feature = "objc2-core-foundation")]
844        #[unsafe(method(fractionalHeightDimension:))]
845        #[unsafe(method_family = none)]
846        pub unsafe fn fractionalHeightDimension(
847            fractional_height: CGFloat,
848            mtm: MainThreadMarker,
849        ) -> Retained<Self>;
850
851        #[cfg(feature = "objc2-core-foundation")]
852        #[unsafe(method(absoluteDimension:))]
853        #[unsafe(method_family = none)]
854        pub unsafe fn absoluteDimension(
855            absolute_dimension: CGFloat,
856            mtm: MainThreadMarker,
857        ) -> Retained<Self>;
858
859        #[cfg(feature = "objc2-core-foundation")]
860        #[unsafe(method(estimatedDimension:))]
861        #[unsafe(method_family = none)]
862        pub unsafe fn estimatedDimension(
863            estimated_dimension: CGFloat,
864            mtm: MainThreadMarker,
865        ) -> Retained<Self>;
866
867        #[cfg(feature = "objc2-core-foundation")]
868        /// Items with this dimension type will receive at least as much room as the view requires, and will
869        /// grow to match the dimension of the largest estimated sibling in their parent.
870        /// When specified on the outermost group for a section, the largest size will be shared across the entire section.
871        ///
872        /// Eg: All `NSCollectionLayoutItem`s specified with a `uniformAcrossSiblingsWithEstimate:` `heightDimension` in a horizontal `NSCollectionLayoutGroup`
873        /// will have a height equal to the height of the tallest item in that group.
874        ///
875        /// When computing the size for a dimension of this type, the layout will need to retrieve preferred attributes for all siblings
876        /// in its parent, which in `UICollectionView` means creating views for all dependent items. This can be very expensive, so `uniformAcrossSiblingsWithEstimate` should
877        /// only be used in layouts where the number of dependent items is known to be relatively small.
878        #[unsafe(method(uniformAcrossSiblingsWithEstimate:))]
879        #[unsafe(method_family = none)]
880        pub unsafe fn uniformAcrossSiblingsWithEstimate(
881            estimated_dimension: CGFloat,
882            mtm: MainThreadMarker,
883        ) -> Retained<Self>;
884
885        #[unsafe(method(init))]
886        #[unsafe(method_family = init)]
887        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
888
889        #[unsafe(method(new))]
890        #[unsafe(method_family = new)]
891        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
892
893        #[unsafe(method(isFractionalWidth))]
894        #[unsafe(method_family = none)]
895        pub unsafe fn isFractionalWidth(&self) -> bool;
896
897        #[unsafe(method(isFractionalHeight))]
898        #[unsafe(method_family = none)]
899        pub unsafe fn isFractionalHeight(&self) -> bool;
900
901        #[unsafe(method(isAbsolute))]
902        #[unsafe(method_family = none)]
903        pub unsafe fn isAbsolute(&self) -> bool;
904
905        /// Returns `YES` if the receiver is `estimated` OR `uniformAcrossSiblings`.
906        #[unsafe(method(isEstimated))]
907        #[unsafe(method_family = none)]
908        pub unsafe fn isEstimated(&self) -> bool;
909
910        #[unsafe(method(isUniformAcrossSiblings))]
911        #[unsafe(method_family = none)]
912        pub unsafe fn isUniformAcrossSiblings(&self) -> bool;
913
914        #[cfg(feature = "objc2-core-foundation")]
915        #[unsafe(method(dimension))]
916        #[unsafe(method_family = none)]
917        pub unsafe fn dimension(&self) -> CGFloat;
918    );
919}
920
921extern_class!(
922    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutsize?language=objc)
923    #[unsafe(super(NSObject))]
924    #[thread_kind = MainThreadOnly]
925    #[derive(Debug, PartialEq, Eq, Hash)]
926    pub struct NSCollectionLayoutSize;
927);
928
929extern_conformance!(
930    unsafe impl NSCopying for NSCollectionLayoutSize {}
931);
932
933unsafe impl CopyingHelper for NSCollectionLayoutSize {
934    type Result = Self;
935}
936
937extern_conformance!(
938    unsafe impl NSObjectProtocol for NSCollectionLayoutSize {}
939);
940
941impl NSCollectionLayoutSize {
942    extern_methods!(
943        #[unsafe(method(sizeWithWidthDimension:heightDimension:))]
944        #[unsafe(method_family = none)]
945        pub unsafe fn sizeWithWidthDimension_heightDimension(
946            width: &NSCollectionLayoutDimension,
947            height: &NSCollectionLayoutDimension,
948        ) -> Retained<Self>;
949
950        #[unsafe(method(init))]
951        #[unsafe(method_family = init)]
952        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
953
954        #[unsafe(method(new))]
955        #[unsafe(method_family = new)]
956        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
957
958        #[unsafe(method(widthDimension))]
959        #[unsafe(method_family = none)]
960        pub unsafe fn widthDimension(&self) -> Retained<NSCollectionLayoutDimension>;
961
962        #[unsafe(method(heightDimension))]
963        #[unsafe(method_family = none)]
964        pub unsafe fn heightDimension(&self) -> Retained<NSCollectionLayoutDimension>;
965    );
966}
967
968extern_class!(
969    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutspacing?language=objc)
970    #[unsafe(super(NSObject))]
971    #[thread_kind = MainThreadOnly]
972    #[derive(Debug, PartialEq, Eq, Hash)]
973    pub struct NSCollectionLayoutSpacing;
974);
975
976extern_conformance!(
977    unsafe impl NSCopying for NSCollectionLayoutSpacing {}
978);
979
980unsafe impl CopyingHelper for NSCollectionLayoutSpacing {
981    type Result = Self;
982}
983
984extern_conformance!(
985    unsafe impl NSObjectProtocol for NSCollectionLayoutSpacing {}
986);
987
988impl NSCollectionLayoutSpacing {
989    extern_methods!(
990        #[cfg(feature = "objc2-core-foundation")]
991        #[unsafe(method(flexibleSpacing:))]
992        #[unsafe(method_family = none)]
993        pub unsafe fn flexibleSpacing(
994            flexible_spacing: CGFloat,
995            mtm: MainThreadMarker,
996        ) -> Retained<Self>;
997
998        #[cfg(feature = "objc2-core-foundation")]
999        #[unsafe(method(fixedSpacing:))]
1000        #[unsafe(method_family = none)]
1001        pub unsafe fn fixedSpacing(fixed_spacing: CGFloat, mtm: MainThreadMarker)
1002            -> Retained<Self>;
1003
1004        #[unsafe(method(init))]
1005        #[unsafe(method_family = init)]
1006        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1007
1008        #[unsafe(method(new))]
1009        #[unsafe(method_family = new)]
1010        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1011
1012        #[cfg(feature = "objc2-core-foundation")]
1013        #[unsafe(method(spacing))]
1014        #[unsafe(method_family = none)]
1015        pub unsafe fn spacing(&self) -> CGFloat;
1016
1017        #[unsafe(method(isFlexibleSpacing))]
1018        #[unsafe(method_family = none)]
1019        pub unsafe fn isFlexibleSpacing(&self) -> bool;
1020
1021        #[unsafe(method(isFixedSpacing))]
1022        #[unsafe(method_family = none)]
1023        pub unsafe fn isFixedSpacing(&self) -> bool;
1024    );
1025}
1026
1027extern_class!(
1028    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutedgespacing?language=objc)
1029    #[unsafe(super(NSObject))]
1030    #[thread_kind = MainThreadOnly]
1031    #[derive(Debug, PartialEq, Eq, Hash)]
1032    pub struct NSCollectionLayoutEdgeSpacing;
1033);
1034
1035extern_conformance!(
1036    unsafe impl NSCopying for NSCollectionLayoutEdgeSpacing {}
1037);
1038
1039unsafe impl CopyingHelper for NSCollectionLayoutEdgeSpacing {
1040    type Result = Self;
1041}
1042
1043extern_conformance!(
1044    unsafe impl NSObjectProtocol for NSCollectionLayoutEdgeSpacing {}
1045);
1046
1047impl NSCollectionLayoutEdgeSpacing {
1048    extern_methods!(
1049        #[unsafe(method(spacingForLeading:top:trailing:bottom:))]
1050        #[unsafe(method_family = none)]
1051        pub unsafe fn spacingForLeading_top_trailing_bottom(
1052            leading: Option<&NSCollectionLayoutSpacing>,
1053            top: Option<&NSCollectionLayoutSpacing>,
1054            trailing: Option<&NSCollectionLayoutSpacing>,
1055            bottom: Option<&NSCollectionLayoutSpacing>,
1056            mtm: MainThreadMarker,
1057        ) -> Retained<Self>;
1058
1059        #[unsafe(method(init))]
1060        #[unsafe(method_family = init)]
1061        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1062
1063        #[unsafe(method(new))]
1064        #[unsafe(method_family = new)]
1065        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1066
1067        #[unsafe(method(leading))]
1068        #[unsafe(method_family = none)]
1069        pub unsafe fn leading(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
1070
1071        #[unsafe(method(top))]
1072        #[unsafe(method_family = none)]
1073        pub unsafe fn top(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
1074
1075        #[unsafe(method(trailing))]
1076        #[unsafe(method_family = none)]
1077        pub unsafe fn trailing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
1078
1079        #[unsafe(method(bottom))]
1080        #[unsafe(method_family = none)]
1081        pub unsafe fn bottom(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
1082    );
1083}
1084
1085extern_class!(
1086    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutsupplementaryitem?language=objc)
1087    #[unsafe(super(NSCollectionLayoutItem, NSObject))]
1088    #[thread_kind = MainThreadOnly]
1089    #[derive(Debug, PartialEq, Eq, Hash)]
1090    pub struct NSCollectionLayoutSupplementaryItem;
1091);
1092
1093extern_conformance!(
1094    unsafe impl NSCopying for NSCollectionLayoutSupplementaryItem {}
1095);
1096
1097unsafe impl CopyingHelper for NSCollectionLayoutSupplementaryItem {
1098    type Result = Self;
1099}
1100
1101extern_conformance!(
1102    unsafe impl NSObjectProtocol for NSCollectionLayoutSupplementaryItem {}
1103);
1104
1105impl NSCollectionLayoutSupplementaryItem {
1106    extern_methods!(
1107        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
1108        #[unsafe(method_family = none)]
1109        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
1110            layout_size: &NSCollectionLayoutSize,
1111            element_kind: &NSString,
1112            container_anchor: &NSCollectionLayoutAnchor,
1113        ) -> Retained<Self>;
1114
1115        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
1116        #[unsafe(method_family = none)]
1117        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
1118            layout_size: &NSCollectionLayoutSize,
1119            element_kind: &NSString,
1120            container_anchor: &NSCollectionLayoutAnchor,
1121            item_anchor: &NSCollectionLayoutAnchor,
1122        ) -> Retained<Self>;
1123
1124        #[unsafe(method(init))]
1125        #[unsafe(method_family = init)]
1126        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1127
1128        #[unsafe(method(new))]
1129        #[unsafe(method_family = new)]
1130        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1131
1132        #[unsafe(method(zIndex))]
1133        #[unsafe(method_family = none)]
1134        pub unsafe fn zIndex(&self) -> NSInteger;
1135
1136        /// Setter for [`zIndex`][Self::zIndex].
1137        #[unsafe(method(setZIndex:))]
1138        #[unsafe(method_family = none)]
1139        pub unsafe fn setZIndex(&self, z_index: NSInteger);
1140
1141        #[unsafe(method(elementKind))]
1142        #[unsafe(method_family = none)]
1143        pub unsafe fn elementKind(&self) -> Retained<NSString>;
1144
1145        #[unsafe(method(containerAnchor))]
1146        #[unsafe(method_family = none)]
1147        pub unsafe fn containerAnchor(&self) -> Retained<NSCollectionLayoutAnchor>;
1148
1149        #[unsafe(method(itemAnchor))]
1150        #[unsafe(method_family = none)]
1151        pub unsafe fn itemAnchor(&self) -> Option<Retained<NSCollectionLayoutAnchor>>;
1152    );
1153}
1154
1155/// Methods declared on superclass `NSCollectionLayoutItem`.
1156impl NSCollectionLayoutSupplementaryItem {
1157    extern_methods!(
1158        #[unsafe(method(itemWithLayoutSize:))]
1159        #[unsafe(method_family = none)]
1160        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1161
1162        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1163        #[unsafe(method_family = none)]
1164        pub unsafe fn itemWithLayoutSize_supplementaryItems(
1165            layout_size: &NSCollectionLayoutSize,
1166            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1167        ) -> Retained<Self>;
1168    );
1169}
1170
1171extern_class!(
1172    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutboundarysupplementaryitem?language=objc)
1173    #[unsafe(super(NSCollectionLayoutSupplementaryItem, NSCollectionLayoutItem, NSObject))]
1174    #[thread_kind = MainThreadOnly]
1175    #[derive(Debug, PartialEq, Eq, Hash)]
1176    pub struct NSCollectionLayoutBoundarySupplementaryItem;
1177);
1178
1179extern_conformance!(
1180    unsafe impl NSCopying for NSCollectionLayoutBoundarySupplementaryItem {}
1181);
1182
1183unsafe impl CopyingHelper for NSCollectionLayoutBoundarySupplementaryItem {
1184    type Result = Self;
1185}
1186
1187extern_conformance!(
1188    unsafe impl NSObjectProtocol for NSCollectionLayoutBoundarySupplementaryItem {}
1189);
1190
1191impl NSCollectionLayoutBoundarySupplementaryItem {
1192    extern_methods!(
1193        #[cfg(feature = "UIGeometry")]
1194        #[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:))]
1195        #[unsafe(method_family = none)]
1196        pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment(
1197            layout_size: &NSCollectionLayoutSize,
1198            element_kind: &NSString,
1199            alignment: NSRectAlignment,
1200        ) -> Retained<Self>;
1201
1202        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1203        #[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:))]
1204        #[unsafe(method_family = none)]
1205        pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment_absoluteOffset(
1206            layout_size: &NSCollectionLayoutSize,
1207            element_kind: &NSString,
1208            alignment: NSRectAlignment,
1209            absolute_offset: CGPoint,
1210        ) -> Retained<Self>;
1211
1212        #[unsafe(method(init))]
1213        #[unsafe(method_family = init)]
1214        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1215
1216        #[unsafe(method(new))]
1217        #[unsafe(method_family = new)]
1218        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1219
1220        #[unsafe(method(extendsBoundary))]
1221        #[unsafe(method_family = none)]
1222        pub unsafe fn extendsBoundary(&self) -> bool;
1223
1224        /// Setter for [`extendsBoundary`][Self::extendsBoundary].
1225        #[unsafe(method(setExtendsBoundary:))]
1226        #[unsafe(method_family = none)]
1227        pub unsafe fn setExtendsBoundary(&self, extends_boundary: bool);
1228
1229        #[unsafe(method(pinToVisibleBounds))]
1230        #[unsafe(method_family = none)]
1231        pub unsafe fn pinToVisibleBounds(&self) -> bool;
1232
1233        /// Setter for [`pinToVisibleBounds`][Self::pinToVisibleBounds].
1234        #[unsafe(method(setPinToVisibleBounds:))]
1235        #[unsafe(method_family = none)]
1236        pub unsafe fn setPinToVisibleBounds(&self, pin_to_visible_bounds: bool);
1237
1238        #[cfg(feature = "UIGeometry")]
1239        #[unsafe(method(alignment))]
1240        #[unsafe(method_family = none)]
1241        pub unsafe fn alignment(&self) -> NSRectAlignment;
1242
1243        #[cfg(feature = "objc2-core-foundation")]
1244        #[unsafe(method(offset))]
1245        #[unsafe(method_family = none)]
1246        pub unsafe fn offset(&self) -> CGPoint;
1247    );
1248}
1249
1250/// Methods declared on superclass `NSCollectionLayoutSupplementaryItem`.
1251impl NSCollectionLayoutBoundarySupplementaryItem {
1252    extern_methods!(
1253        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
1254        #[unsafe(method_family = none)]
1255        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
1256            layout_size: &NSCollectionLayoutSize,
1257            element_kind: &NSString,
1258            container_anchor: &NSCollectionLayoutAnchor,
1259        ) -> Retained<Self>;
1260
1261        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
1262        #[unsafe(method_family = none)]
1263        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
1264            layout_size: &NSCollectionLayoutSize,
1265            element_kind: &NSString,
1266            container_anchor: &NSCollectionLayoutAnchor,
1267            item_anchor: &NSCollectionLayoutAnchor,
1268        ) -> Retained<Self>;
1269    );
1270}
1271
1272/// Methods declared on superclass `NSCollectionLayoutItem`.
1273impl NSCollectionLayoutBoundarySupplementaryItem {
1274    extern_methods!(
1275        #[unsafe(method(itemWithLayoutSize:))]
1276        #[unsafe(method_family = none)]
1277        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1278
1279        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1280        #[unsafe(method_family = none)]
1281        pub unsafe fn itemWithLayoutSize_supplementaryItems(
1282            layout_size: &NSCollectionLayoutSize,
1283            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1284        ) -> Retained<Self>;
1285    );
1286}
1287
1288extern_class!(
1289    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutdecorationitem?language=objc)
1290    #[unsafe(super(NSCollectionLayoutItem, NSObject))]
1291    #[thread_kind = MainThreadOnly]
1292    #[derive(Debug, PartialEq, Eq, Hash)]
1293    pub struct NSCollectionLayoutDecorationItem;
1294);
1295
1296extern_conformance!(
1297    unsafe impl NSCopying for NSCollectionLayoutDecorationItem {}
1298);
1299
1300unsafe impl CopyingHelper for NSCollectionLayoutDecorationItem {
1301    type Result = Self;
1302}
1303
1304extern_conformance!(
1305    unsafe impl NSObjectProtocol for NSCollectionLayoutDecorationItem {}
1306);
1307
1308impl NSCollectionLayoutDecorationItem {
1309    extern_methods!(
1310        #[unsafe(method(backgroundDecorationItemWithElementKind:))]
1311        #[unsafe(method_family = none)]
1312        pub unsafe fn backgroundDecorationItemWithElementKind(
1313            element_kind: &NSString,
1314            mtm: MainThreadMarker,
1315        ) -> Retained<Self>;
1316
1317        #[unsafe(method(init))]
1318        #[unsafe(method_family = init)]
1319        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1320
1321        #[unsafe(method(new))]
1322        #[unsafe(method_family = new)]
1323        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1324
1325        #[unsafe(method(zIndex))]
1326        #[unsafe(method_family = none)]
1327        pub unsafe fn zIndex(&self) -> NSInteger;
1328
1329        /// Setter for [`zIndex`][Self::zIndex].
1330        #[unsafe(method(setZIndex:))]
1331        #[unsafe(method_family = none)]
1332        pub unsafe fn setZIndex(&self, z_index: NSInteger);
1333
1334        #[unsafe(method(elementKind))]
1335        #[unsafe(method_family = none)]
1336        pub unsafe fn elementKind(&self) -> Retained<NSString>;
1337    );
1338}
1339
1340/// Methods declared on superclass `NSCollectionLayoutItem`.
1341impl NSCollectionLayoutDecorationItem {
1342    extern_methods!(
1343        #[unsafe(method(itemWithLayoutSize:))]
1344        #[unsafe(method_family = none)]
1345        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1346
1347        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1348        #[unsafe(method_family = none)]
1349        pub unsafe fn itemWithLayoutSize_supplementaryItems(
1350            layout_size: &NSCollectionLayoutSize,
1351            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1352        ) -> Retained<Self>;
1353    );
1354}
1355
1356extern_class!(
1357    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutanchor?language=objc)
1358    #[unsafe(super(NSObject))]
1359    #[thread_kind = MainThreadOnly]
1360    #[derive(Debug, PartialEq, Eq, Hash)]
1361    pub struct NSCollectionLayoutAnchor;
1362);
1363
1364extern_conformance!(
1365    unsafe impl NSCopying for NSCollectionLayoutAnchor {}
1366);
1367
1368unsafe impl CopyingHelper for NSCollectionLayoutAnchor {
1369    type Result = Self;
1370}
1371
1372extern_conformance!(
1373    unsafe impl NSObjectProtocol for NSCollectionLayoutAnchor {}
1374);
1375
1376impl NSCollectionLayoutAnchor {
1377    extern_methods!(
1378        #[cfg(feature = "UIGeometry")]
1379        #[unsafe(method(layoutAnchorWithEdges:))]
1380        #[unsafe(method_family = none)]
1381        pub unsafe fn layoutAnchorWithEdges(
1382            edges: NSDirectionalRectEdge,
1383            mtm: MainThreadMarker,
1384        ) -> Retained<Self>;
1385
1386        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1387        #[unsafe(method(layoutAnchorWithEdges:absoluteOffset:))]
1388        #[unsafe(method_family = none)]
1389        pub unsafe fn layoutAnchorWithEdges_absoluteOffset(
1390            edges: NSDirectionalRectEdge,
1391            absolute_offset: CGPoint,
1392            mtm: MainThreadMarker,
1393        ) -> Retained<Self>;
1394
1395        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1396        #[unsafe(method(layoutAnchorWithEdges:fractionalOffset:))]
1397        #[unsafe(method_family = none)]
1398        pub unsafe fn layoutAnchorWithEdges_fractionalOffset(
1399            edges: NSDirectionalRectEdge,
1400            fractional_offset: CGPoint,
1401            mtm: MainThreadMarker,
1402        ) -> Retained<Self>;
1403
1404        #[unsafe(method(init))]
1405        #[unsafe(method_family = init)]
1406        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1407
1408        #[unsafe(method(new))]
1409        #[unsafe(method_family = new)]
1410        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1411
1412        #[cfg(feature = "UIGeometry")]
1413        #[unsafe(method(edges))]
1414        #[unsafe(method_family = none)]
1415        pub unsafe fn edges(&self) -> NSDirectionalRectEdge;
1416
1417        #[cfg(feature = "objc2-core-foundation")]
1418        #[unsafe(method(offset))]
1419        #[unsafe(method_family = none)]
1420        pub unsafe fn offset(&self) -> CGPoint;
1421
1422        #[unsafe(method(isAbsoluteOffset))]
1423        #[unsafe(method_family = none)]
1424        pub unsafe fn isAbsoluteOffset(&self) -> bool;
1425
1426        #[unsafe(method(isFractionalOffset))]
1427        #[unsafe(method_family = none)]
1428        pub unsafe fn isFractionalOffset(&self) -> bool;
1429    );
1430}
1431
1432extern_protocol!(
1433    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutcontainer?language=objc)
1434    pub unsafe trait NSCollectionLayoutContainer: NSObjectProtocol + MainThreadOnly {
1435        #[cfg(feature = "objc2-core-foundation")]
1436        #[unsafe(method(contentSize))]
1437        #[unsafe(method_family = none)]
1438        unsafe fn contentSize(&self) -> CGSize;
1439
1440        #[cfg(feature = "objc2-core-foundation")]
1441        #[unsafe(method(effectiveContentSize))]
1442        #[unsafe(method_family = none)]
1443        unsafe fn effectiveContentSize(&self) -> CGSize;
1444
1445        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1446        #[unsafe(method(contentInsets))]
1447        #[unsafe(method_family = none)]
1448        unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
1449
1450        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1451        #[unsafe(method(effectiveContentInsets))]
1452        #[unsafe(method_family = none)]
1453        unsafe fn effectiveContentInsets(&self) -> NSDirectionalEdgeInsets;
1454    }
1455);
1456
1457extern_protocol!(
1458    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutenvironment?language=objc)
1459    pub unsafe trait NSCollectionLayoutEnvironment:
1460        NSObjectProtocol + MainThreadOnly
1461    {
1462        #[unsafe(method(container))]
1463        #[unsafe(method_family = none)]
1464        unsafe fn container(&self) -> Retained<ProtocolObject<dyn NSCollectionLayoutContainer>>;
1465
1466        #[cfg(feature = "UITraitCollection")]
1467        #[unsafe(method(traitCollection))]
1468        #[unsafe(method_family = none)]
1469        unsafe fn traitCollection(&self) -> Retained<UITraitCollection>;
1470    }
1471);
1472
1473extern_protocol!(
1474    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscollectionlayoutvisibleitem?language=objc)
1475    #[cfg(feature = "UIDynamicBehavior")]
1476    pub unsafe trait NSCollectionLayoutVisibleItem:
1477        NSObjectProtocol + UIDynamicItem + MainThreadOnly
1478    {
1479        #[cfg(feature = "objc2-core-foundation")]
1480        #[unsafe(method(alpha))]
1481        #[unsafe(method_family = none)]
1482        unsafe fn alpha(&self) -> CGFloat;
1483
1484        #[cfg(feature = "objc2-core-foundation")]
1485        /// Setter for [`alpha`][Self::alpha].
1486        #[unsafe(method(setAlpha:))]
1487        #[unsafe(method_family = none)]
1488        unsafe fn setAlpha(&self, alpha: CGFloat);
1489
1490        #[unsafe(method(zIndex))]
1491        #[unsafe(method_family = none)]
1492        unsafe fn zIndex(&self) -> NSInteger;
1493
1494        /// Setter for [`zIndex`][Self::zIndex].
1495        #[unsafe(method(setZIndex:))]
1496        #[unsafe(method_family = none)]
1497        unsafe fn setZIndex(&self, z_index: NSInteger);
1498
1499        #[unsafe(method(isHidden))]
1500        #[unsafe(method_family = none)]
1501        unsafe fn isHidden(&self) -> bool;
1502
1503        /// Setter for [`isHidden`][Self::isHidden].
1504        #[unsafe(method(setHidden:))]
1505        #[unsafe(method_family = none)]
1506        unsafe fn setHidden(&self, hidden: bool);
1507
1508        #[cfg(feature = "objc2-core-foundation")]
1509        #[unsafe(method(center))]
1510        #[unsafe(method_family = none)]
1511        unsafe fn center(&self) -> CGPoint;
1512
1513        #[cfg(feature = "objc2-core-foundation")]
1514        /// Setter for [`center`][Self::center].
1515        #[unsafe(method(setCenter:))]
1516        #[unsafe(method_family = none)]
1517        unsafe fn setCenter(&self, center: CGPoint);
1518
1519        #[cfg(feature = "objc2-core-foundation")]
1520        #[unsafe(method(transform))]
1521        #[unsafe(method_family = none)]
1522        unsafe fn transform(&self) -> CGAffineTransform;
1523
1524        #[cfg(feature = "objc2-core-foundation")]
1525        /// Setter for [`transform`][Self::transform].
1526        #[unsafe(method(setTransform:))]
1527        #[unsafe(method_family = none)]
1528        unsafe fn setTransform(&self, transform: CGAffineTransform);
1529
1530        #[cfg(feature = "objc2-quartz-core")]
1531        #[cfg(not(target_os = "watchos"))]
1532        #[unsafe(method(transform3D))]
1533        #[unsafe(method_family = none)]
1534        unsafe fn transform3D(&self) -> CATransform3D;
1535
1536        #[cfg(feature = "objc2-quartz-core")]
1537        #[cfg(not(target_os = "watchos"))]
1538        /// Setter for [`transform3D`][Self::transform3D].
1539        #[unsafe(method(setTransform3D:))]
1540        #[unsafe(method_family = none)]
1541        unsafe fn setTransform3D(&self, transform3_d: CATransform3D);
1542
1543        #[unsafe(method(name))]
1544        #[unsafe(method_family = none)]
1545        unsafe fn name(&self) -> Retained<NSString>;
1546
1547        #[unsafe(method(indexPath))]
1548        #[unsafe(method_family = none)]
1549        unsafe fn indexPath(&self) -> Retained<NSIndexPath>;
1550
1551        #[cfg(feature = "objc2-core-foundation")]
1552        #[unsafe(method(frame))]
1553        #[unsafe(method_family = none)]
1554        unsafe fn frame(&self) -> CGRect;
1555
1556        #[cfg(feature = "objc2-core-foundation")]
1557        #[unsafe(method(bounds))]
1558        #[unsafe(method_family = none)]
1559        unsafe fn bounds(&self) -> CGRect;
1560
1561        #[cfg(feature = "UICollectionViewLayout")]
1562        #[unsafe(method(representedElementCategory))]
1563        #[unsafe(method_family = none)]
1564        unsafe fn representedElementCategory(&self) -> UICollectionElementCategory;
1565
1566        #[unsafe(method(representedElementKind))]
1567        #[unsafe(method_family = none)]
1568        unsafe fn representedElementKind(&self) -> Option<Retained<NSString>>;
1569    }
1570);
1571
1572/// Deprecated.
1573impl NSCollectionLayoutSection {
1574    extern_methods!(
1575        #[deprecated]
1576        #[unsafe(method(supplementariesFollowContentInsets))]
1577        #[unsafe(method_family = none)]
1578        pub unsafe fn supplementariesFollowContentInsets(&self) -> bool;
1579
1580        /// Setter for [`supplementariesFollowContentInsets`][Self::supplementariesFollowContentInsets].
1581        #[deprecated]
1582        #[unsafe(method(setSupplementariesFollowContentInsets:))]
1583        #[unsafe(method_family = none)]
1584        pub unsafe fn setSupplementariesFollowContentInsets(
1585            &self,
1586            supplementaries_follow_content_insets: bool,
1587        );
1588    );
1589}
1590
1591/// Deprecated.
1592impl NSCollectionLayoutGroup {
1593    extern_methods!(
1594        #[deprecated]
1595        #[unsafe(method(horizontalGroupWithLayoutSize:subitem:count:))]
1596        #[unsafe(method_family = none)]
1597        pub unsafe fn horizontalGroupWithLayoutSize_subitem_count(
1598            layout_size: &NSCollectionLayoutSize,
1599            subitem: &NSCollectionLayoutItem,
1600            count: NSInteger,
1601        ) -> Retained<Self>;
1602
1603        #[deprecated]
1604        #[unsafe(method(verticalGroupWithLayoutSize:subitem:count:))]
1605        #[unsafe(method_family = none)]
1606        pub unsafe fn verticalGroupWithLayoutSize_subitem_count(
1607            layout_size: &NSCollectionLayoutSize,
1608            subitem: &NSCollectionLayoutItem,
1609            count: NSInteger,
1610        ) -> Retained<Self>;
1611    );
1612}