PSTCollectionViewData.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // PSTCollectionViewData.h
  3. // PSPDFKit
  4. //
  5. // Copyright (c) 2012-2013 Peter Steinberger. All rights reserved.
  6. //
  7. #import "PSTCollectionViewCommon.h"
  8. @class PSTCollectionView, PSTCollectionViewLayout, PSTCollectionViewLayoutAttributes;
  9. // https://github.com/steipete/iOS6-Runtime-Headers/blob/master/UICollectionViewData.h
  10. @interface PSTCollectionViewData : NSObject
  11. // Designated initializer.
  12. - (id)initWithCollectionView:(PSTCollectionView *)collectionView layout:(PSTCollectionViewLayout *)layout;
  13. // Ensure data is valid. may fetches items from dataSource and layout.
  14. - (void)validateLayoutInRect:(CGRect)rect;
  15. - (CGRect)rectForItemAtIndexPath:(NSIndexPath *)indexPath;
  16. /*
  17. - (CGRect)rectForSupplementaryElementOfKind:(id)arg1 atIndexPath:(id)arg2;
  18. - (CGRect)rectForDecorationElementOfKind:(id)arg1 atIndexPath:(id)arg2;
  19. - (CGRect)rectForGlobalItemIndex:(int)arg1;
  20. */
  21. // No fucking idea (yet)
  22. - (NSUInteger)globalIndexForItemAtIndexPath:(NSIndexPath *)indexPath;
  23. - (NSIndexPath *)indexPathForItemAtGlobalIndex:(NSInteger)index;
  24. // Fetch layout attributes
  25. - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect;
  26. /*
  27. - (PSTCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;
  28. - (PSTCollectionViewLayoutAttributes *)layoutAttributesForElementsInSection:(NSInteger)section;
  29. - (PSTCollectionViewLayoutAttributes *)layoutAttributesForGlobalItemIndex:(NSInteger)index;
  30. - (PSTCollectionViewLayoutAttributes *)layoutAttributesForDecorationViewOfKind:(id)arg1 atIndexPath:(NSIndexPath *)indexPath;
  31. - (PSTCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(id)arg1 atIndexPath:(NSIndexPath *)indexPath;
  32. - (id)existingSupplementaryLayoutAttributesInSection:(int)arg1;
  33. */
  34. // Make data to re-evaluate dataSources.
  35. - (void)invalidate;
  36. // Access cached item data
  37. - (NSInteger)numberOfItemsBeforeSection:(NSInteger)section;
  38. - (NSInteger)numberOfItemsInSection:(NSInteger)section;
  39. - (NSInteger)numberOfItems;
  40. - (NSInteger)numberOfSections;
  41. // Total size of the content.
  42. - (CGRect)collectionViewContentRect;
  43. @property (readonly) BOOL layoutIsPrepared;
  44. /*
  45. - (void)_setLayoutAttributes:(id)arg1 atGlobalItemIndex:(int)arg2;
  46. - (void)_setupMutableIndexPath:(id*)arg1 forGlobalItemIndex:(int)arg2;
  47. - (id)_screenPageForPoint:(struct CGPoint { float x1; float x2; })arg1;
  48. - (void)_validateContentSize;
  49. - (void)_validateItemCounts;
  50. - (void)_updateItemCounts;
  51. - (void)_loadEverything;
  52. - (void)_prepareToLoadData;
  53. - (void)invalidate:(BOOL)arg1;
  54. */
  55. @end