CatNiP docutest
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
PlaylistsDelegateDataSource Class Reference

PlaylistsDelegateDataSource.h CatNiP. More...

#import <PlaylistsDelegateDataSource.h>

Collaboration diagram for PlaylistsDelegateDataSource:

List of all members.

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

CatNiPViewControllermaster

Properties

Playlist * currentPlaylist
IBOutlet CatNiPViewControllermaster
ValueTextFieldplaylistName
NSMutableArray * playlists

Detailed Description

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


Member Function Documentation

- (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.

Parameters:
indexPathThe index path of the cell for which the accessory view will be generated
Returns:
An UIView object that can be set as the accessory view for the cell

Here is the caller graph for this function:

- (UITableViewCell *) createTableCellLeft: (NSIndexPath *)  indexPath

Creates cell for libraryTableViewLeft.

Creates standard cell for application and assigns cell.textLabel.text = [[playlists objectAtIndex:(indexPath.row -1)] name].

Parameters:
createTableCellLeftUITableView which cells are generated in this function
Returns:
UITableViewCell for given parametres

Here is the call graph for this function:

Here is the caller graph for 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;

Parameters:
createTableCellRightUITableView which cells are generated in this function
Returns:
UITableViewCell for given parametres

Here is the caller graph for this function:

- (void) didSelectRowAtLeftTable: (NSIndexPath *)  indexPath

Shows libraryTableViewRight if hidden and reloads it's data.

Parameters:
didSelectRowAtLeftTablelocating the new selected row

Here is the call graph for this function:

Here is the caller graph for this function:

- (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.

Parameters:
didSelectRowAtRightTablelocating the new selected row in tableView

Here is the caller graph for this function:

- (id) init [implementation]

Initializer for PlaylistDelegateDataSource.

Here is the caller graph for this function:

- (id) initWithMaster: (CatNiPViewController *)  m

Initializer for PlaylistDelegateDataSource.

Parameters:
mThe CatNiPViewController that controls the UIView showing the library tables.

Here is the call graph for this function:

- (NSInteger) numberOfSectionsInTableView: (UITableView *)  tableView

UITableViewDataSource protocol function's implementation.

Check frameworks API for details.

Parameters:
numberOfSectionsInTableView
Returns:
value 1 cause each tableView has one section
- (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.

Parameters:
buttonThe ValueButton that generated the click event

Here is the call graph for this function:

- (void) setPlaylistViewContents: (NSIndexPath *)  indexPath

A helper method that sets the currently selected playlist according to the row parameter in the given NSIndexPath.

Parameters:
indexPathThe index path to the playlist that will be displayed

Here is the caller graph for this function:

- (BOOL) tableView: (UITableView *)  tableView
canEditRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDataSource function's implementation.

Everything is editable if LIBRARYTYPE == PLAYLISTS

Check frameworks API for details.

Parameters:
tableViewlibraryTableViewRight or libraryTableViewLeft
canEditRowAtIndexPathindexPath to cell in tableView
Returns:
YES
- (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.

Parameters:
tableViewlibraryTableViewRight
canMoveRowAtIndexPathindexPath to cell in tableView
Returns:
YES if tableView == libraryTableViewRight. Otherwise returns NO.
- (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.

Parameters:
tableViewlibraryTableViewLeft or libraryTableViewRight
cellForRowAtIndexPathindexPath for cell to be created in tableView
Returns:
UITableViewCell for given parametres

Here is the call graph for this function:

- (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

Here is the call graph for this function:

- (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.

Parameters:
tableViewobject informing the delegate about the new row selection.
didSelectRowAtIndexPathlocating the new selected row in tableView

Here is the call graph for this function:

- (UITableViewCellEditingStyle) tableView: (UITableView *)  tableView
editingStyleForRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDelegate protocol function's implementation.

Check frameworks API for details.

Returns:
editing style for cell in tableView. All cells except first row in libraryTableViewLeft are deletable in libraryTableViewLeft and libraryTableViewRight.
- (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.

Parameters:
tableViewlibraryTableViewLeft or libraryTableViewRight
heightForFooterInSectionCurrently only one section (0) in tableViews
Returns:
Footer's height as CGFloat type, currently 0.
- (CGFloat) tableView: (UITableView *)  tableView
heightForHeaderInSection: (NSInteger)  section 

UITableViewDelegate protocol function's implementation.

All headers have height of 40.

Check frameworks API for details.

Parameters:
tableView
heightForHeaderInSection
Returns:
40
- (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.

Parameters:
tableViewfor which the height is calculated
heightForRowAtIndexPaththe row for which the height is calculated
Returns:
row's height in CGFloat type
- (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.

Parameters:
tableView,:libraryTableViewLeft or libraryTableViewRight
moveRowAtIndexPathindexPath from which the cell is moved
toIndexPathindexPath where the cell is moved

Here is the call graph for this function:

- (NSInteger) tableView: (UITableView *)  tableView
numberOfRowsInSection: (NSInteger)  section 

UITableViewDataSource protocol function's implementation.

Check frameworks API for details.

Parameters:
tableView
numberOfRowsInSection
Returns:
playlists or scores depending on which libraryTableView is chosen
- (NSString *) tableView: (UITableView *)  tableView
titleForDeleteConfirmationButtonForRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDelegate protocol function's implementation.

Check frameworks API for details.

Returns:
"Delete" if tableView == libraryTableViewLeft, "Remove" if tableView == libraryTableViewRight.
- (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.

Parameters:
tableView
viewForFooterInSectionCurrently only one section (0) in tableViews
Returns:
footer's view.
- (UIView *) tableView: (UITableView *)  tableView
viewForHeaderInSection: (NSInteger)  section 

UITableViewDelegate protocol function's implementation.

Check frameworks API for details.

Parameters:
tableViewlibraryTableViewLeft or libraryTableViewRight
viewForHeaderInSection0
Returns:
Header view for section in tableView
- (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.

Here is the call graph for this function:

- (BOOL) textFieldShouldReturn: (UITextField *)  textField [implementation]

UITextFieldDelegate method implementation.

Handles enter presses in the text field. See Cocoa Touch framework API documentation for more.


Member Data Documentation

- (CatNiPViewController*) master [protected]

Property Documentation

- (Playlist *) currentPlaylist [read, write, retain]
- (IBOutlet CatNiPViewController*) master [read, write, retain]
- (ValueTextField *) playlistName [read, write, retain]
- (NSMutableArray *) playlists [read, write, retain]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Properties Defines