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

#import <ScorePopoverController.h>

Collaboration diagram for ScorePopoverController:

List of all members.

Public Member Functions

(void) - addToPlaylist:
 Opens playlist popover to select playlist in which the score associated with given button will be added.
(void) - cancelDownload:
 Cancel's download of pdf associated with this button.
(UIView *) - createAccessoryViewForIndexPath:
 creates accessory view depending on current LIBRARYTYPE
(ScoreListButton *) - createAddToPlaylistButtonForScore:
 Create add to playlist button which sends actions to addToPlaylist:
(ScoreListButton *) - createCancelButtonForScore:
 Create cancel button which sends actions to cancelDownload:
(ScoreListButton *) - createDetailButtonForScore:
 Create detail button which sends actions to showDetailsForScore:
(ScoreListButton *) - createDownloadButtonForScore:
 Create download button which sends actions to downloadScore:
(void) - dealloc [implementation]
(void) - didReceiveMemoryWarning [implementation]
(UIView *) - downloadableAccessoryViewForIndexPath:
 Creates accessoryview for IMSLP score which can be downloaded.
(UIView *) - downloadedAccessoryViewForIndexPath:
 Creates accessoryview for IMSLP score which is already downloaded.
(UIView *) - downloadingAccessoryViewForIndexPath:
 Creates accessoryview for IMSLP score which is downloading at the moment.
(void) - downloadScore:
 Starts downloading score's pdf associated with button and changes button's cell's accessoryview.
(UIView *) - IMSLPAccessoryViewForIndexPath:
 Creates accessoryview for IMSLP scorecell in indexPath.
(id) - initWithStyle:masterController:compositionData:editable:
 Basic init for ScorePopoverController, sets masterController = controller.
(UIView *) - LocalAccessoryViewForIndexPath:
 Creates accessoryview for local score.
(NSInteger) - numberOfSectionsInTableView:
 UITableViewDataSource protocol function's implementation.
(BOOL) - shouldAutorotateToInterfaceOrientation: [implementation]
(void) - showDetailsForScore:
 Shows details popover about the score associated with given button.
(BOOL) - tableView:canEditRowAtIndexPath:
 UITableViewDataSource protocol function's implementation.
(UITableViewCell *) - tableView:cellForRowAtIndexPath:
 UITableViewDataSource protocol function's implementation.
(void) - tableView:commitEditingStyle:forRowAtIndexPath:
 UITableViewDataSource protocol function's implementation.
(void) - tableView:didSelectRowAtIndexPath:
 UITableViewDelegate protocol function's implementation.
(UITableViewCellEditingStyle) - tableView:editingStyleForRowAtIndexPath:
 UITableViewDelegate protocol function's implementation.
(CGFloat) - tableView:heightForHeaderInSection:
 UITableViewDelegate protocol function's implementation.
(CGFloat) - tableView:heightForRowAtIndexPath:
 UITableViewDelegate protocol function's implementation.
(NSInteger) - tableView:numberOfRowsInSection: [implementation]
 UITableViewDataSource protocol function's implementation.
(UIView *) - tableView:viewForHeaderInSection:
 tableViewDelegate protocol function's implementation.
(void) - updateProgressView:
 Updates UIProgressview associated with this NSTimer.
(void) - viewDidAppear: [implementation]
(void) - viewDidDisappear: [implementation]
(void) - viewDidLoad [implementation]
(void) - viewDidUnload [implementation]
(void) - viewWillAppear: [implementation]
(void) - viewWillDisappear: [implementation]

Protected Attributes

CatNiPViewControllermaster

Properties

NSString * composer
NSString * composition
CompositionDatacompositionData
BOOL editable
IBOutlet CatNiPViewControllermaster

Member Function Documentation

- (void) addToPlaylist: (id)  button

Opens playlist popover to select playlist in which the score associated with given button will be added.

Parameters:
addToPlaylistsender of the action. Only ScoreListButtons allowed.
- (void) cancelDownload: (id)  button

Cancel's download of pdf associated with this button.

Accessoryview of this cell is updated after cancel.

Parameters:
cancelDownloadsender of the action. Only ScoreListButtons allowed.

