CatNiP prefinal
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
Controller for popover that shows all the scores for the chosen compositionData object. More...
#import <ScorePopoverController.h>
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 | |
CatNiPViewController * | master |
Properties | |
NSString * | composer |
NSString * | composition |
CompositionData * | compositionData |
BOOL | editable |
IBOutlet CatNiPViewController * | master |
Controller for popover that shows all the scores for the chosen compositionData object.
Depending on the current LIBRARYTYPE and spesific score's download status alter's cells accessoryView's to represent relevant buttons.
API up to date 28.6.2011
Definition at line 17 of file ScorePopoverController.h.
- (void) addToPlaylist: | (id) | button |
Opens playlist popover to select playlist in which the score associated with given button will be added.
addToPlaylist | sender of the action. Only ScoreListButtons allowed. |
Definition at line 616 of file ScorePopoverController.m.
- (void) cancelDownload: | (id) | button |
Cancel's download of pdf associated with this button.
Accessoryview of this cell is updated after cancel.
cancelDownload | sender of the action. Only ScoreListButtons allowed. |
Definition at line 638 of file ScorePopoverController.m.
References IMSLPQueryHelper::abortRead:.
- (UIView *) createAccessoryViewForIndexPath: | (NSIndexPath *) | indexPath |
creates accessory view depending on current LIBRARYTYPE
Calls IMSLPAccessoryViewForIndexPath: or LocalAccessoryViewForIndexPath:
IcreateAccessoryViewForIndexPath | indexpath for cell |
Definition at line 359 of file ScorePopoverController.m.
References IMSLP, IMSLPAccessoryViewForIndexPath:, LIBRARYTYPE, LOCAL, and LocalAccessoryViewForIndexPath:.
- (ScoreListButton *) createAddToPlaylistButtonForScore: | (ScoreData *) | score |
Create add to playlist button which sends actions to addToPlaylist:
Definition at line 541 of file ScorePopoverController.m.
- (ScoreListButton *) createCancelButtonForScore: | (ScoreData *) | score |
Create cancel button which sends actions to cancelDownload:
Definition at line 553 of file ScorePopoverController.m.
- (ScoreListButton *) createDetailButtonForScore: | (ScoreData *) | score |
Create detail button which sends actions to showDetailsForScore:
Definition at line 517 of file ScorePopoverController.m.
- (ScoreListButton *) createDownloadButtonForScore: | (ScoreData *) | score |
Create download button which sends actions to downloadScore:
Definition at line 529 of file ScorePopoverController.m.
- (void) dealloc | [implementation] |
Definition at line 43 of file ScorePopoverController.m.
References composer, composition, and compositionData.
- (void) didReceiveMemoryWarning | [implementation] |
Definition at line 51 of file ScorePopoverController.m.
- (UIView *) downloadableAccessoryViewForIndexPath: | (NSIndexPath *) | indexPath |
Creates accessoryview for IMSLP score which can be downloaded.
Accessoryview has download button and detail button.
downloadableAccessoryViewForIndexPath | indexpath for cell |
Definition at line 434 of file ScorePopoverController.m.
References createDetailButtonForScore:, and createDownloadButtonForScore:.
- (UIView *) downloadedAccessoryViewForIndexPath: | (NSIndexPath *) | indexPath |
Creates accessoryview for IMSLP score which is already downloaded.
Accessoryview has 'check-mark' instead of download button and detail button.
downloadedAccessoryViewForIndexPath | indexpath for cell |
Definition at line 496 of file ScorePopoverController.m.
References createDetailButtonForScore:.
- (UIView *) downloadingAccessoryViewForIndexPath: | (NSIndexPath *) | indexPath |
Creates accessoryview for IMSLP score which is downloading at the moment.
Accessoryview has progressbar, cancel button and detail button.
downloadingAccessoryViewForIndexPath | indexpath for cell |
Definition at line 460 of file ScorePopoverController.m.
References createCancelButtonForScore:, and createDetailButtonForScore:.
- (void) downloadScore: | (id) | button |
Starts downloading score's pdf associated with button and changes button's cell's accessoryview.
downloadScore | sender of the action. Only ScoreListButtons allowed. |
Definition at line 568 of file ScorePopoverController.m.
References IMSLPAccessoryViewForIndexPath:, and IMSLPQueryHelper::readIMSLPFile:ofComposition:reportTo:withMethod:.
- (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.
IMSLPAccessoryViewForIndexPath | indexpath for cell |
Definition at line 382 of file ScorePopoverController.m.
References LocalDelegateDataSource::allLocalScores, downloadableAccessoryViewForIndexPath:, downloadedAccessoryViewForIndexPath:, downloadingAccessoryViewForIndexPath:, CatNiPViewController::localDelegateAndDataSource, master, and ScoreData::pdf.
- (id) initWithStyle: | (UITableViewStyle) | style | |
masterController: | (CatNiPViewController *) | controller | |
compositionData: | (CompositionData *) | compData | |
editable: | (BOOL) | ed | |
Basic init for ScorePopoverController, sets masterController = controller.
initWithStyle,: | check framework's API for UITableViewStyles |
masterController | master viewController in which this popover is represented. |
IMSLPCompositionData | IMSLPCompositionData object of given composition |
Definition at line 29 of file ScorePopoverController.m.
References CompositionData::composerName, and CompositionData::compositionName.
- (UIView *) LocalAccessoryViewForIndexPath: | (NSIndexPath *) | indexPath |
Creates accessoryview for local score.
Accessoryview has addToPlaylist button and detail button.
LocalAccessoryViewForIndexPath | indexpath for cell |
Definition at line 410 of file ScorePopoverController.m.
References createAddToPlaylistButtonForScore:, and createDetailButtonForScore:.
- (NSInteger) numberOfSectionsInTableView: | (UITableView *) | tableView |
UITableViewDataSource protocol function's implementation.
Returns 1
numberOfSectionsInTableView | self.tableView |
Definition at line 124 of file ScorePopoverController.m.
- (BOOL) shouldAutorotateToInterfaceOrientation: | (UIInterfaceOrientation) | interfaceOrientation | [implementation] |
Definition at line 104 of file ScorePopoverController.m.
- (void) showDetailsForScore: | (id) | button |
Shows details popover about the score associated with given button.
showDetailsForScore | sender of the action. Only ScoreListButtons allowed. |
Definition at line 597 of file ScorePopoverController.m.
- (BOOL) tableView: | (UITableView *) | tableView | |
canEditRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDataSource protocol function's implementation.
tableView | self.tableView |
canEditRowAtIndexPath | indexPath for cell |
Definition at line 177 of file ScorePopoverController.m.
- (UITableViewCell *) tableView: | (UITableView *) | tableView | |
cellForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDataSource protocol function's implementation.
tableView | self.tableView |
cellForRowAtIndexPath | indexPath for cell to be created |
Definition at line 147 of file ScorePopoverController.m.
References createAccessoryViewForIndexPath:, master, and CatNiPViewController::tableView:createCellWithIdentifier:.
- (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.
tableView | self.tableView |
commitEditingStyle | UITableViewCellEditingStyle |
forRowAtIndexPath | indexPath for cell |
Definition at line 192 of file ScorePopoverController.m.
References compositionData, CatNiPViewController::currentPlaylist, CatNiPViewController::currentScore, master, ScoreData::pdf, LocalDataHandler::removeAndDeleteLocalScoreData:fromScoreArray:andDictionary:andPlaylistArray:, and Playlist::scorelist.
- (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.
tableView | self.tableView |
didSelectRowAtIndexPath | indexPath for selected cell |
Definition at line 311 of file ScorePopoverController.m.
References LocalDelegateDataSource::allLocalScores, downloadingAccessoryViewForIndexPath:, IMSLP, LIBRARYTYPE, LOCAL, CatNiPViewController::localDelegateAndDataSource, master, ScoreData::pdf, and IMSLPQueryHelper::readIMSLPFile:ofComposition:reportTo:withMethod:.
- (UITableViewCellEditingStyle) tableView: | (UITableView *) | tableView | |
editingStyleForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
tableView | tableView of the cell |
editingStyleForRowAtIndexPath | indexPath of the cell |
Definition at line 346 of file ScorePopoverController.m.
References editable.
- (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.
tableView | self.tableView |
heightForHeaderInSection | only one section (0) in this table. |
Definition at line 280 of file ScorePopoverController.m.
- (CGFloat) tableView: | (UITableView *) | tableView | |
heightForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
UITableViewDelegate protocol function's implementation.
Calculate table row's height dynamically based on string's length.
tableView | self.tableView |
heightRowAtIndexPath | indexPath of the cell which height is being calculated |
Definition at line 294 of file ScorePopoverController.m.
- (NSInteger) tableView: | (UITableView *) | tableView | |
numberOfRowsInSection: | (NSInteger) | section | |
[implementation] |
UITableViewDataSource protocol function's implementation.
tableView | self.tableView |
numberOfRowsInSection | Only one section (0) in self.tableView |
Definition at line 136 of file ScorePopoverController.m.
- (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.
tableView | self.tableView |
section | only one section (0) in this table at the moment. |
Definition at line 242 of file ScorePopoverController.m.
- (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.
updateProgressView | NSTimer object which makes the calls to this function. |
Definition at line 671 of file ScorePopoverController.m.
References IMSLPQueryHelper::downloadProgressFor:.
- (void) viewDidAppear: | (BOOL) | animated | [implementation] |
Definition at line 89 of file ScorePopoverController.m.
- (void) viewDidDisappear: | (BOOL) | animated | [implementation] |
Definition at line 99 of file ScorePopoverController.m.
- (void) viewDidLoad | [implementation] |
Definition at line 61 of file ScorePopoverController.m.
- (void) viewDidUnload | [implementation] |
Definition at line 77 of file ScorePopoverController.m.
- (void) viewWillAppear: | (BOOL) | animated | [implementation] |
Definition at line 84 of file ScorePopoverController.m.
- (void) viewWillDisappear: | (BOOL) | animated | [implementation] |
Definition at line 94 of file ScorePopoverController.m.
- (CatNiPViewController*) master [protected] |
Definition at line 23 of file ScorePopoverController.h.
- (NSString *) composer [read, write, retain] |
Definition at line 20 of file ScorePopoverController.h.
- (NSString *) composition [read, write, retain] |
Definition at line 21 of file ScorePopoverController.h.
- (CompositionData *) compositionData [read, write, retain] |
Definition at line 24 of file ScorePopoverController.h.
- (BOOL) editable [read, write, assign] |
Definition at line 22 of file ScorePopoverController.h.
- (IBOutlet CatNiPViewController*) master [read, write, retain] |
Definition at line 27 of file ScorePopoverController.h.