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

#import <CatNiPViewController.h>

Inheritance diagram for CatNiPViewController:
Collaboration diagram for CatNiPViewController:

List of all members.

Public Member Functions

(NSInteger) - arrayToSearch:textToSearch:
 very lazy search from arrayToSearch with given textToSearch.
(NSInteger) - compositionDatasToSearch:textToSearch:
(void) - dealloc [implementation]
(void) - didReceiveMemoryWarning [implementation]
(void) - didRotateFromInterfaceOrientation: [implementation]
(void) - dismissPlaylistPopover
 Dismiss the playlistPopover.
(void) - dismissScorePopover
 Dismiss the scorePopover.
(IBAction) - fitToWidth:
(void) - hideToolbarWithAnimation
 hide toolbar with animation
(void) - hideViewWithAnimation:
 show any view with animation
(void) - imslpComposersReport: [implementation]
 Target method for IMSLPQueryHelper, receives reports on composer list progress.
(void) - imslpCompositionsReport: [implementation]
 Target method for IMSLPQueryHelper, receives reports on composition list progress.
(void) - imslpPageReport: [implementation]
(void) - libraryTypeChanged: [implementation]
 Target method for segmented control libraryType.
(void) - openDetailPopoverFromRect:inView:withScore:ofComposer:andComposition:
 Opens popover with information from given ScoreData object.
(void) - openPlaylistPopover:
 Open playlist popover with all playlists as cells.
(void) - openScorePopover:editable:
 Open ScorePopoverController's view in UIPopoverController.
(BOOL) - openScoreSheet:
 Work method for "opening" a pdf file, needed since navigating a playlist needs to display PDFs too.
(void) - playlistNavigatorChanged: [implementation]
 Target method for playlist navigation (previous score, next score) button clicks.
(void) - processError: [implementation]
 CatNiPErrorConsumer protocol implementation.
(void) - saveAndShowScore:: [implementation]
 Save and show score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource.
(void) - saveScore:: [implementation]
 Save score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource.
(void) - scoreView_tapped:
 Master method for recognizing tapping gestures in scoresView.
(void) - searchBar:textDidChange:
 UISearchBarDelegate protocol function's implementation.
(void) - searchBarSearchButtonClicked:
 UISearchBarDelegate protocol function's implementation.
(void) - setCurrentPlaylist: [implementation]
 Custom accessor method for the current playlist property.
(BOOL) - shouldAutorotateToInterfaceOrientation: [implementation]
(IBAction) - showHideLibrary:
 Hide and show sheet search UI elements.
(IBAction) - showHideNotes:
 Shows and hides the notes popover.
(void) - showScoreSheets:
 Method for loading sheets defined in filepath.
(void) - showToolbarWithAnimation
 show toolbar with animation
(void) - showViewWithAnimation:
 show any view with animation
(UITableViewCell *) - tableView:createCellWithIdentifier:
 Create standard cell for application.
(void) - viewDidLoad [implementation]
(void) - viewDidUnload [implementation]

Protected Attributes

Playlist * _currentPlaylist
CompositionData_readComposition
UIPopoverController * detailPop
DetailPopoverControllerdpc
Playlist * dummyPlaylist
UIBarButtonItem * fitToWidthButton
IMSLPDelegateDataSourceIMSLPdds
UIActivityIndicatorView * libraryActivityIndicatorLeft
UIBarButtonItem * libraryButton
UISearchBar * librarySearchbarLeft
UISearchBar * librarySearchbarRight
UITableView * libraryTableViewLeft
UITableView * libraryTableViewRight
UISegmentedControl * libraryType
UIView * libraryViewLeft
UIView * libraryViewRight
LocalDelegateDataSourceLOCALdds
UIBarButtonItem * notesButton
UIPopoverController * notesPop
UITextView * notesTextView
NotesPopoverControllernpc
UIPopoverController * playlistPop
PlaylistsDelegateDataSourcePLAYLISTSdds
PlaylistPopoverControllerppc
UIPopoverController * scorePop
UIScoreViewscoreView
UISegmentedControl * searchType
ScorePopoverControllerspc
UIToolbar * toolbar
UIView * toolbarView

Properties

NSString * currentlyOpenedFile
Playlist * currentPlaylist
 Custom accessor method for the current playlist property.
