- Inherits From:
- NSObject
- Conforms To:
- RTSQLDataSource
- Declared In:
- RTEditableDataSource.h
RTDataMode_Edit 0
RTDataMode_Find 1
RTDataMode_ReadOnly 2
Description:
Constants used for the current mode of the DataSource.
- - delegate
- - setDelegate:
- - session
- - setSession:
- - database
- - setDatabase:
- - table
- - setTable:
- - useBackgroundThread
- - setUseBackgroundThread:
- - rowCount
- - currentRowIndex
- - currentRow
- - nextRow
- - whereConditions
- - setWhereConditions:
- - sortOrder
- - setSortOrder:
- - deleteCurrentRow
- - insertNewRow
- - duplicateCurrentRow
- - canMoveForward
- - canMoveBackward
- - canMoveToStart
- - canMoveToEnd
- - reloadData:
- - moveForward:
- - moveBackward:
- - moveToStart:
- - moveToEnd:
- - doInsertRow:
- - doDeleteCurrentRow:
- - doDuplicateCurrentRow:
- (BOOL)canMoveBackward
Returns YES if the currentRow can be be changed by moving backward.
- (BOOL)canMoveForward
Returns YES if the currentRow can be be changed by moving forward.
- (BOOL)canMoveToEnd
Returns YES if the currentRow can be be changed by moving to the last row.
- (BOOL)canMoveToStart
Returns YES if the currentRow can be be changed by moving to the first row.
- (id <RTSQLRow>)currentRow
Returns the current row.
- (SInt32)currentRowIndex
Returns the 1-based index to the current row.
- (id <RTSQLDatabase>)database
Returns the database used by this data source.
- (id)delegate
Returns the delegate object.
- (BOOL)deleteCurrentRow
Deletes the current row. Returns YES on success, NO on failure.
- (IBAction)doDeleteCurrentRow:(id)sender
Action method that calls deleteCurrentRow and ignores the result.
- (IBAction)doDuplicateCurrentRow:(id)sender
Action method that calls duplicateCurrentRow and ignores the result.
- (IBAction)doInsertRow:(id)sender
Action method that calls insertRow and ignores the result.
- (BOOL)duplicateCurrentRow
Duplicates the current row into a new row at the end. Returns YES on success, NO on failure.
- (BOOL)insertNewRow
Inserts a new row at the end. Returns YES on success, NO on failure.
- (IBAction)moveBackward:(id)sender
Moves the current row backward by one row. Can fail if the delegate refuses to allow the current row to change.
- (IBAction)moveForward:(id)sender
Moves the current row forward by one row. Can fail if the delegate refuses to allow the current row to change.
- (IBAction)moveToEnd:(id)sender
Moves the current row to the last row. Can fail if the delegate refuses to allow the current row to change.
- (IBAction)moveToStart:(id)sender
Moves the current row to the first row. Can fail if the delegate refuses to allow the current row to change.
- (id <RTSQLRow>)nextRow
Moves to the next row and returns it. If nil is returned either the currentRow is the last row or the delegate did not allow the current row to be changed.
- (IBAction)reloadData:(id)sender
Builds the appropriate query and executes it.
- (SInt32)rowCount
Returns the number of rows returned from the database. If all the rows haven't been fetched, they will all be fetched before this method returns.
- (id <RTSQLSession>)session
Returns the session used by this data source.
- (void)setDatabase:(id <RTSQLDatabase>)inDatabase
Sets the database used by this data source.
- (void)setDelegate:(id)inDelegate
Sets the delegate object.
- (void)setSession:(id <RTSQLSession>)inSession
Sets the session used by this data source.
- (void)setSortOrder:(NSString*)str
Sets the sort order clause used by this data source.
- (void)setTable:(id <RTSQLTable>)inTable
Sets the SQL table used by this data source.
- (void)setUseBackgroundThread:(BOOL)thread
Sets if this data source performs database operations in a background thread. Warning: this message will block if a background operation is in progress.
- (void)setWhereConditions:(NSString*)str
Sets the base where conditions used by this data source.
- (NSString*)sortOrder
Returns the sort order clause used by this data source.
- (id <RTSQLTable>)table
Returns the SQL table used by this data source.
- (BOOL)useBackgroundThread
Returns YES if this data source performs database operations in a background thread.
- (NSString*)whereConditions
Returns the base where conditions used by this data source.
- (void)editableDataSource:(RTEditableDataSource *)dataSource didInsertRow:(id<RTSQLRow>)row
Sent after the editable data source adds an empty row. This message will be preceded by a call to editableDataSourceShouldChangeCurrentRow: and followed with a call to editableDataSourceDidChangeCurrentRow:.
- (void)editableDataSource:(RTEditableDataSource *)dataSource errorDuringOperation:(NSString*)operation exception:(NSException*)exception
Sent when an error happens during a database operation. The operation will be one of the following: SELECT, INSERT, UPDATE, DELETE. If possible, the requested action will be reverted.
- (void)editableDataSourceDidChangeCurrentRow:(RTEditableDataSource *)dataSource
Sent after the editable data source changes the current row.
- (void)editableDataSourceDidCompleteBackgroundFetch:(RTEditableDataSource *)dataSource
Called after dataSource completes fetching data in a background thread.
- (void)editableDataSourceDidDeleteCurrentRow:(RTEditableDataSource *)dataSource
Sent after the editable data source deletes the current row. This message will be followed with a call to editableDataSourceDidChangeCurrentRow:.
- (BOOL)editableDataSourceShouldChangeCurrentRow:(RTEditableDataSource *)dataSource
Sent before the editable data source changes the current row. The current row will not be changed if NO is returned.
- (BOOL)editableDataSourceShouldDeleteCurrentRow:(RTEditableDataSource *)dataSource
Sent before the editable data source deletes the current row. The current row will not be deleted if NO is returned.
- (void)editableDataSourceWillBeginBackgroundFetch:(RTEditableDataSource *)dataSource
Called before dataSource beings fetching data in a background thread.
- (void)editableDataSourceWorkingOnBackgroundFetch:(RTEditableDataSource *)dataSource percentComplete:(float)percent
Called while dataSource is fetching data in a background thread. percent will be a value from 0.0 to 1.0 suitable for use in a progress bar. If percent is less than 0.0, then the amount complete is indeterminate.
RTEditableDataSource posts the following notifications to interested observers.
This notification object contains the RTEditableDataSource as the notification object. It is posted when the currentRow of the data source has changed.
This notification object contains the RTEditableDataSource as the notification object. It is posted when changes to the currentRow of the data source have been saved.
This notification object contains the RTEditableDataSource as the notification object. It is posted when changes to the currentRow of the data source have been reverted.