CatNiP prefinal
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
Delegate and datasource for CatNipViewController's tableviews' when LIBRARYTYPE == LOCAL. More...
#import <LocalDelegateDataSource.h>
Public Member Functions | |
(void) | - alertView:clickedButtonAtIndex: |
Alertview's buttons target-action method. | |
(void) | - changeLibraryTypeToLocal |
sets master's tableviews' delegates and datasources to this and reloads their data. | |
(UITableViewCell *) | - createTableCellLeft: |
Prototype for libTabL's tableView:cellForRowAtIndexPath function. | |
(UITableViewCell *) | - createTableCellRight: |
Prototype for libTabR's tableView:cellForRowAtIndexPath function. | |
(void) | - didSelectRowAtLeftTable: |
libraryTableViewLeft's implementation of tableView:didSelectRowAtIndexPath. | |
(void) | - didSelectRowAtRightTable: |
libraryTableViewRight's implementation of tableView:didSelectRowAtIndexPath. | |
(id) | - initWithMaster: |
Basic init with master set. | |
(NSInteger) | - numberOfSectionsInTableView: |
UITableViewDataSource protocol function's implementation. | |
(BOOL) | - tableView:canEditRowAtIndexPath: |
UITableViewDataSource function's implementation. | |
(BOOL) | - tableView:canMoveRowAtIndexPath: |
UITableViewDataSource function's implementation. | |
(UITableViewCell *) | - tableView:cellForRowAtIndexPath: |
Mandatory UITableViewDataSource function's implementation. | |
(void) | - tableView:commitEditingStyle:forRowAtIndexPath: |
Commits either composer or composition delete from local data. | |
(void) | - tableView:didSelectRowAtIndexPath: |
UITableViewDelegate protocol function's implementation. | |
(UITableViewCellEditingStyle) | - tableView:editingStyleForRowAtIndexPath: |
UITableViewDelegate protocol function's implementation. | |
(CGFloat) | - tableView:heightForFooterInSection: |
UITableViewDelegate protocol function's implementation. | |
(CGFloat) | - tableView:heightForHeaderInSection: |
UITableViewDelegate protocol function's implementation. | |
(CGFloat) | - tableView:heightForRowAtIndexPath: |
UITableViewDelegate protocol function's implementation. | |
(void) | - tableView:moveRowAtIndexPath:toIndexPath: |
UITableViewDataSource function's implementation. | |
(NSInteger) | - tableView:numberOfRowsInSection: |
Mandatory UITableViewDataSource protocol function's implementation. | |
(UIView *) | - tableView:viewForFooterInSection: |
UITableViewDelegate protocol function's implementation. | |
(UIView *) | - tableView:viewForHeaderInSection: |
UITableViewDelegate protocol function's implementation. | |
(void) | - updateTables |
Updates libraryTableViews, composerDictionary etc. | |
Protected Attributes | |
CatNiPViewController * | master |
Properties | |
NSMutableArray * | allLocalScores |
NSMutableDictionary * | composerDictionary |
Stores composer's (key) all compositions (CompositionData objects) as NSMutableArray (value) | |
NSArray * | composers |
NSArray * | compositions |
IBOutlet CatNiPViewController * | master |
Delegate and datasource for CatNipViewController's tableviews' when LIBRARYTYPE == LOCAL.
Uses composerDictionary made from local data as datasource.
API up to date 28.6.2011
Definition at line 13 of file LocalDelegateDataSource.h.
- (void) alertView: | (UIAlertView *) | alertView | |
clickedButtonAtIndex: | (NSInteger) | buttonIndex | |
Alertview's buttons target-action method.
Asks confirmation of composer or composition delete.
Definition at line 405 of file LocalDelegateDataSource.m.
References compositions, CatNiPViewController::currentPlaylist, master, LocalDataHandler::removeAndDeleteCompositionDataArray:fromScoreArray:andDictionary:andPlaylistArray:, LocalDataHandler::removeAndDeleteScoreDataArray:fromScoreArray:andDictionary:andPlaylistArray:, LocalDataHandler::savePlaylistsToDefaultFile:, LocalDataHandler::saveScoresToDefaultFile:, Playlist::scorelist, and updateTables.
- (void) changeLibraryTypeToLocal |
sets master's tableviews' delegates and datasources to this and reloads their data.
Definition at line 360 of file LocalDelegateDataSource.m.
References composerDictionary, composers, and LocalDataHandler::createComposerDictionary:.
- (UITableViewCell *) createTableCellLeft: | (NSIndexPath *) | indexPath |
Prototype for libTabL's tableView:cellForRowAtIndexPath function.
Creates standard cell for application and assigns cell.textLabel.text = composers[[indexPath row]].
createTableCellLeft | indexPath for cell |
Definition at line 96 of file LocalDelegateDataSource.m.
- (UITableViewCell *) createTableCellRight: | (NSIndexPath *) | indexPath |
Prototype for libTabR's tableView:cellForRowAtIndexPath function.
Creates standard cell for application and assigns cell.textLabel.text = compositions[[indexPath row]].
createTableCellRight | indexPath for cell |
Definition at line 113 of file LocalDelegateDataSource.m.
- (void) didSelectRowAtLeftTable: | (NSIndexPath *) | indexPath |
libraryTableViewLeft's implementation of tableView:didSelectRowAtIndexPath.
Shows libraryTableViewRight if hidden and reloads it's data.
didSelectRowAtLeftTable | location of the new selected row in libraryTableViewLeft |
Definition at line 247 of file LocalDelegateDataSource.m.
- (void) didSelectRowAtRightTable: | (NSIndexPath *) | indexPath |
libraryTableViewRight's implementation of tableView:didSelectRowAtIndexPath.
Opens scorepopover for selected composition.
didSelectRowAtRightTable | location of the new selected row in libraryTableViewRight |
Definition at line 265 of file LocalDelegateDataSource.m.
- (id) initWithMaster: | (CatNiPViewController *) | m |
Basic init with master set.
Definition at line 24 of file LocalDelegateDataSource.m.
- (NSInteger) numberOfSectionsInTableView: | (UITableView *) | tableView |
UITableViewDataSource protocol function's implementation.
Check framework's API for details.
numberOfSectionsInTableView |
Definition at line 51 of file LocalDelegateDataSource.m.
- (BOOL) tableView: | (UITableView *) | tableView | |
canEditRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDataSource function's implementation.
Definition at line 146 of file LocalDelegateDataSource.m.
- (BOOL) tableView: | (UITableView *) | tableView | |
canMoveRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDataSource function's implementation.
dummy implementation. Check framework's API if you want to add functionality in here.
Definition at line 137 of file LocalDelegateDataSource.m.
- (UITableViewCell *) tableView: | (UITableView *) | tableView | |
cellForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
Mandatory UITableViewDataSource function's implementation.
Calls proper UITableView's tableView:cellForRowAtIndexPath for which the cell is needed.
Check framework's API for details.
tableView | libraryTableViewLeft or libraryTableViewRight |
cellForRowAtIndexPath | indexPath for cell to be created in tableView |
Definition at line 81 of file LocalDelegateDataSource.m.
References createTableCellLeft:, createTableCellRight:, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (void) tableView: | (UITableView *) | tableView | |
commitEditingStyle: | (UITableViewCellEditingStyle) | editingStyle | |
forRowAtIndexPath: | (NSIndexPath *) | indexPath | |
Commits either composer or composition delete from local data.
Asks confirmation in alert view before deleting takes place.
Check framework's API for details.
Definition at line 156 of file LocalDelegateDataSource.m.
References LocalScoreData::composer, CompositionData::composerName, CompositionData::compositionName, CatNiPViewController::currentScore, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (void) tableView: | (UITableView *) | tableView | |
didSelectRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Calls spesified tableView's handler to determine behaviour. Check framework's API for details.
tableView | object informing the delegate about the new row selection. |
didSelectRowAtIndexPath | locating the new selected row in tableView |
Definition at line 235 of file LocalDelegateDataSource.m.
References didSelectRowAtLeftTable:, didSelectRowAtRightTable:, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (UITableViewCellEditingStyle) tableView: | (UITableView *) | tableView | |
editingStyleForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Everything is deletable when LIBRARYTYPE == LOCAL
Check frameworks API for details.
Definition at line 350 of file LocalDelegateDataSource.m.
- (CGFloat) tableView: | (UITableView *) | tableView | |
heightForFooterInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
Add some padding in the footer of libraryTableViewLeft and libraryTableViewRight so that last elements will show for user even if the keyboard is visible.
tableView | libraryTableViewLeft or libraryTableViewRight |
heightForFooterInSection | Currently only one section (0) in tableViews |
Definition at line 284 of file LocalDelegateDataSource.m.
- (CGFloat) tableView: | (UITableView *) | tableView | |
heightForHeaderInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
All headers have height of 40.
Definition at line 311 of file LocalDelegateDataSource.m.
- (CGFloat) tableView: | (UITableView *) | tableView | |
heightForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Calculate table's row height dynamically based on cell.textLabel.text length. Height is calculated with following formula: (([cell.textLabel.text length] / 34) * 17) + 50
tableView | for which the height is calculated |
heightForRowAtIndexPath | the row for which the height is calculated |
Definition at line 218 of file LocalDelegateDataSource.m.
References CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (void) tableView: | (UITableView *) | tableView | |
moveRowAtIndexPath: | (NSIndexPath *) | fromIndexPath | |
toIndexPath: | (NSIndexPath *) | toIndexPath | |
UITableViewDataSource function's implementation.
dummy implementation. Check framework's API if you want to add functionality in here.
Definition at line 126 of file LocalDelegateDataSource.m.
- (NSInteger) tableView: | (UITableView *) | tableView | |
numberOfRowsInSection: | (NSInteger) | section | |
Mandatory UITableViewDataSource protocol function's implementation.
Check framework's API for details.
tableView | |
numberOfRowsInSection |
Definition at line 64 of file LocalDelegateDataSource.m.
References CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (UIView *) tableView: | (UITableView *) | tableView | |
viewForFooterInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
Add some padding in the footer of libraryTableViewLeft and libraryTableViewRight so that last elements will show for user even if the keyboard is visible.
tableView | libraryTableViewLeft or libraryTableViewRight |
heightForFooterInSection | Currently only one section (0) in tableViews |
Definition at line 298 of file LocalDelegateDataSource.m.
- (UIView *) tableView: | (UITableView *) | tableView | |
viewForHeaderInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
tableView | libraryTableViewLeft or libraryTableViewRight |
viewForHeaderInSection | 0 |
Definition at line 322 of file LocalDelegateDataSource.m.
References composers, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (void) updateTables |
Updates libraryTableViews, composerDictionary etc.
relevant data to current.
Definition at line 381 of file LocalDelegateDataSource.m.
References composerDictionary, LocalDataHandler::createComposerDictionary:, CatNiPViewController::libraryTableViewLeft, and master.
- (CatNiPViewController*) master [protected] |
Definition at line 18 of file LocalDelegateDataSource.h.
- (NSMutableArray*) allLocalScores [read, write, retain] |
Definition at line 24 of file LocalDelegateDataSource.h.
- (NSMutableDictionary*) composerDictionary [read, write, retain] |
Stores composer's (key) all compositions (CompositionData objects) as NSMutableArray (value)
Definition at line 27 of file LocalDelegateDataSource.h.
- (NSArray *) composers [read, write, copy] |
Definition at line 16 of file LocalDelegateDataSource.h.
- (NSArray *) compositions [read, write, copy] |
Definition at line 17 of file LocalDelegateDataSource.h.
- (IBOutlet CatNiPViewController*) master [read, write, retain] |
Definition at line 21 of file LocalDelegateDataSource.h.