NSInteger currentPlaylistIndex
LocalScoreDatacurrentScore
UIFont * defaultFont
IBOutlet DetailPopoverControllerdpc
IBOutlet UIBarButtonItem * fitToWidthButton
IMSLPDelegateDataSourceimslpDelegateAndDataSource
IBOutlet UIActivityIndicatorView * libraryActivityIndicatorLeft
IBOutlet UIBarButtonItem * libraryButton
IBOutlet UISearchBar * librarySearchbarLeft
IBOutlet UISearchBar * librarySearchbarRight
IBOutlet UITableView * libraryTableViewLeft
IBOutlet UITableView * libraryTableViewRight
IBOutlet UISegmentedControl * libraryType
IBOutlet UIView * libraryViewLeft
IBOutlet UIView * libraryViewRight
LocalDelegateDataSourcelocalDelegateAndDataSource
IBOutlet UIBarButtonItem * notesButton
IBOutlet NotesPopoverControllernpc
IBOutlet UIBarButtonItem * playlistNavigateButton
IBOutlet UISegmentedControl * playlistNavigateSControl
PlaylistsDelegateDataSourceplaylistsDelegateAndDataSource
IBOutlet
PlaylistPopoverController
ppc
IBOutlet UIScoreViewscoreView
IBOutlet UISegmentedControl * searchType
IBOutlet ScorePopoverControllerspc
IBOutlet UIToolbar * toolbar
IBOutlet UIView * toolbarView

Member Function Documentation

- (NSInteger) arrayToSearch: (NSArray *)  array
textToSearch: (NSString *)  text 

very lazy search from arrayToSearch with given textToSearch.

Searches arrayToSearch for textToSearch by comparing each index in arrayToSearch with textToSearch. If exact match is found returns that index else if arrayToSearch's string is compared to be later than textToSearch will return that index. Otherwise will return 0 (ie. all arrayToSearch's strings are compared to be before textToSearch.)

Parameters:
arrayToSearchsearches the array with the given text
textToSearchgiven text that is searched from the array
Returns:
exact match or one after it. If no such index, then returns 0

Here is the caller graph for this function:

- (NSInteger) compositionDatasToSearch: (NSArray *)  array
textToSearch: (NSString *)  text 

Here is the caller graph for this function:

- (void) dealloc [implementation]
- (void) didReceiveMemoryWarning [implementation]
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation)  fromInterfaceOrientation [implementation]
- (void) dismissPlaylistPopover

Dismiss the playlistPopover.

- (void) dismissScorePopover

Dismiss the scorePopover.

- (IBAction) fitToWidth: (id)  sender
- (void) hideToolbarWithAnimation

hide toolbar with animation

Here is the caller graph for this function:

- (void) hideViewWithAnimation: (UIView *)  view

show any view with animation

Here is the caller graph for this function:

- (void) imslpComposersReport: (id)  progress [implementation]

Target method for IMSLPQueryHelper, receives reports on composer list progress.

Sets IMSLPDelegateDataSource's composers array to progress array. If LIBRARYTYPE == IMSLP shows that array.

Parameters:
imslpComposersReportArray of composer names
- (void) imslpCompositionsReport: (id)  progress [implementation]

Target method for IMSLPQueryHelper, receives reports on composition list progress.

Removes all objects from IMSLPdds.compositions array and adds all objets from progress array to it. Sort IMSLPdds.compositions array afterwards and reloads libraryTableViewRight's data.

- (void) imslpPageReport: (id)  pageData [implementation]

Here is the call graph for this function:

- (void) libraryTypeChanged: (id)  sender [implementation]

Target method for segmented control libraryType.

Tracks which library type is currently selected and changes libraryTableViewLeft's and libraryTableViewRight's delegate and datasource to match current selection. Removes all objects from libraryDataTableLeft and libraryDataTableRight, hides current popovers and libraryViewRight before calling appropriate library delegate and datasource class' changeLibraryTypeTo function.

Parameters:
senderid of the sender. Used only by libraryType when selected segment changes.

Here is the call graph for this function:

- (void) openDetailPopoverFromRect: (CGRect)  rect
inView: (UIView *)  view
withScore: (ScoreData *)  score
ofComposer: (NSString *)  composer
andComposition: (NSString *)  composition 

Opens popover with information from given ScoreData object.

Parameters:
rectrectangle from which the popover is represented (arrow is shown in here)
viewview in which the rectangle is
withScoreScoreData object which popover shows
ofComposercomposer of the score
andCompositioncomposition of the score
- (void) openPlaylistPopover: (LocalScoreData *)  score

Open playlist popover with all playlists as cells.

- (void) openScorePopover: (CompositionData *)  scores
editable: (BOOL)  ed 

Open ScorePopoverController's view in UIPopoverController.

Initializes ScorePopoverController with data about selected composition's scores loaded from either local or IMSLP's library (depending on current delegate and datasource). Popover is sized to 500 x 400 pixels and the arrow points to the cell which opened the popover. Default arrow direction is right. Check ScorePopOverController for details about it's contents.