Here is the call graph for this function:

- (UIView *) createAccessoryViewForIndexPath: (NSIndexPath *)  indexPath

creates accessory view depending on current LIBRARYTYPE

Calls IMSLPAccessoryViewForIndexPath: or LocalAccessoryViewForIndexPath:

Parameters:
IcreateAccessoryViewForIndexPathindexpath for cell
Returns:
accessoryview for cell as UIView

Here is the call graph for this function:

Here is the caller graph for this function:

- (ScoreListButton *) createAddToPlaylistButtonForScore: (ScoreData *)  score

Create add to playlist button which sends actions to addToPlaylist:

Here is the caller graph for this function:

- (ScoreListButton *) createCancelButtonForScore: (ScoreData *)  score

Create cancel button which sends actions to cancelDownload:

Here is the caller graph for this function:

- (ScoreListButton *) createDetailButtonForScore: (ScoreData *)  score

Create detail button which sends actions to showDetailsForScore:

Here is the caller graph for this function:

- (ScoreListButton *) createDownloadButtonForScore: (ScoreData *)  score

Create download button which sends actions to downloadScore:

Here is the caller graph for this function:

- (void) dealloc [implementation]
- (void) didReceiveMemoryWarning [implementation]
- (UIView *) downloadableAccessoryViewForIndexPath: (NSIndexPath *)  indexPath

Creates accessoryview for IMSLP score which can be downloaded.

Accessoryview has download button and detail button.

Parameters:
downloadableAccessoryViewForIndexPathindexpath for cell
Returns:
accessoryview for cell as UIView

Here is the call graph for this function:

Here is the caller graph for this function:

- (UIView *) downloadedAccessoryViewForIndexPath: (NSIndexPath *)  indexPath

Creates accessoryview for IMSLP score which is already downloaded.

Accessoryview has 'check-mark' instead of download button and detail button.

Parameters:
downloadedAccessoryViewForIndexPathindexpath for cell
Returns:
accessoryview for cell as UIView

Here is the call graph for this function:

Here is the caller graph for this function:

- (UIView *) downloadingAccessoryViewForIndexPath: (NSIndexPath *)  indexPath

Creates accessoryview for IMSLP score which is downloading at the moment.

Accessoryview has progressbar, cancel button and detail button.

Parameters:
downloadingAccessoryViewForIndexPathindexpath for cell
Returns:
accessoryview for cell as UIView

Here is the call graph for this function:

Here is the caller graph for this function:

- (void) downloadScore: (id)  button

Starts downloading score's pdf associated with button and changes button's cell's accessoryview.

Parameters:
downloadScoresender of the action. Only ScoreListButtons allowed.

Here is the call graph for this function:

- (UIView *) IMSLPAccessoryViewForIndexPath: (NSIndexPath *)  indexPath

Creates accessoryview for IMSLP scorecell in indexPath.

Accessoryview created is based on score associated with cell and score's pdf. If pdf is already downloading downloadingAccessoryViewForIndexPath: is called. If it's already stored locally downloadedAccessoryViewForIndexPath: is called. If it's not either downloadableAccessoryViewForIndexPath: is called.

Parameters:
IMSLPAccessoryViewForIndexPathindexpath for cell
Returns:
accessoryview for cell as UIView

Here is the call graph for this function:

Here is the caller graph for this function:

- (id) initWithStyle: (UITableViewStyle)  style
masterController: (CatNiPViewController *)  controller
compositionData: (CompositionData *)  compData
editable: (BOOL)  ed 

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
- (UIView *) LocalAccessoryViewForIndexPath: (NSIndexPath *)  indexPath

Creates accessoryview for local score.

Accessoryview has addToPlaylist button and detail button.

Parameters:
LocalAccessoryViewForIndexPathindexpath for cell
Returns:
accessoryview for cell as UIView

Here is the call graph for this function:

Here is the caller graph for this function:

- (NSInteger) numberOfSectionsInTableView: (UITableView *)  tableView

UITableViewDataSource protocol function's implementation.

Returns 1

