objc2_ui_kit/generated/
UICollectionViewLayout.rs

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