CatNiP -test sprint-4-interim
catnip
LocalDelegateDataSource Class Reference

#import <LocalDelegateDataSource.h>

List of all members.

Public Member Functions

(id) - initWithMaster:
(NSInteger) - numberOfSectionsInTableView:
(void) - tableView:moveRowAtIndexPath:toIndexPath:
(BOOL) - tableView:canMoveRowAtIndexPath:
(NSInteger) - tableView:numberOfRowsInSection:
(UITableViewCell *) - tableView:cellForRowAtIndexPath:
(BOOL) - tableView:canEditRowAtIndexPath:
(void) - tableView:commitEditingStyle:forRowAtIndexPath:
(UITableViewCell *) - createTableCellLeft:
(UITableViewCell *) - createTableCellRight:
(void) - tableView:didSelectRowAtIndexPath:
(CGFloat) - tableView:heightForRowAtIndexPath:
(void) - didSelectRowAtLeftTable:
(void) - didSelectRowAtRightTable:
(void) - changeLibraryTypeToLocal

Protected Attributes

CatNiPViewControllermaster

Properties

IBOutlet CatNiPViewControllermaster
NSArray * composers
NSArray * compositions
NSMutableArray * allLocalScores
NSMutableDictionary * composerDictionary

Member Function Documentation

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

Prototype for libTabL's tableView:cellForRowAtIndexPath function.

Creates standard cell for application and assigns cell.textLabel.text = _composers[[indexPath row]].

Parameters:
libTabLUITableView which cells are generated in this function
cellForRowAtIndexPathindexPath for cell to be created in libTabL
Returns:
UITableViewCell for given parametres
- (UITableViewCell *) createTableCellRight: (NSIndexPath *)  indexPath

Prototype for libTabR's tableView:cellForRowAtIndexPath function.

Creates standard cell for application and assigns cell.textLabel.text = _compositions[[indexPath row]].

Parameters:
libTabRUITableView which cells are generated in this function
cellForRowAtIndexPathindexPath for cell to be created in libTabR
Returns:
UITableViewCell for given parametres
- (void) didSelectRowAtLeftTable: (NSIndexPath *)  indexPath

libTabL's implementation of tableView:didSelectRowAtIndexPath.

Shows _libTabR if hidden and reloads it's data.

Parameters:
libTabLchoosing the left library table
didSelectRowAtIndexPathlocating the new selected row in tableView
- (void) didSelectRowAtRightTable: (NSIndexPath *)  indexPath

libTabR's implementation of tableView:didSelectRowAtIndexPath.

Using gesture recognizer initialized in viewDidLoad instead to prevent popping ScorePopoverController in new UIPopoverController with every search in _libTabR.

Parameters:
libTabRchoosing the right side library table
didSelectRowAtIndexPathlocating the new selected row in tableView

find local scores of selected composition

- (id) initWithMaster: (CatNiPViewController *)  m
- (NSInteger) numberOfSectionsInTableView: (UITableView *)  tableView

UITableViewDataSource protocol function's implementation.

Parameters:
numberOfSectionsInTableView
Returns:
1
- (BOOL) tableView: (UITableView *)  tableView
canEditRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDataSource function's implementation

Make rows in _libTabR editable if playlist is selected from _libTabL.

Parameters:
tableView_libTabR or _libTabL
canEditRowAtIndexPathindexPath to cell in tableView
Returns:
YES if tableView == _libTabR, LIBRARYTYPE == LOCAL and selected section in _libTabL == PLAYLISTS. Otherwise returns NO.
- (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.

Returns:
NO;
- (UITableViewCell *) tableView: (UITableView *)  tableView
cellForRowAtIndexPath: (NSIndexPath *)  indexPath 

Mandatory UITableViewDataSource function's implementation

Calls proper UITableView's tableView:cellForRowAtIndexPath for which the cell is needed.

Parameters:
tableView_libTabL or _libTabR
cellForRowAtIndexPathindexPath for cell to be created in tableView
Returns:
UITableViewCell for given parametres
- (void) tableView: (UITableView *)  tableView
commitEditingStyle: (UITableViewCellEditingStyle)  editingStyle
forRowAtIndexPath: (NSIndexPath *)  indexPath 
- (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.

Parameters:
tableViewobject informing the delegate about the new row selection.
didSelectRowAtIndexPathlocating the new selected row in tableView
- (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

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

dummy implementation. Check framework's API if you want to add functionality in here.

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

Mandatory UITableViewDataSource protocol function's implementation.

Parameters:
tableView
numberOfRowsInSection
Returns:
number of composers or compositions depending on tableView

Member Data Documentation

- (CatNiPViewController*) master [protected]

Property Documentation

- (NSMutableArray*) allLocalScores [read, write, retain]
- (NSMutableDictionary*) composerDictionary [read, write, retain]

Stores composer's (key) all compositions as a NSMutableSet (value)

- (NSArray *) composers [read, write, copy]
- (NSArray *) compositions [read, write, copy]
- (IBOutlet CatNiPViewController*) master [read, write, retain]

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