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