|
| 1 | +// |
| 2 | +// AMCollectionView.h |
| 3 | +// AMCollectionViewTest |
| 4 | +// |
| 5 | +// Created by Andreas on 19.11.07. |
| 6 | +// Copyright 2007 Andreas Mayer. All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +// functionality is similar to NSCollectionView |
| 10 | +// - handles rows only for now |
| 11 | +// - no constraints for number of rows or view sizes |
| 12 | + |
| 13 | + |
| 14 | +#import <Cocoa/Cocoa.h> |
| 15 | + |
| 16 | +@class AMCollectionViewItem; |
| 17 | + |
| 18 | + |
| 19 | +@interface AMCollectionView : NSControl { |
| 20 | + IBOutlet AMCollectionViewItem *itemPrototype; |
| 21 | + NSArray *backgroundColors; |
| 22 | + NSArray *content; |
| 23 | + BOOL selectable; |
| 24 | + BOOL allowsMultipleSelection; |
| 25 | + NSDictionary *am_itemsForObjects; |
| 26 | + BOOL am_needsLayout; |
| 27 | + NSData *am_archivedItemPrototype; |
| 28 | + BOOL am_itemRespondsToSizeForViewWithProposedSize; |
| 29 | + BOOL am_drawsBackground; |
| 30 | + BOOL usesAlternatingRowBackgroundColors; |
| 31 | + NSColor *selectedRowColor; |
| 32 | + NSColor *secondarySelectedRowColor; |
| 33 | + BOOL am_initializing; |
| 34 | + float rowHeight; |
| 35 | + BOOL am_isFirstResponder; |
| 36 | +} |
| 37 | + |
| 38 | +- (AMCollectionViewItem *)itemPrototype; |
| 39 | +- (void)setItemPrototype:(AMCollectionViewItem *)value; |
| 40 | + |
| 41 | +- (NSArray *)backgroundColors; |
| 42 | +- (void)setBackgroundColors:(NSArray *)value; |
| 43 | + |
| 44 | +- (float)rowHeight; |
| 45 | +- (void)setRowHeight:(float)value; |
| 46 | + |
| 47 | +- (NSArray *)content; |
| 48 | +- (void)setContent:(NSArray *)value |
| 49 | + itemClass:(Class)itemClass; |
| 50 | + |
| 51 | +- (NSIndexSet *)selectionIndexes; |
| 52 | +- (void)setSelectionIndexes:(NSIndexSet *)value; |
| 53 | + |
| 54 | +- (BOOL)isSelectable; |
| 55 | +- (void)setSelectable:(BOOL)value; |
| 56 | + |
| 57 | +- (BOOL)allowsMultipleSelection; |
| 58 | +- (void)setAllowsMultipleSelection:(BOOL)value; |
| 59 | + |
| 60 | +- (BOOL)drawsBackground; |
| 61 | +- (void)setDrawsBackground:(BOOL)value; |
| 62 | + |
| 63 | +- (BOOL)usesAlternatingRowBackgroundColors; |
| 64 | +- (void)setUsesAlternatingRowBackgroundColors:(BOOL)value; |
| 65 | + |
| 66 | +- (NSColor *)selectedRowColor; |
| 67 | +- (void)setSelectedRowColor:(NSColor *)value; |
| 68 | + |
| 69 | +- (NSColor *)secondarySelectedRowColor; |
| 70 | +- (void)setSecondarySelectedRowColor:(NSColor *)value; |
| 71 | + |
| 72 | +- (BOOL)isFirstResponder; |
| 73 | + |
| 74 | +- (AMCollectionViewItem *)newItemForRepresentedObject:(id)object; |
| 75 | + |
| 76 | +- (AMCollectionViewItem *)itemForObject:(id)object; |
| 77 | + |
| 78 | +- (id)objectForView:(NSView*)view ; |
| 79 | + |
| 80 | +- (NSArray *)selectedObjects; |
| 81 | +- (void)selectItemsForObjects:(NSArray *)objects; |
| 82 | + |
| 83 | +- (void)deselectAll:(id)sender; |
| 84 | + |
| 85 | +- (void)noteSizeForItemsChanged:(NSArray *)items; |
| 86 | + |
| 87 | +- (void)scrollObjectToVisible:(id)object; |
| 88 | + |
| 89 | + |
| 90 | +@end |
| 91 | + |
| 92 | + |
| 93 | +APPKIT_EXTERN NSString *const AMCollectionViewSelectionDidChangeNotification; |
| 94 | + |
| 95 | + |
| 96 | +@interface NSObject (AMCollectionViewDelegate) |
| 97 | +- (void)collectionViewSelectionDidChange:(NSNotification *)aNotification; |
| 98 | +@end |
0 commit comments