NSObject(RRSpreadSheetDataSource)



Abstract

RRSpreadSheet DataSource informal protocol

Discussion

This is the informal protocol that spreadsheet data sources must implement. Note that each worksheet can have a different data source object

Methods

numberOfColumnsInWorksheet:

Abstract: return the number of columns in the worksheet
- (int)numberOfColumnsInWorksheet:(RRSSWorksheet*)worksheet; 

This method is called by the worksheet to determine the number of columns it needs to create to support the data source. Note that if autoresizing is enabled, then the number of columns may increase beyond this number

Parameters

NameDescription
worksheetthe requesting worksheet
Result: the data source object must return an integer with the number of columns needed in the worksheet

numberOfRowsInWorksheet:

Abstract: return the number of rows in the worksheet
- (int)numberOfRowsInWorksheet:(RRSSWorksheet*)worksheet; 

This method is called by the worksheet to determine the number of rows it needs to create to support the data source. Note that if autoresizing is enabled, then the number of rows may increase beyond this number

Parameters

NameDescription
worksheetthe requesting worksheet
Result: the data source object must return an integer with the number of rows needed in the worksheet

worksheet:acceptDrop:row:column:dropOperation:

Abstract: documentation forthcoming
- (BOOL)worksheet:(RRSSWorksheet*)worksheet acceptDrop:(id )info
 row:(int)row column:(int)col dropOperation:(NSTableViewDropOperation)op; 


worksheet:headerLabelForColumn:

Abstract: return the label for a column
- (NSString*)worksheet:(RRSSWorksheet*)worksheet headerLabelForColumn:(int)col; 

this method is used to ask the datasource for the label for the header of specific columns. If this method is not implemented by the datasource, the worksheet will use default header labels

Parameters

NameDescription
rowthis is an integer holding the row number of the header
Result: the data source must return an NSString holding the label for the header.

worksheet:headerLabelForRow:

Abstract: return the label for a row
- (NSString*)worksheet:(RRSSWorksheet*)worksheet headerLabelForRow:(int)row; 

this method is used to ask the datasource for the label for the header of specific rows. If this method is not implemented by the datasource, the worksheet will use default header labels

Parameters

NameDescription
rowthis is an integer holding the row number of the header
Result: the data source must return an NSString holding the label for the header.

worksheet:objectValueForRow:column:

Abstract: returns the value of a worksheet cell for a row/column
- (id)worksheet:(RRSSWorksheet*)worksheet objectValueForRow:(unsigned int)row column:(int)col; 

This method is called by the worksheet on the data source to determine the value of a cell. The current implementation expects an NSString object from the data source

Parameters

NameDescription
worksheetthe worksheet requesting the row/column value
rowthe row of the needed object value
colthe column of the needed object value
Result: the data source should return the value of the cell at the given row and column. The current implementation expects an NSString object.

worksheet:setHeaderLabel:forColumn:

Abstract: tell the datasource that a column header label has changed
- (void)worksheet:(RRSSWorksheet*)worksheet setHeaderLabel:(NSString*)label forColumn:(int)column; 

this method is used by the worksheet to tell its datasource when the label for a header has changed

Parameters

NameDescription
worksheetthe calling worksheet
labelthe new header label
columnthe header's column index

worksheet:setHeaderLabel:forRow:

Abstract: tell the datasource that a row header label has changed
- (void)worksheet:(RRSSWorksheet*)worksheet setHeaderLabel:(NSString*)label forRow:(int)row; 

this method is used by the worksheet to tell its datasource when the label for a header has changed

Parameters

NameDescription
worksheetthe calling worksheet
labelthe new header label
rowthe header's row index

worksheet:setObjectValue:forRow:column:

Abstract: tell the datasource that a cell value has changed
- (void)worksheet:(RRSSWorksheet*)worksheet setObjectValue:(id)object forRow:(int)row column:(int)col; 

this method is used by the worksheet to tell its datasource when the value of a cell has changed

Parameters

NameDescription
worksheetthe calling worksheet
objectthe new object for the cell
rowthe cell's row
columnthe cell's column

worksheet:validateDrop:proposedRow:column:proposedDropOperation:

Abstract: documentation forthcoming
- (NSDragOperation)worksheet:(RRSSWorksheet*)worksheet validateDrop:(id )info
 proposedRow:(int)row column:(int)col proposedDropOperation:(NSTableViewDropOperation)op; 


worksheet:writeCells:toPasteboard:

Abstract: documentation forthcoming
- (BOOL)worksheet:(RRSSWorksheet*)worksheet writeCells:(NSArray*)cells toPasteboard:(NSPasteboard*)pboard; 


(Last Updated 4/30/2002)