CatNiP docutest
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
PlaylistsDelegateDataSource.h CatNiP. 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 |
PlaylistsDelegateDataSource.h CatNiP.
Delegate and datasource for CatNipViewController's tableviews' when LIBRARYTYPE == PLAYLISTS. Uses local data (playlists, currentPlaylist) as datasources.
API up to date 28.6.2011
- (void) changeLibraryTypeToPlaylists |
sets master's tableviews' delegates and datasources to this and reloads their data.
- (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 |
- (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 |
- (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 |
- (void) didSelectRowAtLeftTable: | (NSIndexPath *) | indexPath |
Shows libraryTableViewRight if hidden and reloads it's data.
didSelectRowAtLeftTable | locating the new selected row |
- (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 |
- (id) init | [implementation] |
Initializer for PlaylistDelegateDataSource.
- (id) initWithMaster: | (CatNiPViewController *) | m |
Initializer for PlaylistDelegateDataSource.
m | The CatNiPViewController that controls the UIView showing the library tables. |
- (NSInteger) numberOfSectionsInTableView: | (UITableView *) | tableView |
UITableViewDataSource protocol function's implementation.
Check frameworks API for details.
numberOfSectionsInTableView |
- (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 |
- (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 |
- (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 |
- (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 |
- (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 |
- (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
- (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 |
- (UITableViewCellEditingStyle) tableView: | (UITableView *) | tableView | |
editingStyleForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Check frameworks API for details.
- (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 |
- (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 |
- (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 |
- (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 |
- (NSInteger) tableView: | (UITableView *) | tableView | |
numberOfRowsInSection: | (NSInteger) | section | |
UITableViewDataSource protocol function's implementation.
Check frameworks API for details.
tableView | |
numberOfRowsInSection |
- (NSString *) tableView: | (UITableView *) | tableView | |
titleForDeleteConfirmationButtonForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Check frameworks API for details.
- (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 |
- (UIView *) tableView: | (UITableView *) | tableView | |
viewForHeaderInSection: | (NSInteger) | section | |
UITableViewDelegate protocol function's implementation.
Check frameworks API for details.
tableView | libraryTableViewLeft or libraryTableViewRight |
viewForHeaderInSection | 0 |
- (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.
- (void) textFieldDidEndEditing: | (UITextField *) | textField | [implementation] |
UITextFieldDelegate method implementation.
Handles setting the new name for a playlist. See Cocoa Touch framework API documentation for more.
- (BOOL) textFieldShouldReturn: | (UITextField *) | textField | [implementation] |
UITextFieldDelegate method implementation.
Handles enter presses in the text field. See Cocoa Touch framework API documentation for more.
- (CatNiPViewController*) master [protected] |
- (Playlist *) currentPlaylist [read, write, retain] |
- (IBOutlet CatNiPViewController*) master [read, write, retain] |
- (ValueTextField *) playlistName [read, write, retain] |
- (NSMutableArray *) playlists [read, write, retain] |