Parameters:
numberOfSectionsInTableViewself.tableView
Returns:
returns 1.
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)  interfaceOrientation [implementation]
- (void) showDetailsForScore: (id)  button

Shows details popover about the score associated with given button.

Parameters:
showDetailsForScoresender of the action. Only ScoreListButtons allowed.
- (BOOL) tableView: (UITableView *)  tableView
canEditRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDataSource protocol function's implementation.

Parameters:
tableViewself.tableView
canEditRowAtIndexPathindexPath for cell
Returns:
self.editable
- (UITableViewCell *) tableView: (UITableView *)  tableView
cellForRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDataSource protocol function's implementation.

Parameters:
tableViewself.tableView
cellForRowAtIndexPathindexPath for cell to be created
Returns:
created cell for given arguments

Here is the call graph for this function:

- (void) tableView: (UITableView *)  tableView
commitEditingStyle: (UITableViewCellEditingStyle)  editingStyle
forRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDataSource protocol function's implementation.

Assumes that all editing is deleting score represented in forRowAtIndexPath. Removes all local references to that score and finally deletes the pdf-file associated with the score.

Parameters:
tableViewself.tableView
commitEditingStyleUITableViewCellEditingStyle
forRowAtIndexPathindexPath for cell

Here is the call graph for this function:

- (void) tableView: (UITableView *)  tableView
didSelectRowAtIndexPath: (NSIndexPath *)  indexPath 

UITableViewDelegate protocol function's implementation.

Shows pdf associated with score. If LIBRARYTYPE is IMSLP then downloads it first if it's not already downloaded or currently downloading in which cases does nothing.

Parameters:
tableViewself.tableView
didSelectRowAtIndexPathindexPath for selected cell

Here is the call graph for this function:

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

UITableViewDelegate protocol function's implementation.

Parameters:
tableViewtableView of the cell
editingStyleForRowAtIndexPathindexPath of the cell
Returns:
if self.editable == YES return UITableViewCellEditingStyleDelete else returns UITableViewCellEditingStyleNone
- (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) * 25 + 50 where l is |composer| + |composition| + 3.

Parameters:
tableViewself.tableView
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:
tableViewself.tableView
heightRowAtIndexPathindexPath of the cell which height is being calculated
Returns:
height of row as CGFloat.
- (NSInteger) tableView: (UITableView *)  tableView
numberOfRowsInSection: (NSInteger)  section 
[implementation]

UITableViewDataSource protocol function's implementation.

Parameters:
tableViewself.tableView
numberOfRowsInSectionOnly one section (0) in self.tableView
Returns:
amount of scores in selected library for given composition
- (UIView *) tableView: (UITableView *)  tableView
viewForHeaderInSection: (NSInteger)  section 

tableViewDelegate protocol function's implementation.

Creates an UILabel for self.tableView header (it has only one section) and sets its textLabel.text = "Scores for: composition". Header backgroundcolor has alpha component set to 0.4 so that text behind it can be seen.

Parameters:
tableViewself.tableView
sectiononly one section (0) in this table at the moment.
Returns:
view for header in section
- (void) updateProgressView: (NSTimer *)  nt

Updates UIProgressview associated with this NSTimer.

Timer's userinfo (NSArray) has progressview (index:0) and pdf(index:1) of the file for which IMSLPQueryHelper's downloadProgressFor: function is called.

Parameters:
updateProgressViewNSTimer object which makes the calls to this function.

Here is the call graph for this function:

- (void) viewDidAppear: (BOOL)  animated [implementation]
- (void) viewDidDisappear: (BOOL)  animated [implementation]
- (void) viewDidLoad [implementation]
- (void) viewDidUnload [implementation]
- (void) viewWillAppear: (BOOL)  animated [implementation]
- (void) viewWillDisappear: (BOOL)  animated [implementation]

Member Data Documentation

- (CatNiPViewController*) master [protected]

Property Documentation

- (NSString *) composer [read, write, retain]
- (NSString *) composition [read, write, retain]
- (CompositionData *) compositionData [read, write, retain]
- (BOOL) editable [read, write, assign]
- (IBOutlet CatNiPViewController*) master [read, write, retain]

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