CatNiP prefinal
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
Delegate and datasource for CatNipViewController's tableviews' when LIBRARYTYPE == PLAYLISTS. More...
#import <PlaylistsDelegateDataSource.h>
Public Member Functions | |
(void) | - changeLibraryTypeToPlaylists |
sets master's tableviews' delegates and datasources to this and reloads their data. | |
(UIView *) | - createAccessoryViewForPlaylist: |
Create a view to act as a place for playlist function buttons. | |
(UITableViewCell *) | - createTableCellLeft: |
Creates cell for libraryTableViewLeft. | |
(UITableViewCell *) | - createTableCellRight: |
Creates cell for libraryTableViewRight. | |
(void) | - didSelectRowAtLeftTable: |
Shows libraryTableViewRight if hidden and reloads it's data. | |
(void) | - didSelectRowAtRightTable: |
libraryTableViewRight's implementation of tableView: indexPath. | |
(id) | - init [implementation] |
Initializer for PlaylistDelegateDataSource. | |
(id) | - initWithMaster: |
Initializer for PlaylistDelegateDataSource. | |
(NSInteger) | - numberOfSectionsInTableView: |
UITableViewDataSource protocol function's implementation. | |
(void) | - playlistActivateClicked: |
Target method for playlist edit clicks. | |
(void) | - setPlaylistViewContents: |
A helper method that sets the currently selected playlist according to the row parameter in the given NSIndexPath. | |
(BOOL) | - tableView:canEditRowAtIndexPath: |
UITableViewDataSource function's implementation. | |
(BOOL) | - tableView:canMoveRowAtIndexPath: |
UITableViewDataSource function's implementation. | |
(UITableViewCell *) | - tableView:cellForRowAtIndexPath: |
Mandatory UITableViewDataSource protocol's function implementation. | |
(void) | - tableView:commitEditingStyle:forRowAtIndexPath: |
Deletes either whole playlist or removes one score from playlist depending on tableView. | |
(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: |
UITableViewDataSource protocol function's implementation. | |
(NSString *) | - tableView:titleForDeleteConfirmationButtonForRowAtIndexPath: |
UITableViewDelegate protocol function's implementation. | |
(UIView *) | - tableView:viewForFooterInSection: |
UITableViewDelegate protocol function's implementation. | |
(UIView *) | - tableView:viewForHeaderInSection: |
UITableViewDelegate protocol function's implementation. | |
(BOOL) | - textField:shouldChangeCharactersInRange:replacementString: [implementation] |
UITextFieldDelegate method implementation. | |
(void) | - textFieldDidEndEditing: [implementation] |
UITextFieldDelegate method implementation. | |
(BOOL) | - textFieldShouldReturn: [implementation] |
UITextFieldDelegate method implementation. | |
Protected Attributes | |
CatNiPViewController * | master |
Properties | |
Playlist * | currentPlaylist |
IBOutlet CatNiPViewController * | master |
ValueTextField * | playlistName |
NSMutableArray * | playlists |
Delegate and datasource for CatNipViewController's tableviews' when LIBRARYTYPE == PLAYLISTS.
Uses local data (playlists, currentPlaylist) as datasources.
API up to date 28.6.2011
Definition at line 16 of file PlaylistsDelegateDataSource.h.
- (void) changeLibraryTypeToPlaylists |
sets master's tableviews' delegates and datasources to this and reloads their data.
Definition at line 524 of file PlaylistsDelegateDataSource.m.
- (UIView *) createAccessoryViewForPlaylist: | (NSIndexPath *) | indexPath |
Create a view to act as a place for playlist function buttons.
Creates an accessory view for UITableViewCells displaying playlists stored on the device.
An accessory view shows any extra functionality buttons present next to the playlist name.
indexPath | The index path of the cell for which the accessory view will be generated |
Definition at line 548 of file PlaylistsDelegateDataSource.m.
- (UITableViewCell *) createTableCellLeft: | (NSIndexPath *) | indexPath |
Creates cell for libraryTableViewLeft.
Creates standard cell for application and assigns cell.textLabel.text = [[playlists objectAtIndex:(indexPath.row -1)] name].
createTableCellLeft | UITableView which cells are generated in this function |
Definition at line 110 of file PlaylistsDelegateDataSource.m.
References createAccessoryViewForPlaylist:.
- (UITableViewCell *) createTableCellRight: | (NSIndexPath *) | indexPath |
Creates cell for libraryTableViewRight.
Creates standard cell for application and sets it's showsReorderContor to NO if cell is "Add new score" otherwise sets it to YES;
createTableCellRight | UITableView which cells are generated in this function |
Definition at line 149 of file PlaylistsDelegateDataSource.m.
References LocalScoreData::composition, currentPlaylist, and ScoreData::description.
- (void) didSelectRowAtLeftTable: | (NSIndexPath *) | indexPath |
Shows libraryTableViewRight if hidden and reloads it's data.
didSelectRowAtLeftTable | locating the new selected row |
Definition at line 344 of file PlaylistsDelegateDataSource.m.
References Playlist::name, LocalDataHandler::savePlaylistsToDefaultFile:, and setPlaylistViewContents:.
- (void) didSelectRowAtRightTable: | (NSIndexPath *) | indexPath |
libraryTableViewRight's implementation of tableView: indexPath.
Using gesture recognizer initialized in viewDidLoad instead to prevent popping ScorePopoverController in new UIPopoverController with every search in libraryTableViewRight.
didSelectRowAtRightTable | locating the new selected row in tableView |
Definition at line 377 of file PlaylistsDelegateDataSource.m.
References currentPlaylist, and Playlist::scorelist.
- (id) init | [implementation] |
Initializer for PlaylistDelegateDataSource.
Definition at line 20 of file PlaylistsDelegateDataSource.m.
- (id) initWithMaster: | (CatNiPViewController *) | m |
Initializer for PlaylistDelegateDataSource.
m | The CatNiPViewController that controls the UIView showing the library tables. |
Definition at line 32 of file PlaylistsDelegateDataSource.m.
References init.
- (NSInteger) numberOfSectionsInTableView: | (UITableView *) | tableView |
UITableViewDataSource protocol function's implementation.
Check frameworks API for details.
numberOfSectionsInTableView |
Definition at line 57 of file PlaylistsDelegateDataSource.m.
- (void) playlistActivateClicked: | (id) | button |
Target method for playlist edit clicks.
Sends a message to the master object (ie. the CatNiPViewController displaying the library table) to open the right tableview if necessary and then displays the contents of the playlist in that tableview.
button | The ValueButton that generated the click event |
Definition at line 568 of file PlaylistsDelegateDataSource.m.
References setPlaylistViewContents:.
- (void) setPlaylistViewContents: | (NSIndexPath *) | indexPath |
A helper method that sets the currently selected playlist according to the row parameter in the given NSIndexPath.
indexPath | The index path to the playlist that will be displayed |
Definition at line 580 of file PlaylistsDelegateDataSource.m.
- (BOOL) tableView: | (UITableView *) | tableView | |
canEditRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDataSource function's implementation.
Everything is editable if LIBRARYTYPE == PLAYLISTS
Check frameworks API for details.
tableView | libraryTableViewRight or libraryTableViewLeft |
canEditRowAtIndexPath | indexPath to cell in tableView |
Definition at line 236 of file PlaylistsDelegateDataSource.m.
- (BOOL) tableView: | (UITableView *) | tableView | |
canMoveRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDataSource function's implementation.
Playlists are kept in order with sorting thus libraryTableViewLeft's cells are not movable. libraryTableViewRight's cells except "Add new score" can be moved around each other.
Check frameworks API for details.
tableView | libraryTableViewRight |
canMoveRowAtIndexPath | indexPath to cell in tableView |
Definition at line 216 of file PlaylistsDelegateDataSource.m.
References CatNiPViewController::libraryTableViewRight, and master.
- (UITableViewCell *) tableView: | (UITableView *) | tableView | |
cellForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
Mandatory UITableViewDataSource protocol's function implementation.
Calls createTableCellLeft or createTableCellRight to create a cell to return
Check frameworks API for details.
tableView | libraryTableViewLeft or libraryTableViewRight |
cellForRowAtIndexPath | indexPath for cell to be created in tableView |
Definition at line 95 of file PlaylistsDelegateDataSource.m.
References createTableCellLeft:, createTableCellRight:, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (void) tableView: | (UITableView *) | tableView | |
commitEditingStyle: | (UITableViewCellEditingStyle) | editingStyle | |
forRowAtIndexPath: | (NSIndexPath *) | indexPath | |
Deletes either whole playlist or removes one score from playlist depending on tableView.
Does not deletes LocalScoreData(s) or pdf(s) on either case.
Check frameworks API for details.
no cells with this editing style
Definition at line 246 of file PlaylistsDelegateDataSource.m.
References currentPlaylist, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, master, and LocalDataHandler::savePlaylistsToDefaultFile:.
- (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.
Check frameworks API for details.
tableView | object informing the delegate about the new row selection. |
didSelectRowAtIndexPath | locating the new selected row in tableView |
Definition at line 333 of file PlaylistsDelegateDataSource.m.
References didSelectRowAtLeftTable:, didSelectRowAtRightTable:, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (UITableViewCellEditingStyle) tableView: | (UITableView *) | tableView | |
editingStyleForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Check frameworks API for details.
Definition at line 487 of file PlaylistsDelegateDataSource.m.
References CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (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.
Check frameworks API for details.
tableView | libraryTableViewLeft or libraryTableViewRight |
heightForFooterInSection | Currently only one section (0) in tableViews |
Definition at line 406 of file PlaylistsDelegateDataSource.m.
- (CGFloat) tableView: | (UITableView *) | tableView | |
heightForHeaderInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
All headers have height of 40.
Check frameworks API for details.
tableView | |
heightForHeaderInSection |
Definition at line 437 of file PlaylistsDelegateDataSource.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
Check frameworks API for details.
tableView | for which the height is calculated |
heightForRowAtIndexPath | the row for which the height is calculated |
Definition at line 306 of file PlaylistsDelegateDataSource.m.
References LocalScoreData::composition, ScoreData::description, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (void) tableView: | (UITableView *) | tableView | |
moveRowAtIndexPath: | (NSIndexPath *) | fromIndexPath | |
toIndexPath: | (NSIndexPath *) | toIndexPath | |
UITableViewDataSource function's implementation.
Playlists are kept in order with sorting thus libraryTableViewLeft's cells are not movable. libraryTableViewRight's cells except "Add new score" can be moved around each other.
Check frameworks API for details.
tableView,: | libraryTableViewLeft or libraryTableViewRight |
moveRowAtIndexPath | indexPath from which the cell is moved |
toIndexPath | indexPath where the cell is moved |
Definition at line 172 of file PlaylistsDelegateDataSource.m.
References CatNiPViewController::currentPlaylist, currentPlaylist, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, master, LocalDataHandler::savePlaylistsToDefaultFile:, and Playlist::scorelist.
- (NSInteger) tableView: | (UITableView *) | tableView | |
numberOfRowsInSection: | (NSInteger) | section | |
UITableViewDataSource protocol function's implementation.
Check frameworks API for details.
tableView | |
numberOfRowsInSection |
Definition at line 70 of file PlaylistsDelegateDataSource.m.
References currentPlaylist, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, and master.
- (NSString *) tableView: | (UITableView *) | tableView | |
titleForDeleteConfirmationButtonForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Check frameworks API for details.
Definition at line 510 of file PlaylistsDelegateDataSource.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 | |
viewForFooterInSection | Currently only one section (0) in tableViews |
Definition at line 420 of file PlaylistsDelegateDataSource.m.
- (UIView *) tableView: | (UITableView *) | tableView | |
viewForHeaderInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
Check frameworks API for details.
tableView | libraryTableViewLeft or libraryTableViewRight |
viewForHeaderInSection | 0 |
Definition at line 451 of file PlaylistsDelegateDataSource.m.
References currentPlaylist, ValueTextField::fieldValue, CatNiPViewController::libraryTableViewLeft, CatNiPViewController::libraryTableViewRight, master, and playlistName.
- (BOOL) textField: | (UITextField *) | textField | |
shouldChangeCharactersInRange: | (NSRange) | range | |
replacementString: | (NSString *) | string | |
[implementation] |
UITextFieldDelegate method implementation.
Allows editing of the textfield containing the playlist name. See Cocoa Touch framework API documentation for more.
Definition at line 592 of file PlaylistsDelegateDataSource.m.
- (void) textFieldDidEndEditing: | (UITextField *) | textField | [implementation] |
UITextFieldDelegate method implementation.
Handles setting the new name for a playlist. See Cocoa Touch framework API documentation for more.
Definition at line 600 of file PlaylistsDelegateDataSource.m.
References ValueTextField::fieldValue, Playlist::name, and LocalDataHandler::savePlaylistsToDefaultFile:.
- (BOOL) textFieldShouldReturn: | (UITextField *) | textField | [implementation] |
UITextFieldDelegate method implementation.
Handles enter presses in the text field. See Cocoa Touch framework API documentation for more.
Definition at line 615 of file PlaylistsDelegateDataSource.m.
- (CatNiPViewController*) master [protected] |
Definition at line 22 of file PlaylistsDelegateDataSource.h.
- (Playlist *) currentPlaylist [read, write, retain] |
Definition at line 20 of file PlaylistsDelegateDataSource.h.
- (IBOutlet CatNiPViewController*) master [read, write, retain] |
Definition at line 26 of file PlaylistsDelegateDataSource.h.
- (ValueTextField *) playlistName [read, write, retain] |
Definition at line 21 of file PlaylistsDelegateDataSource.h.
- (NSMutableArray *) playlists [read, write, retain] |
Definition at line 19 of file PlaylistsDelegateDataSource.h.