Parameters:
openScorePopoverCompositionData which scores are shown in popover
editablesets popover's scoreTableView to represents value of the parameter

Here is the caller graph for this function:

- (BOOL) openScoreSheet: (LocalScoreData *)  score

Work method for "opening" a pdf file, needed since navigating a playlist needs to display PDFs too.

Here is the call graph for this function:

Here is the caller graph for this function:

- (void) playlistNavigatorChanged: (id)  control [implementation]

Target method for playlist navigation (previous score, next score) button clicks.

Reads the next/previous Score in the current playlist and sets it as the current score. Does nothing if no playlist is set or if we're at the end of the playlist and next is pressed or if we're at the beginning of the playlist and previous is pressed.

Parameters:
controlThe UISegmentedControl that generated the event

Here is the call graph for this function:

- (void) processError: (NSError *)  error [implementation]

CatNiPErrorConsumer protocol implementation.

Receives errors reported to CatNiPErrorManager.

Parameters:
Thereported error to be processed/shown to the user.

Reimplemented from <CatNiPErrorConsumer>.

- (void) saveAndShowScore: (id)  fileNameParams
: (id)  ofComposition 
[implementation]

Save and show score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource.

Called after pdf-file has been downloaded from IMSLP.

Saves allLocalScores to default filepath afterwards.

Parameters:
pdf-filename(index:0) and full pdf-filepath with filename (index:1)
CompositionDataobject from where the score is searched with pdf-filename

Here is the call graph for this function:

- (void) saveScore: (id)  fileNameParams
: (id)  ofComposition 
[implementation]

Save score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource.

Called after pdf-file has been downloaded from IMSLP.

Saves allLocalScores to default filepath afterwards.

Parameters:
pdf-filename(index:0) and full pdf-filepath with filename (index:1)
CompositionDataobject from where the score is searched with pdf-filename

Here is the call graph for this function:

- (void) scoreView_tapped: (UIGestureRecognizer *)  recognizer

Master method for recognizing tapping gestures in scoresView.

If toolbar is shown will hide all UI elements. Otherwise will show toolbar.

Parameters:
scoreView_tappedUIGestureRecognizer that sends the message

Here is the call graph for this function:

- (void) searchBar: (UISearchBar *)  searchBar
textDidChange: (NSString *)  searchText 

UISearchBarDelegate protocol function's implementation.

Searches from either composers (left library table) or compositions (right library table) depending on which of them is selected.

Not supported atm. because of performance issues. ie. in long tables every letter takes about half a second or longer to be searched and makes longer search strings pain to write.

Parameters:
searchBareither left (composers) or right (compositions)
textDidChangesearch text that was written
- (void) searchBarSearchButtonClicked: (UISearchBar *)  searchBar

UISearchBarDelegate protocol function's implementation.

Basic search behaviour for both librarySearchL and librarySearchR. Searches arrays in currently active delegate for matches with arrayToSearh:textToSearch or CompositionDataToSearh:textToSearch functions. Playlist searchs are not implemented yet.

Parameters:
searchBarSearchButtonClickedlibrarySearchL or librarySearchR

Here is the call graph for this function:

- (void) setCurrentPlaylist: (Playlist *)  currentPlaylist [implementation]

Custom accessor method for the current playlist property.

Sets the current playlist property. If the property is not-nil and the playlist contains scores, opens the first score in the playlist and sets the current score index to the beginning of the playlist.

Parameters:
currentPlaylistThe playlist to display or nil to stop playlist navigation functionality

Here is the call graph for this function:

- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)  interfaceOrientation [implementation]
- (IBAction) showHideLibrary: (id)  sender

Hide and show sheet search UI elements.

This function dismisses notesPop, hides all library search elements if libraryTableViewLeft is shown. Otherwise it shows libraryType, libraryViewLeft and reloads libraryTableViewLeft's data.

Parameters:
showHideLibraryhides and shows sender's search UI elements

Here is the call graph for this function:

- (IBAction) showHideNotes: (id)  sender

Shows and hides the notes popover.

Parameters:
senderThe element that sent the action, ideally _notesButton.
Returns:
Nothing.
- (void) showScoreSheets: (LocalScoreData *)  score

Method for loading sheets defined in filepath.

Should hide all UI elements after loading and shows new sheets in scoreView.

Parameters:
showScoreSheetsshows score sheets from the filepath

Here is the call graph for this function:

Here is the caller graph for this function:

- (void) showToolbarWithAnimation

show toolbar with animation

Here is the caller graph for this function:

- (void) showViewWithAnimation: (UIView *)  view

show any view with animation

