objc2_app_kit/generated/
NSCollectionViewCompositionalLayout.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
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdirectionalrectedge?language=objc)
13// NS_OPTIONS
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSDirectionalRectEdge(pub NSUInteger);
17bitflags::bitflags! {
18    impl NSDirectionalRectEdge: NSUInteger {
19        #[doc(alias = "NSDirectionalRectEdgeNone")]
20        const None = 0;
21        #[doc(alias = "NSDirectionalRectEdgeTop")]
22        const Top = 1<<0;
23        #[doc(alias = "NSDirectionalRectEdgeLeading")]
24        const Leading = 1<<1;
25        #[doc(alias = "NSDirectionalRectEdgeBottom")]
26        const Bottom = 1<<2;
27        #[doc(alias = "NSDirectionalRectEdgeTrailing")]
28        const Trailing = 1<<3;
29        #[doc(alias = "NSDirectionalRectEdgeAll")]
30        const All = NSDirectionalRectEdge::Top.0|NSDirectionalRectEdge::Leading.0|NSDirectionalRectEdge::Bottom.0|NSDirectionalRectEdge::Trailing.0;
31    }
32}
33
34unsafe impl Encode for NSDirectionalRectEdge {
35    const ENCODING: Encoding = NSUInteger::ENCODING;
36}
37
38unsafe impl RefEncode for NSDirectionalRectEdge {
39    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdirectionaledgeinsets?language=objc)
43#[cfg(feature = "objc2-core-foundation")]
44#[repr(C)]
45#[derive(Clone, Copy, Debug, PartialEq)]
46pub struct NSDirectionalEdgeInsets {
47    pub top: CGFloat,
48    pub leading: CGFloat,
49    pub bottom: CGFloat,
50    pub trailing: CGFloat,
51}
52
53#[cfg(feature = "objc2-core-foundation")]
54unsafe impl Encode for NSDirectionalEdgeInsets {
55    const ENCODING: Encoding = Encoding::Struct(
56        "NSDirectionalEdgeInsets",
57        &[
58            <CGFloat>::ENCODING,
59            <CGFloat>::ENCODING,
60            <CGFloat>::ENCODING,
61            <CGFloat>::ENCODING,
62        ],
63    );
64}
65
66#[cfg(feature = "objc2-core-foundation")]
67unsafe impl RefEncode for NSDirectionalEdgeInsets {
68    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
69}
70
71#[cfg(feature = "objc2-core-foundation")]
72unsafe impl Send for NSDirectionalEdgeInsets {}
73
74#[cfg(feature = "objc2-core-foundation")]
75unsafe impl Sync for NSDirectionalEdgeInsets {}
76
77extern "C" {
78    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdirectionaledgeinsetszero?language=objc)
79    #[cfg(feature = "objc2-core-foundation")]
80    pub static NSDirectionalEdgeInsetsZero: NSDirectionalEdgeInsets;
81}
82
83/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrectalignment?language=objc)
84// NS_ENUM
85#[repr(transparent)]
86#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
87pub struct NSRectAlignment(pub NSInteger);
88impl NSRectAlignment {
89    #[doc(alias = "NSRectAlignmentNone")]
90    pub const None: Self = Self(0);
91    #[doc(alias = "NSRectAlignmentTop")]
92    pub const Top: Self = Self(1);
93    #[doc(alias = "NSRectAlignmentTopLeading")]
94    pub const TopLeading: Self = Self(2);
95    #[doc(alias = "NSRectAlignmentLeading")]
96    pub const Leading: Self = Self(3);
97    #[doc(alias = "NSRectAlignmentBottomLeading")]
98    pub const BottomLeading: Self = Self(4);
99    #[doc(alias = "NSRectAlignmentBottom")]
100    pub const Bottom: Self = Self(5);
101    #[doc(alias = "NSRectAlignmentBottomTrailing")]
102    pub const BottomTrailing: Self = Self(6);
103    #[doc(alias = "NSRectAlignmentTrailing")]
104    pub const Trailing: Self = Self(7);
105    #[doc(alias = "NSRectAlignmentTopTrailing")]
106    pub const TopTrailing: Self = Self(8);
107}
108
109unsafe impl Encode for NSRectAlignment {
110    const ENCODING: Encoding = NSInteger::ENCODING;
111}
112
113unsafe impl RefEncode for NSRectAlignment {
114    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
115}
116
117#[cfg(feature = "objc2-core-foundation")]
118impl NSDirectionalEdgeInsets {
119    // TODO: pub fn NSDirectionalEdgeInsetsMake(top: CGFloat,leading: CGFloat,bottom: CGFloat,trailing: CGFloat,) -> NSDirectionalEdgeInsets;
120}
121
122extern_class!(
123    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionviewcompositionallayoutconfiguration?language=objc)
124    #[unsafe(super(NSObject))]
125    #[thread_kind = MainThreadOnly]
126    #[derive(Debug, PartialEq, Eq, Hash)]
127    pub struct NSCollectionViewCompositionalLayoutConfiguration;
128);
129
130extern_conformance!(
131    unsafe impl NSCopying for NSCollectionViewCompositionalLayoutConfiguration {}
132);
133
134unsafe impl CopyingHelper for NSCollectionViewCompositionalLayoutConfiguration {
135    type Result = Self;
136}
137
138extern_conformance!(
139    unsafe impl NSObjectProtocol for NSCollectionViewCompositionalLayoutConfiguration {}
140);
141
142impl NSCollectionViewCompositionalLayoutConfiguration {
143    extern_methods!(
144        #[cfg(feature = "NSCollectionViewFlowLayout")]
145        #[unsafe(method(scrollDirection))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn scrollDirection(&self) -> NSCollectionViewScrollDirection;
148
149        #[cfg(feature = "NSCollectionViewFlowLayout")]
150        /// Setter for [`scrollDirection`][Self::scrollDirection].
151        #[unsafe(method(setScrollDirection:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setScrollDirection(&self, scroll_direction: NSCollectionViewScrollDirection);
154
155        #[cfg(feature = "objc2-core-foundation")]
156        #[unsafe(method(interSectionSpacing))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn interSectionSpacing(&self) -> CGFloat;
159
160        #[cfg(feature = "objc2-core-foundation")]
161        /// Setter for [`interSectionSpacing`][Self::interSectionSpacing].
162        #[unsafe(method(setInterSectionSpacing:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn setInterSectionSpacing(&self, inter_section_spacing: CGFloat);
165
166        #[unsafe(method(boundarySupplementaryItems))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn boundarySupplementaryItems(
169            &self,
170        ) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
171
172        /// Setter for [`boundarySupplementaryItems`][Self::boundarySupplementaryItems].
173        #[unsafe(method(setBoundarySupplementaryItems:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setBoundarySupplementaryItems(
176            &self,
177            boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
178        );
179    );
180}
181
182/// Methods declared on superclass `NSObject`.
183impl NSCollectionViewCompositionalLayoutConfiguration {
184    extern_methods!(
185        #[unsafe(method(init))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189        #[unsafe(method(new))]
190        #[unsafe(method_family = new)]
191        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
192    );
193}
194
195/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionviewcompositionallayoutsectionprovider?language=objc)
196#[cfg(feature = "block2")]
197pub type NSCollectionViewCompositionalLayoutSectionProvider = *mut block2::DynBlock<
198    dyn Fn(
199        NSInteger,
200        NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
201    ) -> *mut NSCollectionLayoutSection,
202>;
203
204extern_class!(
205    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionviewcompositionallayout?language=objc)
206    #[unsafe(super(NSCollectionViewLayout, NSObject))]
207    #[derive(Debug, PartialEq, Eq, Hash)]
208    #[cfg(feature = "NSCollectionViewLayout")]
209    pub struct NSCollectionViewCompositionalLayout;
210);
211
212#[cfg(feature = "NSCollectionViewLayout")]
213extern_conformance!(
214    unsafe impl NSCoding for NSCollectionViewCompositionalLayout {}
215);
216
217#[cfg(feature = "NSCollectionViewLayout")]
218extern_conformance!(
219    unsafe impl NSObjectProtocol for NSCollectionViewCompositionalLayout {}
220);
221
222#[cfg(feature = "NSCollectionViewLayout")]
223impl NSCollectionViewCompositionalLayout {
224    extern_methods!(
225        #[unsafe(method(initWithSection:))]
226        #[unsafe(method_family = init)]
227        pub unsafe fn initWithSection(
228            this: Allocated<Self>,
229            section: &NSCollectionLayoutSection,
230        ) -> Retained<Self>;
231
232        #[unsafe(method(initWithSection:configuration:))]
233        #[unsafe(method_family = init)]
234        pub unsafe fn initWithSection_configuration(
235            this: Allocated<Self>,
236            section: &NSCollectionLayoutSection,
237            configuration: &NSCollectionViewCompositionalLayoutConfiguration,
238        ) -> Retained<Self>;
239
240        #[cfg(feature = "block2")]
241        #[unsafe(method(initWithSectionProvider:))]
242        #[unsafe(method_family = init)]
243        pub unsafe fn initWithSectionProvider(
244            this: Allocated<Self>,
245            section_provider: NSCollectionViewCompositionalLayoutSectionProvider,
246        ) -> Retained<Self>;
247
248        #[cfg(feature = "block2")]
249        #[unsafe(method(initWithSectionProvider:configuration:))]
250        #[unsafe(method_family = init)]
251        pub unsafe fn initWithSectionProvider_configuration(
252            this: Allocated<Self>,
253            section_provider: NSCollectionViewCompositionalLayoutSectionProvider,
254            configuration: &NSCollectionViewCompositionalLayoutConfiguration,
255        ) -> Retained<Self>;
256
257        #[unsafe(method(init))]
258        #[unsafe(method_family = init)]
259        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
260
261        #[unsafe(method(new))]
262        #[unsafe(method_family = new)]
263        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
264
265        #[unsafe(method(configuration))]
266        #[unsafe(method_family = none)]
267        pub unsafe fn configuration(
268            &self,
269        ) -> Retained<NSCollectionViewCompositionalLayoutConfiguration>;
270
271        /// Setter for [`configuration`][Self::configuration].
272        #[unsafe(method(setConfiguration:))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn setConfiguration(
275            &self,
276            configuration: &NSCollectionViewCompositionalLayoutConfiguration,
277        );
278    );
279}
280
281/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutsectionorthogonalscrollingbehavior?language=objc)
282// NS_ENUM
283#[repr(transparent)]
284#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
285pub struct NSCollectionLayoutSectionOrthogonalScrollingBehavior(pub NSInteger);
286impl NSCollectionLayoutSectionOrthogonalScrollingBehavior {
287    #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorNone")]
288    pub const None: Self = Self(0);
289    #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuous")]
290    pub const Continuous: Self = Self(1);
291    #[doc(
292        alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary"
293    )]
294    pub const ContinuousGroupLeadingBoundary: Self = Self(2);
295    #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorPaging")]
296    pub const Paging: Self = Self(3);
297    #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging")]
298    pub const GroupPaging: Self = Self(4);
299    #[doc(alias = "NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered")]
300    pub const GroupPagingCentered: Self = Self(5);
301}
302
303unsafe impl Encode for NSCollectionLayoutSectionOrthogonalScrollingBehavior {
304    const ENCODING: Encoding = NSInteger::ENCODING;
305}
306
307unsafe impl RefEncode for NSCollectionLayoutSectionOrthogonalScrollingBehavior {
308    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
309}
310
311/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutsectionvisibleitemsinvalidationhandler?language=objc)
312#[cfg(feature = "block2")]
313pub type NSCollectionLayoutSectionVisibleItemsInvalidationHandler = *mut block2::DynBlock<
314    dyn Fn(
315        NonNull<NSArray<ProtocolObject<dyn NSCollectionLayoutVisibleItem>>>,
316        NSPoint,
317        NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
318    ),
319>;
320
321extern_class!(
322    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutsection?language=objc)
323    #[unsafe(super(NSObject))]
324    #[thread_kind = MainThreadOnly]
325    #[derive(Debug, PartialEq, Eq, Hash)]
326    pub struct NSCollectionLayoutSection;
327);
328
329extern_conformance!(
330    unsafe impl NSCopying for NSCollectionLayoutSection {}
331);
332
333unsafe impl CopyingHelper for NSCollectionLayoutSection {
334    type Result = Self;
335}
336
337extern_conformance!(
338    unsafe impl NSObjectProtocol for NSCollectionLayoutSection {}
339);
340
341impl NSCollectionLayoutSection {
342    extern_methods!(
343        #[unsafe(method(sectionWithGroup:))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn sectionWithGroup(group: &NSCollectionLayoutGroup) -> Retained<Self>;
346
347        #[unsafe(method(init))]
348        #[unsafe(method_family = init)]
349        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
350
351        #[unsafe(method(new))]
352        #[unsafe(method_family = new)]
353        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
354
355        #[cfg(feature = "objc2-core-foundation")]
356        #[unsafe(method(contentInsets))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
359
360        #[cfg(feature = "objc2-core-foundation")]
361        /// Setter for [`contentInsets`][Self::contentInsets].
362        #[unsafe(method(setContentInsets:))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
365
366        #[cfg(feature = "objc2-core-foundation")]
367        #[unsafe(method(interGroupSpacing))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn interGroupSpacing(&self) -> CGFloat;
370
371        #[cfg(feature = "objc2-core-foundation")]
372        /// Setter for [`interGroupSpacing`][Self::interGroupSpacing].
373        #[unsafe(method(setInterGroupSpacing:))]
374        #[unsafe(method_family = none)]
375        pub unsafe fn setInterGroupSpacing(&self, inter_group_spacing: CGFloat);
376
377        #[unsafe(method(orthogonalScrollingBehavior))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn orthogonalScrollingBehavior(
380            &self,
381        ) -> NSCollectionLayoutSectionOrthogonalScrollingBehavior;
382
383        /// Setter for [`orthogonalScrollingBehavior`][Self::orthogonalScrollingBehavior].
384        #[unsafe(method(setOrthogonalScrollingBehavior:))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn setOrthogonalScrollingBehavior(
387            &self,
388            orthogonal_scrolling_behavior: NSCollectionLayoutSectionOrthogonalScrollingBehavior,
389        );
390
391        #[unsafe(method(boundarySupplementaryItems))]
392        #[unsafe(method_family = none)]
393        pub unsafe fn boundarySupplementaryItems(
394            &self,
395        ) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
396
397        /// Setter for [`boundarySupplementaryItems`][Self::boundarySupplementaryItems].
398        #[unsafe(method(setBoundarySupplementaryItems:))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn setBoundarySupplementaryItems(
401            &self,
402            boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
403        );
404
405        #[unsafe(method(supplementariesFollowContentInsets))]
406        #[unsafe(method_family = none)]
407        pub unsafe fn supplementariesFollowContentInsets(&self) -> bool;
408
409        /// Setter for [`supplementariesFollowContentInsets`][Self::supplementariesFollowContentInsets].
410        #[unsafe(method(setSupplementariesFollowContentInsets:))]
411        #[unsafe(method_family = none)]
412        pub unsafe fn setSupplementariesFollowContentInsets(
413            &self,
414            supplementaries_follow_content_insets: bool,
415        );
416
417        #[cfg(feature = "block2")]
418        #[unsafe(method(visibleItemsInvalidationHandler))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn visibleItemsInvalidationHandler(
421            &self,
422        ) -> NSCollectionLayoutSectionVisibleItemsInvalidationHandler;
423
424        #[cfg(feature = "block2")]
425        /// Setter for [`visibleItemsInvalidationHandler`][Self::visibleItemsInvalidationHandler].
426        #[unsafe(method(setVisibleItemsInvalidationHandler:))]
427        #[unsafe(method_family = none)]
428        pub unsafe fn setVisibleItemsInvalidationHandler(
429            &self,
430            visible_items_invalidation_handler: NSCollectionLayoutSectionVisibleItemsInvalidationHandler,
431        );
432
433        #[unsafe(method(decorationItems))]
434        #[unsafe(method_family = none)]
435        pub unsafe fn decorationItems(&self)
436            -> Retained<NSArray<NSCollectionLayoutDecorationItem>>;
437
438        /// Setter for [`decorationItems`][Self::decorationItems].
439        #[unsafe(method(setDecorationItems:))]
440        #[unsafe(method_family = none)]
441        pub unsafe fn setDecorationItems(
442            &self,
443            decoration_items: &NSArray<NSCollectionLayoutDecorationItem>,
444        );
445    );
446}
447
448extern_class!(
449    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutitem?language=objc)
450    #[unsafe(super(NSObject))]
451    #[thread_kind = MainThreadOnly]
452    #[derive(Debug, PartialEq, Eq, Hash)]
453    pub struct NSCollectionLayoutItem;
454);
455
456extern_conformance!(
457    unsafe impl NSCopying for NSCollectionLayoutItem {}
458);
459
460unsafe impl CopyingHelper for NSCollectionLayoutItem {
461    type Result = Self;
462}
463
464extern_conformance!(
465    unsafe impl NSObjectProtocol for NSCollectionLayoutItem {}
466);
467
468impl NSCollectionLayoutItem {
469    extern_methods!(
470        #[unsafe(method(itemWithLayoutSize:))]
471        #[unsafe(method_family = none)]
472        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
473
474        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
475        #[unsafe(method_family = none)]
476        pub unsafe fn itemWithLayoutSize_supplementaryItems(
477            layout_size: &NSCollectionLayoutSize,
478            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
479        ) -> Retained<Self>;
480
481        #[unsafe(method(init))]
482        #[unsafe(method_family = init)]
483        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
484
485        #[unsafe(method(new))]
486        #[unsafe(method_family = new)]
487        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
488
489        #[cfg(feature = "objc2-core-foundation")]
490        #[unsafe(method(contentInsets))]
491        #[unsafe(method_family = none)]
492        pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
493
494        #[cfg(feature = "objc2-core-foundation")]
495        /// Setter for [`contentInsets`][Self::contentInsets].
496        #[unsafe(method(setContentInsets:))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
499
500        #[unsafe(method(edgeSpacing))]
501        #[unsafe(method_family = none)]
502        pub unsafe fn edgeSpacing(&self) -> Option<Retained<NSCollectionLayoutEdgeSpacing>>;
503
504        /// Setter for [`edgeSpacing`][Self::edgeSpacing].
505        #[unsafe(method(setEdgeSpacing:))]
506        #[unsafe(method_family = none)]
507        pub unsafe fn setEdgeSpacing(&self, edge_spacing: Option<&NSCollectionLayoutEdgeSpacing>);
508
509        #[unsafe(method(layoutSize))]
510        #[unsafe(method_family = none)]
511        pub unsafe fn layoutSize(&self) -> Retained<NSCollectionLayoutSize>;
512
513        #[unsafe(method(supplementaryItems))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn supplementaryItems(
516            &self,
517        ) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
518    );
519}
520
521extern_class!(
522    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutgroupcustomitem?language=objc)
523    #[unsafe(super(NSObject))]
524    #[thread_kind = MainThreadOnly]
525    #[derive(Debug, PartialEq, Eq, Hash)]
526    pub struct NSCollectionLayoutGroupCustomItem;
527);
528
529extern_conformance!(
530    unsafe impl NSCopying for NSCollectionLayoutGroupCustomItem {}
531);
532
533unsafe impl CopyingHelper for NSCollectionLayoutGroupCustomItem {
534    type Result = Self;
535}
536
537extern_conformance!(
538    unsafe impl NSObjectProtocol for NSCollectionLayoutGroupCustomItem {}
539);
540
541impl NSCollectionLayoutGroupCustomItem {
542    extern_methods!(
543        #[unsafe(method(customItemWithFrame:))]
544        #[unsafe(method_family = none)]
545        pub unsafe fn customItemWithFrame(frame: NSRect, mtm: MainThreadMarker) -> Retained<Self>;
546
547        #[unsafe(method(customItemWithFrame:zIndex:))]
548        #[unsafe(method_family = none)]
549        pub unsafe fn customItemWithFrame_zIndex(
550            frame: NSRect,
551            z_index: NSInteger,
552            mtm: MainThreadMarker,
553        ) -> Retained<Self>;
554
555        #[unsafe(method(init))]
556        #[unsafe(method_family = init)]
557        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
558
559        #[unsafe(method(new))]
560        #[unsafe(method_family = new)]
561        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
562
563        #[unsafe(method(frame))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn frame(&self) -> NSRect;
566
567        #[unsafe(method(zIndex))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn zIndex(&self) -> NSInteger;
570    );
571}
572
573/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutgroupcustomitemprovider?language=objc)
574#[cfg(feature = "block2")]
575pub type NSCollectionLayoutGroupCustomItemProvider = *mut block2::DynBlock<
576    dyn Fn(
577        NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
578    ) -> NonNull<NSArray<NSCollectionLayoutGroupCustomItem>>,
579>;
580
581extern_class!(
582    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutgroup?language=objc)
583    #[unsafe(super(NSCollectionLayoutItem, NSObject))]
584    #[derive(Debug, PartialEq, Eq, Hash)]
585    pub struct NSCollectionLayoutGroup;
586);
587
588extern_conformance!(
589    unsafe impl NSCopying for NSCollectionLayoutGroup {}
590);
591
592unsafe impl CopyingHelper for NSCollectionLayoutGroup {
593    type Result = Self;
594}
595
596extern_conformance!(
597    unsafe impl NSObjectProtocol for NSCollectionLayoutGroup {}
598);
599
600impl NSCollectionLayoutGroup {
601    extern_methods!(
602        #[unsafe(method(horizontalGroupWithLayoutSize:subitem:count:))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn horizontalGroupWithLayoutSize_subitem_count(
605            layout_size: &NSCollectionLayoutSize,
606            subitem: &NSCollectionLayoutItem,
607            count: NSInteger,
608        ) -> Retained<Self>;
609
610        #[unsafe(method(horizontalGroupWithLayoutSize:subitems:))]
611        #[unsafe(method_family = none)]
612        pub unsafe fn horizontalGroupWithLayoutSize_subitems(
613            layout_size: &NSCollectionLayoutSize,
614            subitems: &NSArray<NSCollectionLayoutItem>,
615        ) -> Retained<Self>;
616
617        #[unsafe(method(verticalGroupWithLayoutSize:subitem:count:))]
618        #[unsafe(method_family = none)]
619        pub unsafe fn verticalGroupWithLayoutSize_subitem_count(
620            layout_size: &NSCollectionLayoutSize,
621            subitem: &NSCollectionLayoutItem,
622            count: NSInteger,
623        ) -> Retained<Self>;
624
625        #[unsafe(method(verticalGroupWithLayoutSize:subitems:))]
626        #[unsafe(method_family = none)]
627        pub unsafe fn verticalGroupWithLayoutSize_subitems(
628            layout_size: &NSCollectionLayoutSize,
629            subitems: &NSArray<NSCollectionLayoutItem>,
630        ) -> Retained<Self>;
631
632        #[cfg(feature = "block2")]
633        #[unsafe(method(customGroupWithLayoutSize:itemProvider:))]
634        #[unsafe(method_family = none)]
635        pub unsafe fn customGroupWithLayoutSize_itemProvider(
636            layout_size: &NSCollectionLayoutSize,
637            item_provider: NSCollectionLayoutGroupCustomItemProvider,
638        ) -> Retained<Self>;
639
640        #[unsafe(method(init))]
641        #[unsafe(method_family = init)]
642        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
643
644        #[unsafe(method(new))]
645        #[unsafe(method_family = new)]
646        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
647
648        #[unsafe(method(supplementaryItems))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn supplementaryItems(
651            &self,
652        ) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
653
654        /// Setter for [`supplementaryItems`][Self::supplementaryItems].
655        #[unsafe(method(setSupplementaryItems:))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn setSupplementaryItems(
658            &self,
659            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
660        );
661
662        #[unsafe(method(interItemSpacing))]
663        #[unsafe(method_family = none)]
664        pub unsafe fn interItemSpacing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
665
666        /// Setter for [`interItemSpacing`][Self::interItemSpacing].
667        #[unsafe(method(setInterItemSpacing:))]
668        #[unsafe(method_family = none)]
669        pub unsafe fn setInterItemSpacing(
670            &self,
671            inter_item_spacing: Option<&NSCollectionLayoutSpacing>,
672        );
673
674        #[unsafe(method(subitems))]
675        #[unsafe(method_family = none)]
676        pub unsafe fn subitems(&self) -> Retained<NSArray<NSCollectionLayoutItem>>;
677
678        #[unsafe(method(visualDescription))]
679        #[unsafe(method_family = none)]
680        pub unsafe fn visualDescription(&self) -> Retained<NSString>;
681    );
682}
683
684/// Methods declared on superclass `NSCollectionLayoutItem`.
685impl NSCollectionLayoutGroup {
686    extern_methods!(
687        #[unsafe(method(itemWithLayoutSize:))]
688        #[unsafe(method_family = none)]
689        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
690
691        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn itemWithLayoutSize_supplementaryItems(
694            layout_size: &NSCollectionLayoutSize,
695            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
696        ) -> Retained<Self>;
697    );
698}
699
700extern_class!(
701    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutdimension?language=objc)
702    #[unsafe(super(NSObject))]
703    #[thread_kind = MainThreadOnly]
704    #[derive(Debug, PartialEq, Eq, Hash)]
705    pub struct NSCollectionLayoutDimension;
706);
707
708extern_conformance!(
709    unsafe impl NSCopying for NSCollectionLayoutDimension {}
710);
711
712unsafe impl CopyingHelper for NSCollectionLayoutDimension {
713    type Result = Self;
714}
715
716extern_conformance!(
717    unsafe impl NSObjectProtocol for NSCollectionLayoutDimension {}
718);
719
720impl NSCollectionLayoutDimension {
721    extern_methods!(
722        #[cfg(feature = "objc2-core-foundation")]
723        #[unsafe(method(fractionalWidthDimension:))]
724        #[unsafe(method_family = none)]
725        pub unsafe fn fractionalWidthDimension(
726            fractional_width: CGFloat,
727            mtm: MainThreadMarker,
728        ) -> Retained<Self>;
729
730        #[cfg(feature = "objc2-core-foundation")]
731        #[unsafe(method(fractionalHeightDimension:))]
732        #[unsafe(method_family = none)]
733        pub unsafe fn fractionalHeightDimension(
734            fractional_height: CGFloat,
735            mtm: MainThreadMarker,
736        ) -> Retained<Self>;
737
738        #[cfg(feature = "objc2-core-foundation")]
739        #[unsafe(method(absoluteDimension:))]
740        #[unsafe(method_family = none)]
741        pub unsafe fn absoluteDimension(
742            absolute_dimension: CGFloat,
743            mtm: MainThreadMarker,
744        ) -> Retained<Self>;
745
746        #[cfg(feature = "objc2-core-foundation")]
747        #[unsafe(method(estimatedDimension:))]
748        #[unsafe(method_family = none)]
749        pub unsafe fn estimatedDimension(
750            estimated_dimension: CGFloat,
751            mtm: MainThreadMarker,
752        ) -> Retained<Self>;
753
754        #[unsafe(method(init))]
755        #[unsafe(method_family = init)]
756        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
757
758        #[unsafe(method(new))]
759        #[unsafe(method_family = new)]
760        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
761
762        #[unsafe(method(isFractionalWidth))]
763        #[unsafe(method_family = none)]
764        pub unsafe fn isFractionalWidth(&self) -> bool;
765
766        #[unsafe(method(isFractionalHeight))]
767        #[unsafe(method_family = none)]
768        pub unsafe fn isFractionalHeight(&self) -> bool;
769
770        #[unsafe(method(isAbsolute))]
771        #[unsafe(method_family = none)]
772        pub unsafe fn isAbsolute(&self) -> bool;
773
774        #[unsafe(method(isEstimated))]
775        #[unsafe(method_family = none)]
776        pub unsafe fn isEstimated(&self) -> bool;
777
778        #[cfg(feature = "objc2-core-foundation")]
779        #[unsafe(method(dimension))]
780        #[unsafe(method_family = none)]
781        pub unsafe fn dimension(&self) -> CGFloat;
782    );
783}
784
785extern_class!(
786    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutsize?language=objc)
787    #[unsafe(super(NSObject))]
788    #[thread_kind = MainThreadOnly]
789    #[derive(Debug, PartialEq, Eq, Hash)]
790    pub struct NSCollectionLayoutSize;
791);
792
793extern_conformance!(
794    unsafe impl NSCopying for NSCollectionLayoutSize {}
795);
796
797unsafe impl CopyingHelper for NSCollectionLayoutSize {
798    type Result = Self;
799}
800
801extern_conformance!(
802    unsafe impl NSObjectProtocol for NSCollectionLayoutSize {}
803);
804
805impl NSCollectionLayoutSize {
806    extern_methods!(
807        #[unsafe(method(sizeWithWidthDimension:heightDimension:))]
808        #[unsafe(method_family = none)]
809        pub unsafe fn sizeWithWidthDimension_heightDimension(
810            width: &NSCollectionLayoutDimension,
811            height: &NSCollectionLayoutDimension,
812        ) -> Retained<Self>;
813
814        #[unsafe(method(init))]
815        #[unsafe(method_family = init)]
816        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
817
818        #[unsafe(method(new))]
819        #[unsafe(method_family = new)]
820        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
821
822        #[unsafe(method(widthDimension))]
823        #[unsafe(method_family = none)]
824        pub unsafe fn widthDimension(&self) -> Retained<NSCollectionLayoutDimension>;
825
826        #[unsafe(method(heightDimension))]
827        #[unsafe(method_family = none)]
828        pub unsafe fn heightDimension(&self) -> Retained<NSCollectionLayoutDimension>;
829    );
830}
831
832extern_class!(
833    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutspacing?language=objc)
834    #[unsafe(super(NSObject))]
835    #[thread_kind = MainThreadOnly]
836    #[derive(Debug, PartialEq, Eq, Hash)]
837    pub struct NSCollectionLayoutSpacing;
838);
839
840extern_conformance!(
841    unsafe impl NSCopying for NSCollectionLayoutSpacing {}
842);
843
844unsafe impl CopyingHelper for NSCollectionLayoutSpacing {
845    type Result = Self;
846}
847
848extern_conformance!(
849    unsafe impl NSObjectProtocol for NSCollectionLayoutSpacing {}
850);
851
852impl NSCollectionLayoutSpacing {
853    extern_methods!(
854        #[cfg(feature = "objc2-core-foundation")]
855        #[unsafe(method(flexibleSpacing:))]
856        #[unsafe(method_family = none)]
857        pub unsafe fn flexibleSpacing(
858            flexible_spacing: CGFloat,
859            mtm: MainThreadMarker,
860        ) -> Retained<Self>;
861
862        #[cfg(feature = "objc2-core-foundation")]
863        #[unsafe(method(fixedSpacing:))]
864        #[unsafe(method_family = none)]
865        pub unsafe fn fixedSpacing(fixed_spacing: CGFloat, mtm: MainThreadMarker)
866            -> Retained<Self>;
867
868        #[unsafe(method(init))]
869        #[unsafe(method_family = init)]
870        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
871
872        #[unsafe(method(new))]
873        #[unsafe(method_family = new)]
874        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
875
876        #[cfg(feature = "objc2-core-foundation")]
877        #[unsafe(method(spacing))]
878        #[unsafe(method_family = none)]
879        pub unsafe fn spacing(&self) -> CGFloat;
880
881        #[unsafe(method(isFlexibleSpacing))]
882        #[unsafe(method_family = none)]
883        pub unsafe fn isFlexibleSpacing(&self) -> bool;
884
885        #[unsafe(method(isFixedSpacing))]
886        #[unsafe(method_family = none)]
887        pub unsafe fn isFixedSpacing(&self) -> bool;
888    );
889}
890
891extern_class!(
892    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutedgespacing?language=objc)
893    #[unsafe(super(NSObject))]
894    #[thread_kind = MainThreadOnly]
895    #[derive(Debug, PartialEq, Eq, Hash)]
896    pub struct NSCollectionLayoutEdgeSpacing;
897);
898
899extern_conformance!(
900    unsafe impl NSCopying for NSCollectionLayoutEdgeSpacing {}
901);
902
903unsafe impl CopyingHelper for NSCollectionLayoutEdgeSpacing {
904    type Result = Self;
905}
906
907extern_conformance!(
908    unsafe impl NSObjectProtocol for NSCollectionLayoutEdgeSpacing {}
909);
910
911impl NSCollectionLayoutEdgeSpacing {
912    extern_methods!(
913        #[unsafe(method(spacingForLeading:top:trailing:bottom:))]
914        #[unsafe(method_family = none)]
915        pub unsafe fn spacingForLeading_top_trailing_bottom(
916            leading: Option<&NSCollectionLayoutSpacing>,
917            top: Option<&NSCollectionLayoutSpacing>,
918            trailing: Option<&NSCollectionLayoutSpacing>,
919            bottom: Option<&NSCollectionLayoutSpacing>,
920            mtm: MainThreadMarker,
921        ) -> Retained<Self>;
922
923        #[unsafe(method(init))]
924        #[unsafe(method_family = init)]
925        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
926
927        #[unsafe(method(new))]
928        #[unsafe(method_family = new)]
929        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
930
931        #[unsafe(method(leading))]
932        #[unsafe(method_family = none)]
933        pub unsafe fn leading(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
934
935        #[unsafe(method(top))]
936        #[unsafe(method_family = none)]
937        pub unsafe fn top(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
938
939        #[unsafe(method(trailing))]
940        #[unsafe(method_family = none)]
941        pub unsafe fn trailing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
942
943        #[unsafe(method(bottom))]
944        #[unsafe(method_family = none)]
945        pub unsafe fn bottom(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
946    );
947}
948
949extern_class!(
950    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutsupplementaryitem?language=objc)
951    #[unsafe(super(NSCollectionLayoutItem, NSObject))]
952    #[derive(Debug, PartialEq, Eq, Hash)]
953    pub struct NSCollectionLayoutSupplementaryItem;
954);
955
956extern_conformance!(
957    unsafe impl NSCopying for NSCollectionLayoutSupplementaryItem {}
958);
959
960unsafe impl CopyingHelper for NSCollectionLayoutSupplementaryItem {
961    type Result = Self;
962}
963
964extern_conformance!(
965    unsafe impl NSObjectProtocol for NSCollectionLayoutSupplementaryItem {}
966);
967
968impl NSCollectionLayoutSupplementaryItem {
969    extern_methods!(
970        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
971        #[unsafe(method_family = none)]
972        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
973            layout_size: &NSCollectionLayoutSize,
974            element_kind: &NSString,
975            container_anchor: &NSCollectionLayoutAnchor,
976        ) -> Retained<Self>;
977
978        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
979        #[unsafe(method_family = none)]
980        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
981            layout_size: &NSCollectionLayoutSize,
982            element_kind: &NSString,
983            container_anchor: &NSCollectionLayoutAnchor,
984            item_anchor: &NSCollectionLayoutAnchor,
985        ) -> Retained<Self>;
986
987        #[unsafe(method(init))]
988        #[unsafe(method_family = init)]
989        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
990
991        #[unsafe(method(new))]
992        #[unsafe(method_family = new)]
993        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
994
995        #[unsafe(method(zIndex))]
996        #[unsafe(method_family = none)]
997        pub unsafe fn zIndex(&self) -> NSInteger;
998
999        /// Setter for [`zIndex`][Self::zIndex].
1000        #[unsafe(method(setZIndex:))]
1001        #[unsafe(method_family = none)]
1002        pub unsafe fn setZIndex(&self, z_index: NSInteger);
1003
1004        #[unsafe(method(elementKind))]
1005        #[unsafe(method_family = none)]
1006        pub unsafe fn elementKind(&self) -> Retained<NSString>;
1007
1008        #[unsafe(method(containerAnchor))]
1009        #[unsafe(method_family = none)]
1010        pub unsafe fn containerAnchor(&self) -> Retained<NSCollectionLayoutAnchor>;
1011
1012        #[unsafe(method(itemAnchor))]
1013        #[unsafe(method_family = none)]
1014        pub unsafe fn itemAnchor(&self) -> Option<Retained<NSCollectionLayoutAnchor>>;
1015    );
1016}
1017
1018/// Methods declared on superclass `NSCollectionLayoutItem`.
1019impl NSCollectionLayoutSupplementaryItem {
1020    extern_methods!(
1021        #[unsafe(method(itemWithLayoutSize:))]
1022        #[unsafe(method_family = none)]
1023        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1024
1025        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1026        #[unsafe(method_family = none)]
1027        pub unsafe fn itemWithLayoutSize_supplementaryItems(
1028            layout_size: &NSCollectionLayoutSize,
1029            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1030        ) -> Retained<Self>;
1031    );
1032}
1033
1034extern_class!(
1035    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutboundarysupplementaryitem?language=objc)
1036    #[unsafe(super(NSCollectionLayoutSupplementaryItem, NSCollectionLayoutItem, NSObject))]
1037    #[derive(Debug, PartialEq, Eq, Hash)]
1038    pub struct NSCollectionLayoutBoundarySupplementaryItem;
1039);
1040
1041extern_conformance!(
1042    unsafe impl NSCopying for NSCollectionLayoutBoundarySupplementaryItem {}
1043);
1044
1045unsafe impl CopyingHelper for NSCollectionLayoutBoundarySupplementaryItem {
1046    type Result = Self;
1047}
1048
1049extern_conformance!(
1050    unsafe impl NSObjectProtocol for NSCollectionLayoutBoundarySupplementaryItem {}
1051);
1052
1053impl NSCollectionLayoutBoundarySupplementaryItem {
1054    extern_methods!(
1055        #[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:))]
1056        #[unsafe(method_family = none)]
1057        pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment(
1058            layout_size: &NSCollectionLayoutSize,
1059            element_kind: &NSString,
1060            alignment: NSRectAlignment,
1061        ) -> Retained<Self>;
1062
1063        #[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:))]
1064        #[unsafe(method_family = none)]
1065        pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment_absoluteOffset(
1066            layout_size: &NSCollectionLayoutSize,
1067            element_kind: &NSString,
1068            alignment: NSRectAlignment,
1069            absolute_offset: NSPoint,
1070        ) -> Retained<Self>;
1071
1072        #[unsafe(method(init))]
1073        #[unsafe(method_family = init)]
1074        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1075
1076        #[unsafe(method(new))]
1077        #[unsafe(method_family = new)]
1078        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1079
1080        #[unsafe(method(extendsBoundary))]
1081        #[unsafe(method_family = none)]
1082        pub unsafe fn extendsBoundary(&self) -> bool;
1083
1084        /// Setter for [`extendsBoundary`][Self::extendsBoundary].
1085        #[unsafe(method(setExtendsBoundary:))]
1086        #[unsafe(method_family = none)]
1087        pub unsafe fn setExtendsBoundary(&self, extends_boundary: bool);
1088
1089        #[unsafe(method(pinToVisibleBounds))]
1090        #[unsafe(method_family = none)]
1091        pub unsafe fn pinToVisibleBounds(&self) -> bool;
1092
1093        /// Setter for [`pinToVisibleBounds`][Self::pinToVisibleBounds].
1094        #[unsafe(method(setPinToVisibleBounds:))]
1095        #[unsafe(method_family = none)]
1096        pub unsafe fn setPinToVisibleBounds(&self, pin_to_visible_bounds: bool);
1097
1098        #[unsafe(method(alignment))]
1099        #[unsafe(method_family = none)]
1100        pub unsafe fn alignment(&self) -> NSRectAlignment;
1101
1102        #[unsafe(method(offset))]
1103        #[unsafe(method_family = none)]
1104        pub unsafe fn offset(&self) -> NSPoint;
1105    );
1106}
1107
1108/// Methods declared on superclass `NSCollectionLayoutSupplementaryItem`.
1109impl NSCollectionLayoutBoundarySupplementaryItem {
1110    extern_methods!(
1111        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
1112        #[unsafe(method_family = none)]
1113        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
1114            layout_size: &NSCollectionLayoutSize,
1115            element_kind: &NSString,
1116            container_anchor: &NSCollectionLayoutAnchor,
1117        ) -> Retained<Self>;
1118
1119        #[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
1120        #[unsafe(method_family = none)]
1121        pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
1122            layout_size: &NSCollectionLayoutSize,
1123            element_kind: &NSString,
1124            container_anchor: &NSCollectionLayoutAnchor,
1125            item_anchor: &NSCollectionLayoutAnchor,
1126        ) -> Retained<Self>;
1127    );
1128}
1129
1130/// Methods declared on superclass `NSCollectionLayoutItem`.
1131impl NSCollectionLayoutBoundarySupplementaryItem {
1132    extern_methods!(
1133        #[unsafe(method(itemWithLayoutSize:))]
1134        #[unsafe(method_family = none)]
1135        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1136
1137        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1138        #[unsafe(method_family = none)]
1139        pub unsafe fn itemWithLayoutSize_supplementaryItems(
1140            layout_size: &NSCollectionLayoutSize,
1141            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1142        ) -> Retained<Self>;
1143    );
1144}
1145
1146extern_class!(
1147    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutdecorationitem?language=objc)
1148    #[unsafe(super(NSCollectionLayoutItem, NSObject))]
1149    #[derive(Debug, PartialEq, Eq, Hash)]
1150    pub struct NSCollectionLayoutDecorationItem;
1151);
1152
1153extern_conformance!(
1154    unsafe impl NSCopying for NSCollectionLayoutDecorationItem {}
1155);
1156
1157unsafe impl CopyingHelper for NSCollectionLayoutDecorationItem {
1158    type Result = Self;
1159}
1160
1161extern_conformance!(
1162    unsafe impl NSObjectProtocol for NSCollectionLayoutDecorationItem {}
1163);
1164
1165impl NSCollectionLayoutDecorationItem {
1166    extern_methods!(
1167        #[unsafe(method(backgroundDecorationItemWithElementKind:))]
1168        #[unsafe(method_family = none)]
1169        pub unsafe fn backgroundDecorationItemWithElementKind(
1170            element_kind: &NSString,
1171            mtm: MainThreadMarker,
1172        ) -> Retained<Self>;
1173
1174        #[unsafe(method(init))]
1175        #[unsafe(method_family = init)]
1176        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1177
1178        #[unsafe(method(new))]
1179        #[unsafe(method_family = new)]
1180        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1181
1182        #[unsafe(method(zIndex))]
1183        #[unsafe(method_family = none)]
1184        pub unsafe fn zIndex(&self) -> NSInteger;
1185
1186        /// Setter for [`zIndex`][Self::zIndex].
1187        #[unsafe(method(setZIndex:))]
1188        #[unsafe(method_family = none)]
1189        pub unsafe fn setZIndex(&self, z_index: NSInteger);
1190
1191        #[unsafe(method(elementKind))]
1192        #[unsafe(method_family = none)]
1193        pub unsafe fn elementKind(&self) -> Retained<NSString>;
1194    );
1195}
1196
1197/// Methods declared on superclass `NSCollectionLayoutItem`.
1198impl NSCollectionLayoutDecorationItem {
1199    extern_methods!(
1200        #[unsafe(method(itemWithLayoutSize:))]
1201        #[unsafe(method_family = none)]
1202        pub unsafe fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
1203
1204        #[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
1205        #[unsafe(method_family = none)]
1206        pub unsafe fn itemWithLayoutSize_supplementaryItems(
1207            layout_size: &NSCollectionLayoutSize,
1208            supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
1209        ) -> Retained<Self>;
1210    );
1211}
1212
1213extern_class!(
1214    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutanchor?language=objc)
1215    #[unsafe(super(NSObject))]
1216    #[thread_kind = MainThreadOnly]
1217    #[derive(Debug, PartialEq, Eq, Hash)]
1218    pub struct NSCollectionLayoutAnchor;
1219);
1220
1221extern_conformance!(
1222    unsafe impl NSCopying for NSCollectionLayoutAnchor {}
1223);
1224
1225unsafe impl CopyingHelper for NSCollectionLayoutAnchor {
1226    type Result = Self;
1227}
1228
1229extern_conformance!(
1230    unsafe impl NSObjectProtocol for NSCollectionLayoutAnchor {}
1231);
1232
1233impl NSCollectionLayoutAnchor {
1234    extern_methods!(
1235        #[unsafe(method(layoutAnchorWithEdges:))]
1236        #[unsafe(method_family = none)]
1237        pub unsafe fn layoutAnchorWithEdges(
1238            edges: NSDirectionalRectEdge,
1239            mtm: MainThreadMarker,
1240        ) -> Retained<Self>;
1241
1242        #[unsafe(method(layoutAnchorWithEdges:absoluteOffset:))]
1243        #[unsafe(method_family = none)]
1244        pub unsafe fn layoutAnchorWithEdges_absoluteOffset(
1245            edges: NSDirectionalRectEdge,
1246            absolute_offset: NSPoint,
1247            mtm: MainThreadMarker,
1248        ) -> Retained<Self>;
1249
1250        #[unsafe(method(layoutAnchorWithEdges:fractionalOffset:))]
1251        #[unsafe(method_family = none)]
1252        pub unsafe fn layoutAnchorWithEdges_fractionalOffset(
1253            edges: NSDirectionalRectEdge,
1254            fractional_offset: NSPoint,
1255            mtm: MainThreadMarker,
1256        ) -> Retained<Self>;
1257
1258        #[unsafe(method(init))]
1259        #[unsafe(method_family = init)]
1260        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1261
1262        #[unsafe(method(new))]
1263        #[unsafe(method_family = new)]
1264        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1265
1266        #[unsafe(method(edges))]
1267        #[unsafe(method_family = none)]
1268        pub unsafe fn edges(&self) -> NSDirectionalRectEdge;
1269
1270        #[unsafe(method(offset))]
1271        #[unsafe(method_family = none)]
1272        pub unsafe fn offset(&self) -> NSPoint;
1273
1274        #[unsafe(method(isAbsoluteOffset))]
1275        #[unsafe(method_family = none)]
1276        pub unsafe fn isAbsoluteOffset(&self) -> bool;
1277
1278        #[unsafe(method(isFractionalOffset))]
1279        #[unsafe(method_family = none)]
1280        pub unsafe fn isFractionalOffset(&self) -> bool;
1281    );
1282}
1283
1284extern_protocol!(
1285    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutcontainer?language=objc)
1286    pub unsafe trait NSCollectionLayoutContainer: NSObjectProtocol + MainThreadOnly {
1287        #[unsafe(method(contentSize))]
1288        #[unsafe(method_family = none)]
1289        unsafe fn contentSize(&self) -> NSSize;
1290
1291        #[unsafe(method(effectiveContentSize))]
1292        #[unsafe(method_family = none)]
1293        unsafe fn effectiveContentSize(&self) -> NSSize;
1294
1295        #[cfg(feature = "objc2-core-foundation")]
1296        #[unsafe(method(contentInsets))]
1297        #[unsafe(method_family = none)]
1298        unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
1299
1300        #[cfg(feature = "objc2-core-foundation")]
1301        #[unsafe(method(effectiveContentInsets))]
1302        #[unsafe(method_family = none)]
1303        unsafe fn effectiveContentInsets(&self) -> NSDirectionalEdgeInsets;
1304    }
1305);
1306
1307extern_protocol!(
1308    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutenvironment?language=objc)
1309    pub unsafe trait NSCollectionLayoutEnvironment:
1310        NSObjectProtocol + MainThreadOnly
1311    {
1312        #[unsafe(method(container))]
1313        #[unsafe(method_family = none)]
1314        unsafe fn container(&self) -> Retained<ProtocolObject<dyn NSCollectionLayoutContainer>>;
1315    }
1316);
1317
1318extern_protocol!(
1319    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionlayoutvisibleitem?language=objc)
1320    pub unsafe trait NSCollectionLayoutVisibleItem:
1321        NSObjectProtocol + MainThreadOnly
1322    {
1323        #[cfg(feature = "objc2-core-foundation")]
1324        #[unsafe(method(alpha))]
1325        #[unsafe(method_family = none)]
1326        unsafe fn alpha(&self) -> CGFloat;
1327
1328        #[cfg(feature = "objc2-core-foundation")]
1329        /// Setter for [`alpha`][Self::alpha].
1330        #[unsafe(method(setAlpha:))]
1331        #[unsafe(method_family = none)]
1332        unsafe fn setAlpha(&self, alpha: CGFloat);
1333
1334        #[unsafe(method(zIndex))]
1335        #[unsafe(method_family = none)]
1336        unsafe fn zIndex(&self) -> NSInteger;
1337
1338        /// Setter for [`zIndex`][Self::zIndex].
1339        #[unsafe(method(setZIndex:))]
1340        #[unsafe(method_family = none)]
1341        unsafe fn setZIndex(&self, z_index: NSInteger);
1342
1343        #[unsafe(method(isHidden))]
1344        #[unsafe(method_family = none)]
1345        unsafe fn isHidden(&self) -> bool;
1346
1347        /// Setter for [`isHidden`][Self::isHidden].
1348        #[unsafe(method(setHidden:))]
1349        #[unsafe(method_family = none)]
1350        unsafe fn setHidden(&self, hidden: bool);
1351
1352        #[unsafe(method(center))]
1353        #[unsafe(method_family = none)]
1354        unsafe fn center(&self) -> NSPoint;
1355
1356        /// Setter for [`center`][Self::center].
1357        #[unsafe(method(setCenter:))]
1358        #[unsafe(method_family = none)]
1359        unsafe fn setCenter(&self, center: NSPoint);
1360
1361        #[unsafe(method(name))]
1362        #[unsafe(method_family = none)]
1363        unsafe fn name(&self) -> Retained<NSString>;
1364
1365        #[unsafe(method(indexPath))]
1366        #[unsafe(method_family = none)]
1367        unsafe fn indexPath(&self) -> Retained<NSIndexPath>;
1368
1369        #[unsafe(method(frame))]
1370        #[unsafe(method_family = none)]
1371        unsafe fn frame(&self) -> NSRect;
1372
1373        #[unsafe(method(bounds))]
1374        #[unsafe(method_family = none)]
1375        unsafe fn bounds(&self) -> NSRect;
1376
1377        #[cfg(feature = "NSCollectionViewLayout")]
1378        #[unsafe(method(representedElementCategory))]
1379        #[unsafe(method_family = none)]
1380        unsafe fn representedElementCategory(&self) -> NSCollectionElementCategory;
1381
1382        #[unsafe(method(representedElementKind))]
1383        #[unsafe(method_family = none)]
1384        unsafe fn representedElementKind(&self) -> Option<Retained<NSString>>;
1385    }
1386);