2021-05-30 08:53:03 +00:00
|
|
|
/* Definition of class NSCollectionViewFlowLayout
|
|
|
|
Copyright (C) 2021 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
By: Gregory John Casamento
|
|
|
|
Date: 30-05-2021
|
|
|
|
|
|
|
|
This file is part of the GNUstep Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NSCollectionViewFlowLayout_h_GNUSTEP_GUI_INCLUDE
|
|
|
|
#define _NSCollectionViewFlowLayout_h_GNUSTEP_GUI_INCLUDE
|
|
|
|
|
|
|
|
#import <AppKit/NSCollectionViewLayout.h>
|
2022-10-10 20:02:18 +00:00
|
|
|
#import <AppKit/AppKitDefines.h>
|
2021-05-30 08:53:03 +00:00
|
|
|
|
2022-11-28 06:20:25 +00:00
|
|
|
@class NSCollectionViewLayout, NSMutableIndexSet;
|
2022-07-16 09:44:17 +00:00
|
|
|
|
2021-05-31 11:47:58 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_11, GS_API_LATEST)
|
2021-05-30 08:53:03 +00:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-05-31 11:47:58 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
NSCollectionViewScrollDirectionVertical,
|
|
|
|
NSCollectionViewScrollDirectionHorizontal
|
|
|
|
};
|
|
|
|
typedef NSInteger NSCollectionViewScrollDirection;
|
|
|
|
|
2022-11-28 06:55:09 +00:00
|
|
|
APPKIT_EXPORT NSCollectionViewSupplementaryElementKind NSCollectionElementKindSectionHeader;
|
|
|
|
APPKIT_EXPORT NSCollectionViewSupplementaryElementKind NSCollectionElementKindSectionFooter;
|
2021-05-31 11:47:58 +00:00
|
|
|
|
2022-10-10 20:02:18 +00:00
|
|
|
APPKIT_EXPORT_CLASS
|
2021-05-31 11:47:58 +00:00
|
|
|
@interface NSCollectionViewFlowLayoutInvalidationContext : NSCollectionViewLayoutInvalidationContext
|
|
|
|
{
|
|
|
|
BOOL _invalidateFlowLayoutDelegateMetrics;
|
|
|
|
BOOL _invalidateFlowLayoutAttributes;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setInvalidateFlowLayoutDelegateMetrics: (BOOL)flag;
|
|
|
|
- (BOOL) invalidateFlowLayoutDelegateMetrics;
|
|
|
|
|
|
|
|
- (void) setInvalidateFlowLayoutAttributes: (BOOL)flag;
|
|
|
|
- (BOOL) invalidateFlowLayoutAttributes;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol NSCollectionViewDelegateFlowLayout <NSCollectionViewDelegate>
|
|
|
|
|
|
|
|
- (NSSize) collectionView: (NSCollectionView *)collectionView
|
|
|
|
layout: (NSCollectionViewLayout*)collectionViewLayout
|
|
|
|
sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
|
|
|
|
|
|
|
- (NSEdgeInsets)collectionView: (NSCollectionView *)collectionView
|
2022-07-16 11:56:13 +00:00
|
|
|
layout: (NSCollectionViewLayout *)collectionViewLayout
|
2021-05-31 11:47:58 +00:00
|
|
|
insetForSectionAtIndex: (NSInteger)section;
|
|
|
|
|
|
|
|
- (CGFloat) collectionView: (NSCollectionView *)collectionView
|
2022-07-16 11:56:13 +00:00
|
|
|
layout: (NSCollectionViewLayout *)collectionViewLayout
|
2021-05-31 11:47:58 +00:00
|
|
|
minimumLineSpacingForSectionAtIndex: (NSInteger)section;
|
|
|
|
|
|
|
|
- (CGFloat) collectionView: (NSCollectionView *)collectionView
|
2022-07-16 11:56:13 +00:00
|
|
|
layout: (NSCollectionViewLayout *)collectionViewLayout
|
2021-05-31 11:47:58 +00:00
|
|
|
minimumInteritemSpacingForSectionAtIndex: (NSInteger)section;
|
|
|
|
|
|
|
|
- (NSSize) collectionView: (NSCollectionView *)collectionView
|
2022-07-16 11:56:13 +00:00
|
|
|
layout: (NSCollectionViewLayout *)collectionViewLayout
|
2021-05-31 11:47:58 +00:00
|
|
|
referenceSizeForHeaderInSection: (NSInteger)section;
|
|
|
|
|
|
|
|
- (NSSize) collectionView: (NSCollectionView *)collectionView
|
2022-07-16 11:56:13 +00:00
|
|
|
layout: (NSCollectionViewLayout *)collectionViewLayout
|
|
|
|
referenceSizeForFooterInSection: (NSInteger)section;
|
2021-05-31 11:47:58 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2022-10-10 20:02:18 +00:00
|
|
|
APPKIT_EXPORT_CLASS
|
2021-05-30 08:53:03 +00:00
|
|
|
@interface NSCollectionViewFlowLayout : NSCollectionViewLayout
|
2021-05-31 11:47:58 +00:00
|
|
|
{
|
|
|
|
CGFloat _minimumLineSpacing;
|
|
|
|
CGFloat _minimumInteritemSpacing;
|
|
|
|
NSSize _itemSize;
|
|
|
|
NSSize _estimatedItemSize;
|
|
|
|
NSCollectionViewScrollDirection _scrollDirection;
|
|
|
|
NSSize _headerReferenceSize;
|
|
|
|
NSSize _footerReferenceSize;
|
|
|
|
NSEdgeInsets _sectionInset;
|
|
|
|
BOOL _sectionHeadersPinToVisibleBounds;
|
|
|
|
BOOL _sectionFootersPinToVisibleBounds;
|
2022-07-16 09:44:17 +00:00
|
|
|
NSMutableIndexSet *_collapsedSections;
|
2022-07-17 12:32:29 +00:00
|
|
|
|
|
|
|
NSInteger _ds; // deltas for when overflow happens...
|
|
|
|
NSInteger _dr;
|
|
|
|
|
2021-05-31 11:47:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (CGFloat) minimumLineSpacing;
|
|
|
|
- (void) setMinimumLineSpacing: (CGFloat)spacing;
|
|
|
|
|
|
|
|
- (CGFloat) minimumInteritemSpacing;
|
|
|
|
- (void) setMinimumInteritemSpacing: (CGFloat)spacing;
|
|
|
|
|
|
|
|
- (NSSize) itemSize;
|
|
|
|
- (void) setItemSize: (NSSize)itemSize;
|
|
|
|
|
|
|
|
- (NSSize) estimatedItemSize;
|
|
|
|
- (void) setEstimatedItemSize: (NSSize)size;
|
|
|
|
|
|
|
|
- (NSCollectionViewScrollDirection) scrollDirection;
|
|
|
|
- (void) setScrollDirection: (NSCollectionViewScrollDirection)direction;
|
|
|
|
|
|
|
|
- (NSSize) headerReferenceSize;
|
|
|
|
- (void) setHeaderReferenceSize: (NSSize)size;
|
|
|
|
|
|
|
|
- (NSSize) footerReferenceSize;
|
|
|
|
- (void) setFooterReferenceSize: (NSSize)size;
|
|
|
|
|
|
|
|
- (NSEdgeInsets) sectionInset;
|
|
|
|
- (void) setSectionInset: (NSEdgeInsets)inset;
|
|
|
|
|
|
|
|
- (BOOL) sectionHeadersPinToVisibleBounds;
|
|
|
|
- (void) setSectionHeadersPinToVisibleBounds: (BOOL)f;
|
|
|
|
|
|
|
|
- (BOOL) sectionFootersPinToVisibleBounds;
|
|
|
|
- (void) setSectionFootersPinToVisibleBounds: (BOOL)f;
|
|
|
|
|
|
|
|
- (BOOL) sectionAtIndexIsCollapsed: (NSUInteger)sectionIndex;
|
|
|
|
|
|
|
|
- (void) collapseSectionAtIndex: (NSUInteger)sectionIndex;
|
|
|
|
|
|
|
|
- (void) expandSectionAtIndex: (NSUInteger)sectionIndex;
|
2021-05-30 08:53:03 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* GS_API_MACOSX */
|
|
|
|
|
|
|
|
#endif /* _NSCollectionViewFlowLayout_h_GNUSTEP_GUI_INCLUDE */
|
|
|
|
|