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

#import <ScorePopoverController.h>

List of all members.

Public Member Functions

(id) - initWithStyle:masterController:IMSLPCompositionData:
(id) - initWithStyle:masterController:LocalCompositionData:
(UIView *) - tableView:viewForHeaderInSection:
(CGFloat) - tableView:heightForHeaderInSection:
(CGFloat) - tableView:heightForRowAtIndexPath:
(void) - tableView:didSelectRowAtIndexPath:
(void) - tableView:accessoryButtonTappedForRowWithIndexPath:
(UITableViewCell *) - tableView:cellForRowAtIndexPath:
(NSInteger) - numberOfSectionsInTableView:

Protected Attributes

UITableView * scoresTableView
CatNiPViewControllermaster
IMSLPCompositionData_readComposition

Properties

IBOutlet UITableView * scoresTableView
IBOutlet CatNiPViewControllermaster
NSString * composer
NSString * composition
NSString * scoreInfo

Member Function Documentation

- (id) initWithStyle: (UITableViewStyle)  style
masterController: (CatNiPViewController *)  controller
IMSLPCompositionData: (IMSLPCompositionData *)  compData 

Basic init for ScorePopoverController, sets masterController = controller

Parameters:
initWithStyle,:check framework's API for UITableViewStyles
masterControllermaster viewController in which this popover is represented.
IMSLPCompositionDataIMSLPCompositionData object of given composition
Returns:
id
- (id) initWithStyle: (UITableViewStyle)  style
masterController: (CatNiPViewController *)  controller
LocalCompositionData: (LocalCompositionData *)  compData 

Basic init for ScorePopoverController, sets masterController = controller

Parameters:
initWithStyle,:check framework's API for UITableViewStyles
masterControllermaster viewController in which this popover is represented.
IMSLPCompositionDataIMSLPCompositionData object of given composition
Returns:
id
- (NSInteger) numberOfSectionsInTableView: (UITableView *)  tableView

UITableViewDataSource protocol function's implementation.

Returns 1

Parameters:
numberOfSectionsInTableViewscoresTableView
Returns:
returns 1.
- (void) tableView: (UITableView *)  tableView
accessoryButtonTappedForRowWithIndexPath: (NSIndexPath *)  indexPath 

UITableViewDelegate protocol function's implementation.

Opens up a detail popover view for tapped score's info.

Parameters:
tableViewscoresTableView
accessoryButtonTappedForRowWithIndexPathindexPath for tapped score's cell
- (UITableViewCell *) tableView: (UITableView *)  tableView
cellForRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDataSource protocol function's implementation.

Some functionality still missing

Parameters:
tableViewscoresTableView
cellForRowAtIndexPathindexPath for cell to be created
Returns:
created cell for given arguments
- (void) tableView: (UITableView *)  tableView
didSelectRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDelegate protocol function's implementation.

to be implemented. Should dowload and open sheets corresponding to selected row and hide UI elements

Parameters:
tableViewscoresTableView
didSelectRowAtIndexPathindexPath for selected row
- (CGFloat) tableView: (UITableView *)  tableView
heightForHeaderInSection: (NSInteger)  section 

UITableViewDelegate protocol function's implementation

Calculate header's height based on it's content's length. Calculation formula is: ((int)(l / 45) +1) * 30 + 50 where l is |composer| + |composition| + 3.

Parameters:
tableViewscoresTableView
heightForHeaderInSectiononly one section (0) in this table.
Returns:
height of header as CGFloat.
- (CGFloat) tableView: (UITableView *)  tableView
heightForRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDelegate protocol function's implementation.

Calculate table row's height dynamically based on string's length.

Parameters:
tableViewscoresTableView
heightRowAtIndexPathindexPath of the cell which height is being calculated
Returns:
height of row as CGFloat.
- (UIView *) tableView: (UITableView *)  tableView
viewForHeaderInSection: (NSInteger)  section 

tableViewDelegate protocol function's implementation.

Creates an UILabel for scoresTableView header (it has only one section) and sets its textLabel.text = "composer - composition". Header backgroundcolor has alpha component set to 0.4 so that it text behind it can be viewed.

Parameters:
tableViewscoresTableView
sectiononly one section (0) in this table.
Returns:
view for header in section

Member Data Documentation

- (CatNiPViewController*) master [protected]
- (UITableView*) scoresTableView [protected]

Property Documentation

- (NSString *) composer [read, write, retain]
- (NSString *) composition [read, write, retain]
- (IBOutlet CatNiPViewController*) master [read, write, retain]
- (NSString *) scoreInfo [read, write, retain]
- (IBOutlet UITableView*) scoresTableView [read, write, retain]

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