#import <Cocoa/Cocoa.h>

@interface CHTextView : NSTextView {
	NSEvent *lastMenuEvent;
}

// Finding the Clicked Area
- (NSTextTableBlock *) clickedCell;
- (int) clickedIndex;
- (NSTextTableBlock *) tableCellAtIndex:(int)index forAttributedString:(NSAttributedString *)string;

// Addings and Deleting Rows
- (IBAction) addRowAbove:(id)sender;
- (IBAction) addRowBelow:(id)sender;
- (IBAction) deleteRow:(id)sender;

// Adding and Deleting Columns
- (IBAction) addColumnBefore:(id)sender;
- (IBAction) addColumnAfter:(id)sender;
- (IBAction) deleteColumn:(id)sender;

// Modelling the Table as an Array
- (NSMutableArray *) clickedTableAsArray;
- (void) replaceClickedArrayWithTableFromArray:(NSArray *)tableArray;

// Working with NSTextTableBlocks
- (NSTextTableBlock *) textTableBlock:(NSTextTableBlock *)block cloningAttributesFrom:(NSTextTableBlock *)otherBlock;
- (NSAttributedString *) setTableCell:(NSTextTableBlock *)cell forAttributedString:(NSAttributedString *)string;

@end