#import <Cocoa/Cocoa.h>

/*

 As the timer progresses, we'll be asked to draw the table.  But when the timer is active, I want to draw the table
 myself, using the visibleRect, and going through every row in the table and seeing if its current position is in the visible
 rect, and if so, drawing it in its current position.

 That current position will be somewhere between the old position and the new position.  I think I need, then, as list of
 *ALL* the rows and their old/new positions ... Is there any way to optimize?  When I redraw the table, I need to know about all of the rows that are moving at all (since they may move through the visible rectangle) that are moving from positions below to above the visible row (or vice-versa) or from above/below to within.  Plus, I need a list of unmoving rows.  Yikes!

 So let's say that at the start of the move, I figure out which physical row#s are visible, say 5 to 45.  So now I know that I need to display any data rows that might move through this.  Let's say for simplicity that I have an array whose elements respond to -[NSArray oldIndex] as a category.  So I can loop through the array and collect up all the rows that I care about, by getting each element's current (new) index and its old index, and seeing if it intersects the visible rows.  I care about the data row if:
 		oldIndex <= lastVisibleRow  && newIndex >= firstVisibleRow (visually from above the bottom to below the top)
 		oldIndex >= firstVisibleRow && newIndex <= lastVisibleRow  (visualy from below the top to above the bottom)

 I can also use a method -[NSArray newIndex] to do pre-sorting of the same kind, if we are arranging BEFORE the sort?

 So I need a list of the data rows to animate, and for each of those rows, I can ask it where it is (this is the item# in the array) and where it was from oldIndex.  OK, goood.

 
 */

@interface SwappingTableView : NSTableView
{
	NSTimer *mTimer;
	NSSet *mDataRows;		// row#s in the data array that we need to animate

}

- (void) rearrangeRows:(NSArray *)fromRowNumbers toRows:(NSArray *)toRowNumbers;

@end
