PSTGridLayoutInfo.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // PSTGridLayoutInfo.h
  3. // PSPDFKit
  4. //
  5. // Copyright (c) 2012-2013 Peter Steinberger. All rights reserved.
  6. //
  7. #import <UIKit/UIKit.h>
  8. @class PSTGridLayoutSection;
  9. /*
  10. Every PSTCollectionViewLayout has a PSTGridLayoutInfo attached.
  11. Is used extensively in PSTCollectionViewFlowLayout.
  12. */
  13. @interface PSTGridLayoutInfo : NSObject
  14. @property (nonatomic, strong, readonly) NSArray *sections;
  15. @property (nonatomic, strong) NSDictionary *rowAlignmentOptions;
  16. @property (nonatomic, assign) BOOL usesFloatingHeaderFooter;
  17. // Vertical/horizontal dimension (depending on horizontal)
  18. // Used to create row objects
  19. @property (nonatomic, assign) CGFloat dimension;
  20. @property (nonatomic, assign) BOOL horizontal;
  21. @property (nonatomic, assign) BOOL leftToRight;
  22. @property (nonatomic, assign) CGSize contentSize;
  23. // Frame for specific PSTGridLayoutItem.
  24. - (CGRect)frameForItemAtIndexPath:(NSIndexPath *)indexPath;
  25. // Add new section. Invalidates layout.
  26. - (PSTGridLayoutSection *)addSection;
  27. // forces the layout to recompute on next access
  28. // TODO; what's the parameter for?
  29. - (void)invalidate:(BOOL)arg;
  30. // Make a copy of the current state.
  31. - (PSTGridLayoutInfo *)snapshot;
  32. @end