2 // PXSourceListDelegate.h
5 // Created by Alex Rozanski on 17/10/2009.
6 // Copyright 2009-10 Alex Rozanski http://perspx.com
9 #import <Cocoa/Cocoa.h>
13 @protocol PXSourceListDelegate <NSObject>
17 - (BOOL)sourceList:(PXSourceList*)aSourceList isGroupAlwaysExpanded:(id)group;
18 - (NSMenu*)sourceList:(PXSourceList*)aSourceList menuForEvent:(NSEvent*)theEvent item:(id)item;
20 //Basically NSOutlineViewDelegate wrapper methods
21 - (BOOL)sourceList:(PXSourceList*)aSourceList shouldSelectItem:(id)item;
22 - (NSIndexSet*)sourceList:(PXSourceList*)aSourceList selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes;
24 - (BOOL)sourceList:(PXSourceList*)aSourceList shouldEditItem:(id)item;
26 - (BOOL)sourceList:(PXSourceList*)aSourceList shouldTrackCell:(NSCell *)cell forItem:(id)item;
28 - (BOOL)sourceList:(PXSourceList*)aSourceList shouldExpandItem:(id)item;
29 - (BOOL)sourceList:(PXSourceList*)aSourceList shouldCollapseItem:(id)item;
31 - (CGFloat)sourceList:(PXSourceList*)aSourceList heightOfRowByItem:(id)item;
33 - (NSCell*)sourceList:(PXSourceList*)aSourceList willDisplayCell:(id)cell forItem:(id)item;
34 - (NSCell*)sourceList:(PXSourceList*)aSourceList dataCellForItem:(id)item;
38 @interface NSObject (PXSourceListNotifications)
41 - (void)sourceListSelectionIsChanging:(NSNotification *)notification;
42 - (void)sourceListSelectionDidChange:(NSNotification *)notification;
44 //Item expanding/collapsing
45 - (void)sourceListItemWillExpand:(NSNotification *)notification;
46 - (void)sourceListItemDidExpand:(NSNotification *)notification;
47 - (void)sourceListItemWillCollapse:(NSNotification *)notification;
48 - (void)sourceListItemDidCollapse:(NSNotification *)notification;
50 - (void)sourceListDeleteKeyPressedOnRows:(NSNotification *)notification;
55 //PXSourceList delegate notifications
56 extern NSString * const PXSLSelectionIsChangingNotification;
57 extern NSString * const PXSLSelectionDidChangeNotification;
58 extern NSString * const PXSLItemWillExpandNotification;
59 extern NSString * const PXSLItemDidExpandNotification;
60 extern NSString * const PXSLItemWillCollapseNotification;
61 extern NSString * const PXSLItemDidCollapseNotification;
62 extern NSString * const PXSLDeleteKeyPressedOnRowsNotification;