123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- #import "PSTCollectionViewCommon.h"
- #import <CoreGraphics/CoreGraphics.h>
- #import <QuartzCore/QuartzCore.h>
- typedef NS_ENUM(NSUInteger, PSTCollectionViewItemType) {
- PSTCollectionViewItemTypeCell,
- PSTCollectionViewItemTypeSupplementaryView,
- PSTCollectionViewItemTypeDecorationView
- };
- @class PSTCollectionViewLayoutAttributes, PSTCollectionView;
- @interface PSTCollectionViewLayoutAttributes : NSObject <NSCopying>
- @property (nonatomic) CGRect frame;
- @property (nonatomic) CGPoint center;
- @property (nonatomic) CGSize size;
- @property (nonatomic) CATransform3D transform3D;
- @property (nonatomic) CGFloat alpha;
- @property (nonatomic) NSInteger zIndex;
- @property (nonatomic, getter=isHidden) BOOL hidden;
- @property (nonatomic, strong) NSIndexPath *indexPath;
- + (instancetype)layoutAttributesForCellWithIndexPath:(NSIndexPath *)indexPath;
- + (instancetype)layoutAttributesForSupplementaryViewOfKind:(NSString *)elementKind withIndexPath:(NSIndexPath *)indexPath;
- + (instancetype)layoutAttributesForDecorationViewOfKind:(NSString *)kind withIndexPath:(NSIndexPath *)indexPath;
- @end
- @interface PSTCollectionViewLayoutAttributes (Private)
- @property (nonatomic, readonly) NSString *representedElementKind;
- @property (nonatomic, readonly) PSTCollectionViewItemType representedElementCategory;
- - (BOOL)isDecorationView;
- - (BOOL)isSupplementaryView;
- - (BOOL)isCell;
- @end
- @interface PSTCollectionViewLayout : NSObject <NSCoding>
- @property (nonatomic, unsafe_unretained, readonly) PSTCollectionView *collectionView;
- - (void)invalidateLayout;
- - (void)registerClass:(Class)viewClass forDecorationViewOfKind:(NSString *)kind;
- - (void)registerNib:(UINib *)nib forDecorationViewOfKind:(NSString *)kind;
- @end
- @interface PSTCollectionViewLayout (SubclassingHooks)
- + (Class)layoutAttributesClass;
- - (void)prepareLayout;
- - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect;
- - (PSTCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;
- - (PSTCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
- - (PSTCollectionViewLayoutAttributes *)layoutAttributesForDecorationViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
- - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds;
- - (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity;
- - (CGSize)collectionViewContentSize;
- @end
- @interface PSTCollectionViewLayout (UpdateSupportHooks)
- - (void)prepareForCollectionViewUpdates:(NSArray *)updateItems;
- - (void)finalizeCollectionViewUpdates;
- - (PSTCollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath;
- - (PSTCollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingItemAtIndexPath:(NSIndexPath *)itemIndexPath;
- - (PSTCollectionViewLayoutAttributes *)initialLayoutAttributesForInsertedSupplementaryElementOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)elementIndexPath;
- - (PSTCollectionViewLayoutAttributes *)finalLayoutAttributesForDeletedSupplementaryElementOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)elementIndexPath;
- @end
- @interface PSTCollectionViewLayout (Private)
- - (void)setCollectionViewBoundsSize:(CGSize)size;
- - (PSTCollectionReusableView *)decorationViewForCollectionView:(PSTCollectionView *)collectionView withReuseIdentifier:(NSString *)reuseIdentifier indexPath:(NSIndexPath *)indexPath;
- @end
|