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