2005-06-02 14:16:43 -04:00
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2021-01-30 20:14:08 -03:00
|
|
|
extern NSString *CogDNDIndexType;
|
2008-02-13 14:14:19 -03:00
|
|
|
extern NSString *CogUrlsPboardType;
|
2007-02-17 12:58:39 -03:00
|
|
|
extern NSString *iTunesDropType;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2021-01-27 19:09:09 -03:00
|
|
|
@interface DNDArrayController : NSArrayController <NSTableViewDataSource>
|
|
|
|
|
|
|
|
@property IBOutlet NSTableView *tableView;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
|
|
|
// table view drag and drop support
|
2022-02-07 02:49:27 -03:00
|
|
|
- (id<NSPasteboardWriting>)tableView:(NSTableView *)tableView
|
|
|
|
pasteboardWriterForRow:(NSInteger)row;
|
2021-01-30 20:14:08 -03:00
|
|
|
- (void)tableView:(NSTableView *)tableView
|
|
|
|
draggingSession:(NSDraggingSession *)session
|
|
|
|
willBeginAtPoint:(NSPoint)screenPoint
|
|
|
|
forRowIndexes:(NSIndexSet *)rowIndexes;
|
2021-01-27 19:09:09 -03:00
|
|
|
- (NSDragOperation)tableView:(NSTableView *)tableView
|
2022-02-07 02:49:27 -03:00
|
|
|
validateDrop:(id<NSDraggingInfo>)info
|
2021-01-30 20:14:08 -03:00
|
|
|
proposedRow:(NSInteger)row
|
2021-01-27 19:09:09 -03:00
|
|
|
proposedDropOperation:(NSTableViewDropOperation)dropOperation;
|
|
|
|
- (BOOL)tableView:(NSTableView *)tableView
|
2022-02-07 02:49:27 -03:00
|
|
|
acceptDrop:(id<NSDraggingInfo>)info
|
2021-01-30 20:14:08 -03:00
|
|
|
row:(NSInteger)row
|
2021-01-27 19:09:09 -03:00
|
|
|
dropOperation:(NSTableViewDropOperation)dropOperation;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
|
|
|
// utility methods
|
2022-02-07 02:49:27 -03:00
|
|
|
- (void)moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet *)indexSet
|
|
|
|
toIndex:(NSUInteger)insertIndex;
|
2022-01-21 02:48:23 -03:00
|
|
|
// This is needed to undo the above
|
|
|
|
- (void)moveObjectsFromIndex:(NSUInteger)fromIndex
|
|
|
|
toArrangedObjectIndexes:(NSIndexSet *)indexSet;
|
2008-02-10 16:35:58 -03:00
|
|
|
|
2005-06-02 14:16:43 -04:00
|
|
|
@end
|