Here is the caller graph for this function:

- (UITableViewCell *) tableView: (UITableView *)  tableView
createCellWithIdentifier: (NSString *)  identifier 

Create standard cell for application.

No accessoryview or imageview defined.

standard "look" is defined by: cell.textLabel.lineBreakMode = UILineBreakModeWordWrap cell.textLabel.numberOfLines = 0 cell.textLabel.font = defaultFont cell.selectionStyle = UITableViewCellSelectionStyleGray

Parameters:
tableViewtableView for which cell is created
createCellWithIdentifieridentifier for cell. Used to dequeue reusable cells from tableview.
Returns:
created UITableViewCell

Here is the caller graph for this function:

- (void) viewDidLoad [implementation]

Here is the call graph for this function:

- (void) viewDidUnload [implementation]

Member Data Documentation

- (Playlist*) _currentPlaylist [protected]
- (UIPopoverController*) detailPop [protected]
- (DetailPopoverController*) dpc [protected]
- (Playlist*) dummyPlaylist [protected]
- (UIBarButtonItem*) fitToWidthButton [protected]
- (UIActivityIndicatorView*) libraryActivityIndicatorLeft [protected]
- (UIBarButtonItem*) libraryButton [protected]
- (UISearchBar*) librarySearchbarLeft [protected]
- (UISearchBar*) librarySearchbarRight [protected]
- (UITableView*) libraryTableViewLeft [protected]
- (UITableView*) libraryTableViewRight [protected]
- (UISegmentedControl*) libraryType [protected]
- (UIView*) libraryViewLeft [protected]
- (UIView*) libraryViewRight [protected]
- (UIBarButtonItem*) notesButton [protected]
- (UIPopoverController*) notesPop [protected]
- (UITextView*) notesTextView [protected]
- (NotesPopoverController*) npc [protected]
- (UIPopoverController*) playlistPop [protected]
- (PlaylistPopoverController*) ppc [protected]
- (UIPopoverController*) scorePop [protected]
- (UIScoreView*) scoreView [protected]
- (UISegmentedControl*) searchType [protected]
- (ScorePopoverController*) spc [protected]
- (UIToolbar*) toolbar [protected]
- (UIView*) toolbarView [protected]

Property Documentation

- (NSString*) currentlyOpenedFile [read, write, copy]
- (Playlist *) currentPlaylist [read, write, retain]

Custom accessor method for the current playlist property.

Returns:
The current playlist, or nil if no playlist is set.
- (NSInteger) currentPlaylistIndex [read, write, assign]
- (LocalScoreData *) currentScore [read, write, retain]
- (UIFont *) defaultFont [read, write, retain]
- (IBOutlet DetailPopoverController*) dpc [read, write, retain]
- (IBOutlet UIBarButtonItem*) fitToWidthButton [read, write, retain]
- (IMSLPDelegateDataSource*) imslpDelegateAndDataSource [read, write, retain]
- (IBOutlet UIActivityIndicatorView*) libraryActivityIndicatorLeft [read, write, retain]
- (IBOutlet UIBarButtonItem*) libraryButton [read, write, retain]
- (IBOutlet UISearchBar*) librarySearchbarLeft [read, write, retain]
- (IBOutlet UISearchBar*) librarySearchbarRight [read, write, retain]
- (IBOutlet UITableView*) libraryTableViewLeft [read, write, retain]
- (IBOutlet UITableView*) libraryTableViewRight [read, write, retain]
- (IBOutlet UISegmentedControl*) libraryType [read, write, retain]
- (IBOutlet UIView*) libraryViewLeft [read, write, retain]
- (IBOutlet UIView*) libraryViewRight [read, write, retain]
- (LocalDelegateDataSource*) localDelegateAndDataSource [read, write, retain]
- (IBOutlet UIBarButtonItem*) notesButton [read, write, retain]
- (IBOutlet NotesPopoverController*) npc [read, write, retain]
- (IBOutlet UIBarButtonItem*) playlistNavigateButton [read, write, retain]
- (IBOutlet UISegmentedControl*) playlistNavigateSControl [read, write, retain]
- (PlaylistsDelegateDataSource*) playlistsDelegateAndDataSource [read, write, retain]
- (IBOutlet PlaylistPopoverController*) ppc [read, write, retain]
- (IBOutlet UIScoreView*) scoreView [read, write, retain]
- (IBOutlet UISegmentedControl*) searchType [read, write, retain]
- (IBOutlet ScorePopoverController*) spc [read, write, retain]
- (IBOutlet UIToolbar*) toolbar [read, write, retain]
- (IBOutlet UIView*) toolbarView [read, write, retain]

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