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