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
15extern "C" {
16 #[cfg(feature = "objc2-core-foundation")]
18 pub static UICollectionViewLayoutAutomaticDimension: CGFloat;
19}
20
21extern "C" {
22 pub static UICollectionElementKindSectionHeader: &'static NSString;
24}
25
26extern "C" {
27 pub static UICollectionElementKindSectionFooter: &'static NSString;
29}
30
31#[repr(transparent)]
34#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
35pub struct UICollectionViewScrollDirection(pub NSInteger);
36impl UICollectionViewScrollDirection {
37 #[doc(alias = "UICollectionViewScrollDirectionVertical")]
38 pub const Vertical: Self = Self(0);
39 #[doc(alias = "UICollectionViewScrollDirectionHorizontal")]
40 pub const Horizontal: Self = Self(1);
41}
42
43unsafe impl Encode for UICollectionViewScrollDirection {
44 const ENCODING: Encoding = NSInteger::ENCODING;
45}
46
47unsafe impl RefEncode for UICollectionViewScrollDirection {
48 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
49}
50
51#[repr(transparent)]
54#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
55pub struct UICollectionElementCategory(pub NSUInteger);
56impl UICollectionElementCategory {
57 #[doc(alias = "UICollectionElementCategoryCell")]
58 pub const Cell: Self = Self(0);
59 #[doc(alias = "UICollectionElementCategorySupplementaryView")]
60 pub const SupplementaryView: Self = Self(1);
61 #[doc(alias = "UICollectionElementCategoryDecorationView")]
62 pub const DecorationView: Self = Self(2);
63}
64
65unsafe impl Encode for UICollectionElementCategory {
66 const ENCODING: Encoding = NSUInteger::ENCODING;
67}
68
69unsafe impl RefEncode for UICollectionElementCategory {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73extern_class!(
74 #[unsafe(super(NSObject))]
76 #[thread_kind = MainThreadOnly]
77 #[derive(Debug, PartialEq, Eq, Hash)]
78 pub struct UICollectionViewLayoutAttributes;
79);
80
81extern_conformance!(
82 unsafe impl NSCopying for UICollectionViewLayoutAttributes {}
83);
84
85unsafe impl CopyingHelper for UICollectionViewLayoutAttributes {
86 type Result = Self;
87}
88
89extern_conformance!(
90 unsafe impl NSObjectProtocol for UICollectionViewLayoutAttributes {}
91);
92
93#[cfg(feature = "UIDynamicBehavior")]
94extern_conformance!(
95 unsafe impl UIDynamicItem for UICollectionViewLayoutAttributes {}
96);
97
98impl UICollectionViewLayoutAttributes {
99 extern_methods!(
100 #[cfg(feature = "objc2-core-foundation")]
101 #[unsafe(method(frame))]
102 #[unsafe(method_family = none)]
103 pub fn frame(&self) -> CGRect;
104
105 #[cfg(feature = "objc2-core-foundation")]
106 #[unsafe(method(setFrame:))]
108 #[unsafe(method_family = none)]
109 pub fn setFrame(&self, frame: CGRect);
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(center))]
113 #[unsafe(method_family = none)]
114 pub fn center(&self) -> CGPoint;
115
116 #[cfg(feature = "objc2-core-foundation")]
117 #[unsafe(method(setCenter:))]
119 #[unsafe(method_family = none)]
120 pub fn setCenter(&self, center: CGPoint);
121
122 #[cfg(feature = "objc2-core-foundation")]
123 #[unsafe(method(size))]
124 #[unsafe(method_family = none)]
125 pub fn size(&self) -> CGSize;
126
127 #[cfg(feature = "objc2-core-foundation")]
128 #[unsafe(method(setSize:))]
130 #[unsafe(method_family = none)]
131 pub fn setSize(&self, size: CGSize);
132
133 #[cfg(feature = "objc2-quartz-core")]
134 #[cfg(not(target_os = "watchos"))]
135 #[unsafe(method(transform3D))]
136 #[unsafe(method_family = none)]
137 pub fn transform3D(&self) -> CATransform3D;
138
139 #[cfg(feature = "objc2-quartz-core")]
140 #[cfg(not(target_os = "watchos"))]
141 #[unsafe(method(setTransform3D:))]
143 #[unsafe(method_family = none)]
144 pub fn setTransform3D(&self, transform3_d: CATransform3D);
145
146 #[cfg(feature = "objc2-core-foundation")]
147 #[unsafe(method(bounds))]
148 #[unsafe(method_family = none)]
149 pub fn bounds(&self) -> CGRect;
150
151 #[cfg(feature = "objc2-core-foundation")]
152 #[unsafe(method(setBounds:))]
154 #[unsafe(method_family = none)]
155 pub fn setBounds(&self, bounds: CGRect);
156
157 #[cfg(feature = "objc2-core-foundation")]
158 #[unsafe(method(transform))]
159 #[unsafe(method_family = none)]
160 pub fn transform(&self) -> CGAffineTransform;
161
162 #[cfg(feature = "objc2-core-foundation")]
163 #[unsafe(method(setTransform:))]
165 #[unsafe(method_family = none)]
166 pub fn setTransform(&self, transform: CGAffineTransform);
167
168 #[cfg(feature = "objc2-core-foundation")]
169 #[unsafe(method(alpha))]
170 #[unsafe(method_family = none)]
171 pub fn alpha(&self) -> CGFloat;
172
173 #[cfg(feature = "objc2-core-foundation")]
174 #[unsafe(method(setAlpha:))]
176 #[unsafe(method_family = none)]
177 pub fn setAlpha(&self, alpha: CGFloat);
178
179 #[unsafe(method(zIndex))]
180 #[unsafe(method_family = none)]
181 pub fn zIndex(&self) -> NSInteger;
182
183 #[unsafe(method(setZIndex:))]
185 #[unsafe(method_family = none)]
186 pub fn setZIndex(&self, z_index: NSInteger);
187
188 #[unsafe(method(isHidden))]
189 #[unsafe(method_family = none)]
190 pub fn isHidden(&self) -> bool;
191
192 #[unsafe(method(setHidden:))]
194 #[unsafe(method_family = none)]
195 pub fn setHidden(&self, hidden: bool);
196
197 #[unsafe(method(indexPath))]
198 #[unsafe(method_family = none)]
199 pub fn indexPath(&self) -> Retained<NSIndexPath>;
200
201 #[unsafe(method(setIndexPath:))]
203 #[unsafe(method_family = none)]
204 pub fn setIndexPath(&self, index_path: &NSIndexPath);
205
206 #[unsafe(method(representedElementCategory))]
207 #[unsafe(method_family = none)]
208 pub fn representedElementCategory(&self) -> UICollectionElementCategory;
209
210 #[unsafe(method(representedElementKind))]
211 #[unsafe(method_family = none)]
212 pub fn representedElementKind(&self) -> Option<Retained<NSString>>;
213
214 #[unsafe(method(layoutAttributesForCellWithIndexPath:))]
215 #[unsafe(method_family = none)]
216 pub fn layoutAttributesForCellWithIndexPath(
217 index_path: &NSIndexPath,
218 mtm: MainThreadMarker,
219 ) -> Retained<Self>;
220
221 #[unsafe(method(layoutAttributesForSupplementaryViewOfKind:withIndexPath:))]
222 #[unsafe(method_family = none)]
223 pub fn layoutAttributesForSupplementaryViewOfKind_withIndexPath(
224 element_kind: &NSString,
225 index_path: &NSIndexPath,
226 mtm: MainThreadMarker,
227 ) -> Retained<Self>;
228
229 #[unsafe(method(layoutAttributesForDecorationViewOfKind:withIndexPath:))]
230 #[unsafe(method_family = none)]
231 pub fn layoutAttributesForDecorationViewOfKind_withIndexPath(
232 decoration_view_kind: &NSString,
233 index_path: &NSIndexPath,
234 mtm: MainThreadMarker,
235 ) -> Retained<Self>;
236 );
237}
238
239impl UICollectionViewLayoutAttributes {
241 extern_methods!(
242 #[unsafe(method(init))]
243 #[unsafe(method_family = init)]
244 pub fn init(this: Allocated<Self>) -> Retained<Self>;
245
246 #[unsafe(method(new))]
247 #[unsafe(method_family = new)]
248 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
249 );
250}
251
252extern_class!(
253 #[unsafe(super(NSObject))]
255 #[thread_kind = MainThreadOnly]
256 #[derive(Debug, PartialEq, Eq, Hash)]
257 pub struct UICollectionViewLayoutInvalidationContext;
258);
259
260extern_conformance!(
261 unsafe impl NSObjectProtocol for UICollectionViewLayoutInvalidationContext {}
262);
263
264impl UICollectionViewLayoutInvalidationContext {
265 extern_methods!(
266 #[unsafe(method(invalidateEverything))]
267 #[unsafe(method_family = none)]
268 pub fn invalidateEverything(&self) -> bool;
269
270 #[unsafe(method(invalidateDataSourceCounts))]
271 #[unsafe(method_family = none)]
272 pub fn invalidateDataSourceCounts(&self) -> bool;
273
274 #[unsafe(method(invalidateItemsAtIndexPaths:))]
275 #[unsafe(method_family = none)]
276 pub fn invalidateItemsAtIndexPaths(&self, index_paths: &NSArray<NSIndexPath>);
277
278 #[unsafe(method(invalidateSupplementaryElementsOfKind:atIndexPaths:))]
279 #[unsafe(method_family = none)]
280 pub fn invalidateSupplementaryElementsOfKind_atIndexPaths(
281 &self,
282 element_kind: &NSString,
283 index_paths: &NSArray<NSIndexPath>,
284 );
285
286 #[unsafe(method(invalidateDecorationElementsOfKind:atIndexPaths:))]
287 #[unsafe(method_family = none)]
288 pub fn invalidateDecorationElementsOfKind_atIndexPaths(
289 &self,
290 element_kind: &NSString,
291 index_paths: &NSArray<NSIndexPath>,
292 );
293
294 #[unsafe(method(invalidatedItemIndexPaths))]
295 #[unsafe(method_family = none)]
296 pub fn invalidatedItemIndexPaths(&self) -> Option<Retained<NSArray<NSIndexPath>>>;
297
298 #[unsafe(method(invalidatedSupplementaryIndexPaths))]
299 #[unsafe(method_family = none)]
300 pub fn invalidatedSupplementaryIndexPaths(
301 &self,
302 ) -> Option<Retained<NSDictionary<NSString, NSArray<NSIndexPath>>>>;
303
304 #[unsafe(method(invalidatedDecorationIndexPaths))]
305 #[unsafe(method_family = none)]
306 pub fn invalidatedDecorationIndexPaths(
307 &self,
308 ) -> Option<Retained<NSDictionary<NSString, NSArray<NSIndexPath>>>>;
309
310 #[cfg(feature = "objc2-core-foundation")]
311 #[unsafe(method(contentOffsetAdjustment))]
312 #[unsafe(method_family = none)]
313 pub fn contentOffsetAdjustment(&self) -> CGPoint;
314
315 #[cfg(feature = "objc2-core-foundation")]
316 #[unsafe(method(setContentOffsetAdjustment:))]
318 #[unsafe(method_family = none)]
319 pub fn setContentOffsetAdjustment(&self, content_offset_adjustment: CGPoint);
320
321 #[cfg(feature = "objc2-core-foundation")]
322 #[unsafe(method(contentSizeAdjustment))]
323 #[unsafe(method_family = none)]
324 pub fn contentSizeAdjustment(&self) -> CGSize;
325
326 #[cfg(feature = "objc2-core-foundation")]
327 #[unsafe(method(setContentSizeAdjustment:))]
329 #[unsafe(method_family = none)]
330 pub fn setContentSizeAdjustment(&self, content_size_adjustment: CGSize);
331
332 #[unsafe(method(previousIndexPathsForInteractivelyMovingItems))]
333 #[unsafe(method_family = none)]
334 pub fn previousIndexPathsForInteractivelyMovingItems(
335 &self,
336 ) -> Option<Retained<NSArray<NSIndexPath>>>;
337
338 #[unsafe(method(targetIndexPathsForInteractivelyMovingItems))]
339 #[unsafe(method_family = none)]
340 pub fn targetIndexPathsForInteractivelyMovingItems(
341 &self,
342 ) -> Option<Retained<NSArray<NSIndexPath>>>;
343
344 #[cfg(feature = "objc2-core-foundation")]
345 #[unsafe(method(interactiveMovementTarget))]
346 #[unsafe(method_family = none)]
347 pub fn interactiveMovementTarget(&self) -> CGPoint;
348 );
349}
350
351impl UICollectionViewLayoutInvalidationContext {
353 extern_methods!(
354 #[unsafe(method(init))]
355 #[unsafe(method_family = init)]
356 pub fn init(this: Allocated<Self>) -> Retained<Self>;
357
358 #[unsafe(method(new))]
359 #[unsafe(method_family = new)]
360 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
361 );
362}
363
364extern_class!(
365 #[unsafe(super(NSObject))]
367 #[thread_kind = MainThreadOnly]
368 #[derive(Debug, PartialEq, Eq, Hash)]
369 pub struct UICollectionViewLayout;
370);
371
372extern_conformance!(
373 unsafe impl NSCoding for UICollectionViewLayout {}
374);
375
376extern_conformance!(
377 unsafe impl NSObjectProtocol for UICollectionViewLayout {}
378);
379
380impl UICollectionViewLayout {
381 extern_methods!(
382 #[unsafe(method(init))]
383 #[unsafe(method_family = init)]
384 pub fn init(this: Allocated<Self>) -> Retained<Self>;
385
386 #[unsafe(method(initWithCoder:))]
390 #[unsafe(method_family = init)]
391 pub unsafe fn initWithCoder(
392 this: Allocated<Self>,
393 coder: &NSCoder,
394 ) -> Option<Retained<Self>>;
395
396 #[cfg(all(
397 feature = "UICollectionView",
398 feature = "UIResponder",
399 feature = "UIScrollView",
400 feature = "UIView"
401 ))]
402 #[unsafe(method(collectionView))]
403 #[unsafe(method_family = none)]
404 pub fn collectionView(&self) -> Option<Retained<UICollectionView>>;
405
406 #[unsafe(method(invalidateLayout))]
407 #[unsafe(method_family = none)]
408 pub fn invalidateLayout(&self);
409
410 #[unsafe(method(invalidateLayoutWithContext:))]
411 #[unsafe(method_family = none)]
412 pub fn invalidateLayoutWithContext(
413 &self,
414 context: &UICollectionViewLayoutInvalidationContext,
415 );
416
417 #[unsafe(method(registerClass:forDecorationViewOfKind:))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn registerClass_forDecorationViewOfKind(
423 &self,
424 view_class: Option<&AnyClass>,
425 element_kind: &NSString,
426 );
427
428 #[cfg(feature = "UINib")]
429 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
430 #[unsafe(method(registerNib:forDecorationViewOfKind:))]
431 #[unsafe(method_family = none)]
432 pub fn registerNib_forDecorationViewOfKind(
433 &self,
434 nib: Option<&UINib>,
435 element_kind: &NSString,
436 );
437 );
438}
439
440impl UICollectionViewLayout {
442 extern_methods!(
443 #[unsafe(method(new))]
444 #[unsafe(method_family = new)]
445 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
446 );
447}
448
449impl UICollectionViewLayout {
451 extern_methods!(
452 #[unsafe(method(layoutAttributesClass))]
453 #[unsafe(method_family = none)]
454 pub fn layoutAttributesClass(mtm: MainThreadMarker) -> &'static AnyClass;
455
456 #[unsafe(method(invalidationContextClass))]
457 #[unsafe(method_family = none)]
458 pub fn invalidationContextClass(mtm: MainThreadMarker) -> &'static AnyClass;
459
460 #[unsafe(method(prepareLayout))]
461 #[unsafe(method_family = none)]
462 pub fn prepareLayout(&self);
463
464 #[cfg(feature = "objc2-core-foundation")]
465 #[unsafe(method(layoutAttributesForElementsInRect:))]
466 #[unsafe(method_family = none)]
467 pub fn layoutAttributesForElementsInRect(
468 &self,
469 rect: CGRect,
470 ) -> Option<Retained<NSArray<UICollectionViewLayoutAttributes>>>;
471
472 #[unsafe(method(layoutAttributesForItemAtIndexPath:))]
473 #[unsafe(method_family = none)]
474 pub fn layoutAttributesForItemAtIndexPath(
475 &self,
476 index_path: &NSIndexPath,
477 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
478
479 #[unsafe(method(layoutAttributesForSupplementaryViewOfKind:atIndexPath:))]
480 #[unsafe(method_family = none)]
481 pub fn layoutAttributesForSupplementaryViewOfKind_atIndexPath(
482 &self,
483 element_kind: &NSString,
484 index_path: &NSIndexPath,
485 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
486
487 #[unsafe(method(layoutAttributesForDecorationViewOfKind:atIndexPath:))]
488 #[unsafe(method_family = none)]
489 pub fn layoutAttributesForDecorationViewOfKind_atIndexPath(
490 &self,
491 element_kind: &NSString,
492 index_path: &NSIndexPath,
493 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
494
495 #[cfg(feature = "objc2-core-foundation")]
496 #[unsafe(method(shouldInvalidateLayoutForBoundsChange:))]
497 #[unsafe(method_family = none)]
498 pub fn shouldInvalidateLayoutForBoundsChange(&self, new_bounds: CGRect) -> bool;
499
500 #[cfg(feature = "objc2-core-foundation")]
501 #[unsafe(method(invalidationContextForBoundsChange:))]
502 #[unsafe(method_family = none)]
503 pub fn invalidationContextForBoundsChange(
504 &self,
505 new_bounds: CGRect,
506 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
507
508 #[unsafe(method(shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes:))]
509 #[unsafe(method_family = none)]
510 pub fn shouldInvalidateLayoutForPreferredLayoutAttributes_withOriginalAttributes(
511 &self,
512 preferred_attributes: &UICollectionViewLayoutAttributes,
513 original_attributes: &UICollectionViewLayoutAttributes,
514 ) -> bool;
515
516 #[unsafe(method(invalidationContextForPreferredLayoutAttributes:withOriginalAttributes:))]
517 #[unsafe(method_family = none)]
518 pub fn invalidationContextForPreferredLayoutAttributes_withOriginalAttributes(
519 &self,
520 preferred_attributes: &UICollectionViewLayoutAttributes,
521 original_attributes: &UICollectionViewLayoutAttributes,
522 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
523
524 #[cfg(feature = "objc2-core-foundation")]
525 #[unsafe(method(targetContentOffsetForProposedContentOffset:withScrollingVelocity:))]
526 #[unsafe(method_family = none)]
527 pub fn targetContentOffsetForProposedContentOffset_withScrollingVelocity(
528 &self,
529 proposed_content_offset: CGPoint,
530 velocity: CGPoint,
531 ) -> CGPoint;
532
533 #[cfg(feature = "objc2-core-foundation")]
534 #[unsafe(method(targetContentOffsetForProposedContentOffset:))]
535 #[unsafe(method_family = none)]
536 pub fn targetContentOffsetForProposedContentOffset(
537 &self,
538 proposed_content_offset: CGPoint,
539 ) -> CGPoint;
540
541 #[cfg(feature = "objc2-core-foundation")]
542 #[unsafe(method(collectionViewContentSize))]
543 #[unsafe(method_family = none)]
544 pub fn collectionViewContentSize(&self) -> CGSize;
545
546 #[cfg(feature = "UIInterface")]
547 #[unsafe(method(developmentLayoutDirection))]
548 #[unsafe(method_family = none)]
549 pub fn developmentLayoutDirection(&self) -> UIUserInterfaceLayoutDirection;
550
551 #[unsafe(method(flipsHorizontallyInOppositeLayoutDirection))]
552 #[unsafe(method_family = none)]
553 pub fn flipsHorizontallyInOppositeLayoutDirection(&self) -> bool;
554 );
555}
556
557impl UICollectionViewLayout {
559 extern_methods!(
560 #[cfg(feature = "UICollectionViewUpdateItem")]
561 #[unsafe(method(prepareForCollectionViewUpdates:))]
562 #[unsafe(method_family = none)]
563 pub fn prepareForCollectionViewUpdates(
564 &self,
565 update_items: &NSArray<UICollectionViewUpdateItem>,
566 );
567
568 #[unsafe(method(finalizeCollectionViewUpdates))]
569 #[unsafe(method_family = none)]
570 pub fn finalizeCollectionViewUpdates(&self);
571
572 #[cfg(feature = "objc2-core-foundation")]
573 #[unsafe(method(prepareForAnimatedBoundsChange:))]
574 #[unsafe(method_family = none)]
575 pub fn prepareForAnimatedBoundsChange(&self, old_bounds: CGRect);
576
577 #[unsafe(method(finalizeAnimatedBoundsChange))]
578 #[unsafe(method_family = none)]
579 pub fn finalizeAnimatedBoundsChange(&self);
580
581 #[unsafe(method(prepareForTransitionToLayout:))]
582 #[unsafe(method_family = none)]
583 pub fn prepareForTransitionToLayout(&self, new_layout: &UICollectionViewLayout);
584
585 #[unsafe(method(prepareForTransitionFromLayout:))]
586 #[unsafe(method_family = none)]
587 pub fn prepareForTransitionFromLayout(&self, old_layout: &UICollectionViewLayout);
588
589 #[unsafe(method(finalizeLayoutTransition))]
590 #[unsafe(method_family = none)]
591 pub fn finalizeLayoutTransition(&self);
592
593 #[unsafe(method(initialLayoutAttributesForAppearingItemAtIndexPath:))]
594 #[unsafe(method_family = none)]
595 pub fn initialLayoutAttributesForAppearingItemAtIndexPath(
596 &self,
597 item_index_path: &NSIndexPath,
598 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
599
600 #[unsafe(method(finalLayoutAttributesForDisappearingItemAtIndexPath:))]
601 #[unsafe(method_family = none)]
602 pub fn finalLayoutAttributesForDisappearingItemAtIndexPath(
603 &self,
604 item_index_path: &NSIndexPath,
605 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
606
607 #[unsafe(method(initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath:))]
608 #[unsafe(method_family = none)]
609 pub fn initialLayoutAttributesForAppearingSupplementaryElementOfKind_atIndexPath(
610 &self,
611 element_kind: &NSString,
612 element_index_path: &NSIndexPath,
613 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
614
615 #[unsafe(method(finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath:))]
616 #[unsafe(method_family = none)]
617 pub fn finalLayoutAttributesForDisappearingSupplementaryElementOfKind_atIndexPath(
618 &self,
619 element_kind: &NSString,
620 element_index_path: &NSIndexPath,
621 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
622
623 #[unsafe(method(initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:))]
624 #[unsafe(method_family = none)]
625 pub fn initialLayoutAttributesForAppearingDecorationElementOfKind_atIndexPath(
626 &self,
627 element_kind: &NSString,
628 decoration_index_path: &NSIndexPath,
629 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
630
631 #[unsafe(method(finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:))]
632 #[unsafe(method_family = none)]
633 pub fn finalLayoutAttributesForDisappearingDecorationElementOfKind_atIndexPath(
634 &self,
635 element_kind: &NSString,
636 decoration_index_path: &NSIndexPath,
637 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
638
639 #[unsafe(method(indexPathsToDeleteForSupplementaryViewOfKind:))]
640 #[unsafe(method_family = none)]
641 pub fn indexPathsToDeleteForSupplementaryViewOfKind(
642 &self,
643 element_kind: &NSString,
644 ) -> Retained<NSArray<NSIndexPath>>;
645
646 #[unsafe(method(indexPathsToDeleteForDecorationViewOfKind:))]
647 #[unsafe(method_family = none)]
648 pub fn indexPathsToDeleteForDecorationViewOfKind(
649 &self,
650 element_kind: &NSString,
651 ) -> Retained<NSArray<NSIndexPath>>;
652
653 #[unsafe(method(indexPathsToInsertForSupplementaryViewOfKind:))]
654 #[unsafe(method_family = none)]
655 pub fn indexPathsToInsertForSupplementaryViewOfKind(
656 &self,
657 element_kind: &NSString,
658 ) -> Retained<NSArray<NSIndexPath>>;
659
660 #[unsafe(method(indexPathsToInsertForDecorationViewOfKind:))]
661 #[unsafe(method_family = none)]
662 pub fn indexPathsToInsertForDecorationViewOfKind(
663 &self,
664 element_kind: &NSString,
665 ) -> Retained<NSArray<NSIndexPath>>;
666 );
667}
668
669impl UICollectionViewLayout {
671 extern_methods!(
672 #[cfg(feature = "objc2-core-foundation")]
673 #[unsafe(method(targetIndexPathForInteractivelyMovingItem:withPosition:))]
674 #[unsafe(method_family = none)]
675 pub fn targetIndexPathForInteractivelyMovingItem_withPosition(
676 &self,
677 previous_index_path: &NSIndexPath,
678 position: CGPoint,
679 ) -> Retained<NSIndexPath>;
680
681 #[cfg(feature = "objc2-core-foundation")]
682 #[unsafe(method(layoutAttributesForInteractivelyMovingItemAtIndexPath:withTargetPosition:))]
683 #[unsafe(method_family = none)]
684 pub fn layoutAttributesForInteractivelyMovingItemAtIndexPath_withTargetPosition(
685 &self,
686 index_path: &NSIndexPath,
687 position: CGPoint,
688 ) -> Retained<UICollectionViewLayoutAttributes>;
689
690 #[cfg(feature = "objc2-core-foundation")]
691 #[unsafe(method(invalidationContextForInteractivelyMovingItems:withTargetPosition:previousIndexPaths:previousPosition:))]
692 #[unsafe(method_family = none)]
693 pub fn invalidationContextForInteractivelyMovingItems_withTargetPosition_previousIndexPaths_previousPosition(
694 &self,
695 target_index_paths: &NSArray<NSIndexPath>,
696 target_position: CGPoint,
697 previous_index_paths: &NSArray<NSIndexPath>,
698 previous_position: CGPoint,
699 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
700
701 #[unsafe(method(invalidationContextForEndingInteractiveMovementOfItemsToFinalIndexPaths:previousIndexPaths:movementCancelled:))]
702 #[unsafe(method_family = none)]
703 pub fn invalidationContextForEndingInteractiveMovementOfItemsToFinalIndexPaths_previousIndexPaths_movementCancelled(
704 &self,
705 index_paths: &NSArray<NSIndexPath>,
706 previous_index_paths: &NSArray<NSIndexPath>,
707 movement_cancelled: bool,
708 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
709 );
710}