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 unsafe fn frame(&self) -> CGRect;
104
105 #[cfg(feature = "objc2-core-foundation")]
106 #[unsafe(method(setFrame:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setFrame(&self, frame: CGRect);
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(center))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn center(&self) -> CGPoint;
115
116 #[cfg(feature = "objc2-core-foundation")]
117 #[unsafe(method(setCenter:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn setCenter(&self, center: CGPoint);
121
122 #[cfg(feature = "objc2-core-foundation")]
123 #[unsafe(method(size))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn size(&self) -> CGSize;
126
127 #[cfg(feature = "objc2-core-foundation")]
128 #[unsafe(method(setSize:))]
130 #[unsafe(method_family = none)]
131 pub unsafe 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 unsafe 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 unsafe fn setTransform3D(&self, transform3_d: CATransform3D);
145
146 #[cfg(feature = "objc2-core-foundation")]
147 #[unsafe(method(bounds))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn bounds(&self) -> CGRect;
150
151 #[cfg(feature = "objc2-core-foundation")]
152 #[unsafe(method(setBounds:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn setBounds(&self, bounds: CGRect);
156
157 #[cfg(feature = "objc2-core-foundation")]
158 #[unsafe(method(transform))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn transform(&self) -> CGAffineTransform;
161
162 #[cfg(feature = "objc2-core-foundation")]
163 #[unsafe(method(setTransform:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn setTransform(&self, transform: CGAffineTransform);
167
168 #[cfg(feature = "objc2-core-foundation")]
169 #[unsafe(method(alpha))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn alpha(&self) -> CGFloat;
172
173 #[cfg(feature = "objc2-core-foundation")]
174 #[unsafe(method(setAlpha:))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn setAlpha(&self, alpha: CGFloat);
178
179 #[unsafe(method(zIndex))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn zIndex(&self) -> NSInteger;
182
183 #[unsafe(method(setZIndex:))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn setZIndex(&self, z_index: NSInteger);
187
188 #[unsafe(method(isHidden))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn isHidden(&self) -> bool;
191
192 #[unsafe(method(setHidden:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn setHidden(&self, hidden: bool);
196
197 #[unsafe(method(indexPath))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn indexPath(&self) -> Retained<NSIndexPath>;
200
201 #[unsafe(method(setIndexPath:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn setIndexPath(&self, index_path: &NSIndexPath);
205
206 #[unsafe(method(representedElementCategory))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn representedElementCategory(&self) -> UICollectionElementCategory;
209
210 #[unsafe(method(representedElementKind))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn representedElementKind(&self) -> Option<Retained<NSString>>;
213
214 #[unsafe(method(layoutAttributesForCellWithIndexPath:))]
215 #[unsafe(method_family = none)]
216 pub unsafe 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 unsafe 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 unsafe 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 unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
245
246 #[unsafe(method(new))]
247 #[unsafe(method_family = new)]
248 pub unsafe 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 unsafe fn invalidateEverything(&self) -> bool;
269
270 #[unsafe(method(invalidateDataSourceCounts))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn invalidateDataSourceCounts(&self) -> bool;
273
274 #[unsafe(method(invalidateItemsAtIndexPaths:))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn invalidateItemsAtIndexPaths(&self, index_paths: &NSArray<NSIndexPath>);
277
278 #[unsafe(method(invalidateSupplementaryElementsOfKind:atIndexPaths:))]
279 #[unsafe(method_family = none)]
280 pub unsafe 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 unsafe 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 unsafe fn invalidatedItemIndexPaths(&self) -> Option<Retained<NSArray<NSIndexPath>>>;
297
298 #[unsafe(method(invalidatedSupplementaryIndexPaths))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn invalidatedSupplementaryIndexPaths(
301 &self,
302 ) -> Option<Retained<NSDictionary<NSString, NSArray<NSIndexPath>>>>;
303
304 #[unsafe(method(invalidatedDecorationIndexPaths))]
305 #[unsafe(method_family = none)]
306 pub unsafe 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 unsafe fn contentOffsetAdjustment(&self) -> CGPoint;
314
315 #[cfg(feature = "objc2-core-foundation")]
316 #[unsafe(method(setContentOffsetAdjustment:))]
318 #[unsafe(method_family = none)]
319 pub unsafe 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 unsafe fn contentSizeAdjustment(&self) -> CGSize;
325
326 #[cfg(feature = "objc2-core-foundation")]
327 #[unsafe(method(setContentSizeAdjustment:))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn setContentSizeAdjustment(&self, content_size_adjustment: CGSize);
331
332 #[unsafe(method(previousIndexPathsForInteractivelyMovingItems))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn previousIndexPathsForInteractivelyMovingItems(
335 &self,
336 ) -> Option<Retained<NSArray<NSIndexPath>>>;
337
338 #[unsafe(method(targetIndexPathsForInteractivelyMovingItems))]
339 #[unsafe(method_family = none)]
340 pub unsafe 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 unsafe fn interactiveMovementTarget(&self) -> CGPoint;
348 );
349}
350
351impl UICollectionViewLayoutInvalidationContext {
353 extern_methods!(
354 #[unsafe(method(init))]
355 #[unsafe(method_family = init)]
356 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
357
358 #[unsafe(method(new))]
359 #[unsafe(method_family = new)]
360 pub unsafe 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 unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
385
386 #[unsafe(method(initWithCoder:))]
387 #[unsafe(method_family = init)]
388 pub unsafe fn initWithCoder(
389 this: Allocated<Self>,
390 coder: &NSCoder,
391 ) -> Option<Retained<Self>>;
392
393 #[cfg(all(
394 feature = "UICollectionView",
395 feature = "UIResponder",
396 feature = "UIScrollView",
397 feature = "UIView"
398 ))]
399 #[unsafe(method(collectionView))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn collectionView(&self) -> Option<Retained<UICollectionView>>;
402
403 #[unsafe(method(invalidateLayout))]
404 #[unsafe(method_family = none)]
405 pub unsafe fn invalidateLayout(&self);
406
407 #[unsafe(method(invalidateLayoutWithContext:))]
408 #[unsafe(method_family = none)]
409 pub unsafe fn invalidateLayoutWithContext(
410 &self,
411 context: &UICollectionViewLayoutInvalidationContext,
412 );
413
414 #[unsafe(method(registerClass:forDecorationViewOfKind:))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn registerClass_forDecorationViewOfKind(
417 &self,
418 view_class: Option<&AnyClass>,
419 element_kind: &NSString,
420 );
421
422 #[cfg(feature = "UINib")]
423 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
424 #[unsafe(method(registerNib:forDecorationViewOfKind:))]
425 #[unsafe(method_family = none)]
426 pub unsafe fn registerNib_forDecorationViewOfKind(
427 &self,
428 nib: Option<&UINib>,
429 element_kind: &NSString,
430 );
431 );
432}
433
434impl UICollectionViewLayout {
436 extern_methods!(
437 #[unsafe(method(new))]
438 #[unsafe(method_family = new)]
439 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
440 );
441}
442
443impl UICollectionViewLayout {
445 extern_methods!(
446 #[unsafe(method(layoutAttributesClass))]
447 #[unsafe(method_family = none)]
448 pub unsafe fn layoutAttributesClass(mtm: MainThreadMarker) -> &'static AnyClass;
449
450 #[unsafe(method(invalidationContextClass))]
451 #[unsafe(method_family = none)]
452 pub unsafe fn invalidationContextClass(mtm: MainThreadMarker) -> &'static AnyClass;
453
454 #[unsafe(method(prepareLayout))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn prepareLayout(&self);
457
458 #[cfg(feature = "objc2-core-foundation")]
459 #[unsafe(method(layoutAttributesForElementsInRect:))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn layoutAttributesForElementsInRect(
462 &self,
463 rect: CGRect,
464 ) -> Option<Retained<NSArray<UICollectionViewLayoutAttributes>>>;
465
466 #[unsafe(method(layoutAttributesForItemAtIndexPath:))]
467 #[unsafe(method_family = none)]
468 pub unsafe fn layoutAttributesForItemAtIndexPath(
469 &self,
470 index_path: &NSIndexPath,
471 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
472
473 #[unsafe(method(layoutAttributesForSupplementaryViewOfKind:atIndexPath:))]
474 #[unsafe(method_family = none)]
475 pub unsafe fn layoutAttributesForSupplementaryViewOfKind_atIndexPath(
476 &self,
477 element_kind: &NSString,
478 index_path: &NSIndexPath,
479 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
480
481 #[unsafe(method(layoutAttributesForDecorationViewOfKind:atIndexPath:))]
482 #[unsafe(method_family = none)]
483 pub unsafe fn layoutAttributesForDecorationViewOfKind_atIndexPath(
484 &self,
485 element_kind: &NSString,
486 index_path: &NSIndexPath,
487 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
488
489 #[cfg(feature = "objc2-core-foundation")]
490 #[unsafe(method(shouldInvalidateLayoutForBoundsChange:))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn shouldInvalidateLayoutForBoundsChange(&self, new_bounds: CGRect) -> bool;
493
494 #[cfg(feature = "objc2-core-foundation")]
495 #[unsafe(method(invalidationContextForBoundsChange:))]
496 #[unsafe(method_family = none)]
497 pub unsafe fn invalidationContextForBoundsChange(
498 &self,
499 new_bounds: CGRect,
500 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
501
502 #[unsafe(method(shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes:))]
503 #[unsafe(method_family = none)]
504 pub unsafe fn shouldInvalidateLayoutForPreferredLayoutAttributes_withOriginalAttributes(
505 &self,
506 preferred_attributes: &UICollectionViewLayoutAttributes,
507 original_attributes: &UICollectionViewLayoutAttributes,
508 ) -> bool;
509
510 #[unsafe(method(invalidationContextForPreferredLayoutAttributes:withOriginalAttributes:))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn invalidationContextForPreferredLayoutAttributes_withOriginalAttributes(
513 &self,
514 preferred_attributes: &UICollectionViewLayoutAttributes,
515 original_attributes: &UICollectionViewLayoutAttributes,
516 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
517
518 #[cfg(feature = "objc2-core-foundation")]
519 #[unsafe(method(targetContentOffsetForProposedContentOffset:withScrollingVelocity:))]
520 #[unsafe(method_family = none)]
521 pub unsafe fn targetContentOffsetForProposedContentOffset_withScrollingVelocity(
522 &self,
523 proposed_content_offset: CGPoint,
524 velocity: CGPoint,
525 ) -> CGPoint;
526
527 #[cfg(feature = "objc2-core-foundation")]
528 #[unsafe(method(targetContentOffsetForProposedContentOffset:))]
529 #[unsafe(method_family = none)]
530 pub unsafe fn targetContentOffsetForProposedContentOffset(
531 &self,
532 proposed_content_offset: CGPoint,
533 ) -> CGPoint;
534
535 #[cfg(feature = "objc2-core-foundation")]
536 #[unsafe(method(collectionViewContentSize))]
537 #[unsafe(method_family = none)]
538 pub unsafe fn collectionViewContentSize(&self) -> CGSize;
539
540 #[cfg(feature = "UIInterface")]
541 #[unsafe(method(developmentLayoutDirection))]
542 #[unsafe(method_family = none)]
543 pub unsafe fn developmentLayoutDirection(&self) -> UIUserInterfaceLayoutDirection;
544
545 #[unsafe(method(flipsHorizontallyInOppositeLayoutDirection))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn flipsHorizontallyInOppositeLayoutDirection(&self) -> bool;
548 );
549}
550
551impl UICollectionViewLayout {
553 extern_methods!(
554 #[cfg(feature = "UICollectionViewUpdateItem")]
555 #[unsafe(method(prepareForCollectionViewUpdates:))]
556 #[unsafe(method_family = none)]
557 pub unsafe fn prepareForCollectionViewUpdates(
558 &self,
559 update_items: &NSArray<UICollectionViewUpdateItem>,
560 );
561
562 #[unsafe(method(finalizeCollectionViewUpdates))]
563 #[unsafe(method_family = none)]
564 pub unsafe fn finalizeCollectionViewUpdates(&self);
565
566 #[cfg(feature = "objc2-core-foundation")]
567 #[unsafe(method(prepareForAnimatedBoundsChange:))]
568 #[unsafe(method_family = none)]
569 pub unsafe fn prepareForAnimatedBoundsChange(&self, old_bounds: CGRect);
570
571 #[unsafe(method(finalizeAnimatedBoundsChange))]
572 #[unsafe(method_family = none)]
573 pub unsafe fn finalizeAnimatedBoundsChange(&self);
574
575 #[unsafe(method(prepareForTransitionToLayout:))]
576 #[unsafe(method_family = none)]
577 pub unsafe fn prepareForTransitionToLayout(&self, new_layout: &UICollectionViewLayout);
578
579 #[unsafe(method(prepareForTransitionFromLayout:))]
580 #[unsafe(method_family = none)]
581 pub unsafe fn prepareForTransitionFromLayout(&self, old_layout: &UICollectionViewLayout);
582
583 #[unsafe(method(finalizeLayoutTransition))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn finalizeLayoutTransition(&self);
586
587 #[unsafe(method(initialLayoutAttributesForAppearingItemAtIndexPath:))]
588 #[unsafe(method_family = none)]
589 pub unsafe fn initialLayoutAttributesForAppearingItemAtIndexPath(
590 &self,
591 item_index_path: &NSIndexPath,
592 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
593
594 #[unsafe(method(finalLayoutAttributesForDisappearingItemAtIndexPath:))]
595 #[unsafe(method_family = none)]
596 pub unsafe fn finalLayoutAttributesForDisappearingItemAtIndexPath(
597 &self,
598 item_index_path: &NSIndexPath,
599 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
600
601 #[unsafe(method(initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath:))]
602 #[unsafe(method_family = none)]
603 pub unsafe fn initialLayoutAttributesForAppearingSupplementaryElementOfKind_atIndexPath(
604 &self,
605 element_kind: &NSString,
606 element_index_path: &NSIndexPath,
607 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
608
609 #[unsafe(method(finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath:))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn finalLayoutAttributesForDisappearingSupplementaryElementOfKind_atIndexPath(
612 &self,
613 element_kind: &NSString,
614 element_index_path: &NSIndexPath,
615 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
616
617 #[unsafe(method(initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:))]
618 #[unsafe(method_family = none)]
619 pub unsafe fn initialLayoutAttributesForAppearingDecorationElementOfKind_atIndexPath(
620 &self,
621 element_kind: &NSString,
622 decoration_index_path: &NSIndexPath,
623 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
624
625 #[unsafe(method(finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:))]
626 #[unsafe(method_family = none)]
627 pub unsafe fn finalLayoutAttributesForDisappearingDecorationElementOfKind_atIndexPath(
628 &self,
629 element_kind: &NSString,
630 decoration_index_path: &NSIndexPath,
631 ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
632
633 #[unsafe(method(indexPathsToDeleteForSupplementaryViewOfKind:))]
634 #[unsafe(method_family = none)]
635 pub unsafe fn indexPathsToDeleteForSupplementaryViewOfKind(
636 &self,
637 element_kind: &NSString,
638 ) -> Retained<NSArray<NSIndexPath>>;
639
640 #[unsafe(method(indexPathsToDeleteForDecorationViewOfKind:))]
641 #[unsafe(method_family = none)]
642 pub unsafe fn indexPathsToDeleteForDecorationViewOfKind(
643 &self,
644 element_kind: &NSString,
645 ) -> Retained<NSArray<NSIndexPath>>;
646
647 #[unsafe(method(indexPathsToInsertForSupplementaryViewOfKind:))]
648 #[unsafe(method_family = none)]
649 pub unsafe fn indexPathsToInsertForSupplementaryViewOfKind(
650 &self,
651 element_kind: &NSString,
652 ) -> Retained<NSArray<NSIndexPath>>;
653
654 #[unsafe(method(indexPathsToInsertForDecorationViewOfKind:))]
655 #[unsafe(method_family = none)]
656 pub unsafe fn indexPathsToInsertForDecorationViewOfKind(
657 &self,
658 element_kind: &NSString,
659 ) -> Retained<NSArray<NSIndexPath>>;
660 );
661}
662
663impl UICollectionViewLayout {
665 extern_methods!(
666 #[cfg(feature = "objc2-core-foundation")]
667 #[unsafe(method(targetIndexPathForInteractivelyMovingItem:withPosition:))]
668 #[unsafe(method_family = none)]
669 pub unsafe fn targetIndexPathForInteractivelyMovingItem_withPosition(
670 &self,
671 previous_index_path: &NSIndexPath,
672 position: CGPoint,
673 ) -> Retained<NSIndexPath>;
674
675 #[cfg(feature = "objc2-core-foundation")]
676 #[unsafe(method(layoutAttributesForInteractivelyMovingItemAtIndexPath:withTargetPosition:))]
677 #[unsafe(method_family = none)]
678 pub unsafe fn layoutAttributesForInteractivelyMovingItemAtIndexPath_withTargetPosition(
679 &self,
680 index_path: &NSIndexPath,
681 position: CGPoint,
682 ) -> Retained<UICollectionViewLayoutAttributes>;
683
684 #[cfg(feature = "objc2-core-foundation")]
685 #[unsafe(method(invalidationContextForInteractivelyMovingItems:withTargetPosition:previousIndexPaths:previousPosition:))]
686 #[unsafe(method_family = none)]
687 pub unsafe fn invalidationContextForInteractivelyMovingItems_withTargetPosition_previousIndexPaths_previousPosition(
688 &self,
689 target_index_paths: &NSArray<NSIndexPath>,
690 target_position: CGPoint,
691 previous_index_paths: &NSArray<NSIndexPath>,
692 previous_position: CGPoint,
693 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
694
695 #[unsafe(method(invalidationContextForEndingInteractiveMovementOfItemsToFinalIndexPaths:previousIndexPaths:movementCancelled:))]
696 #[unsafe(method_family = none)]
697 pub unsafe fn invalidationContextForEndingInteractiveMovementOfItemsToFinalIndexPaths_previousIndexPaths_movementCancelled(
698 &self,
699 index_paths: &NSArray<NSIndexPath>,
700 previous_index_paths: &NSArray<NSIndexPath>,
701 movement_cancelled: bool,
702 ) -> Retained<UICollectionViewLayoutInvalidationContext>;
703 );
704}