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

#import <CatNiPViewController.h>

List of all members.

Public Member Functions

(void) - searchBarSearchButtonClicked:
(void) - searchBar:textDidChange:
(void) - scoreView_tapped:
(IBAction) - fitToWidth:
(IBAction) - showHideNotes:
(IBAction) - showHideLibrary:
(void) - showToolbarWithAnimation
(void) - hideToolbarWithAnimation
(void) - hideViewWithAnimation:
(void) - showViewWithAnimation:
(NSInteger) - arrayToSearch:textToSearch:
(void) - showScoreSheets:
(UITableViewCell *) - tableView:createCellWithIdentifier:
(void) - configureCell:
(void) - openScorePopoverWithIMSLPCompositionData:
(void) - openScorePopoverWithLocalCompositionData:

Protected Attributes

UIView * _toolbarView
UIToolbar * _toolbar
UIBarButtonItem * _libraryButton
UISegmentedControl * _libType
UISegmentedControl * _searchType
UIBarButtonItem * _notesButton
UIView * _libViewL
UITableView * _libTabL
UISearchBar * _libSearchL
UIActivityIndicatorView * _activityIndicatorL
UIView * _libViewR
UITableView * _libTabR
UISearchBar * _libSearchR
UIPopoverController * scorePop
UIFont * defaultFont
NSMutableArray * _composers
NSMutableArray * _compositions
NSMutableArray * IMSLPcomposers
NSMutableArray * localcomposers
NSMutableArray * playlists
UIPopoverController * notesPop
UITextView * notesTextView
UIScoreView_scoreView
IMSLPCompositionData_readComposition
IMSLPDelegateDataSourceIMSLPdds
LocalDelegateDataSourceLOCALdds
PlaylistsDelegateDataSourcePLAYLISTSdds
Playlist * dummyPlaylist
NSMutableArray * downloadedFiles

Properties

NSMutableArray * libraryDataTableLeft
NSMutableArray * libraryDataTableRight
IBOutlet UIToolbar * toolbar
IBOutlet UIView * toolbarView
IBOutlet UIBarButtonItem * libraryButton
IBOutlet UIScoreViewscoreView
IMSLPDelegateDataSourceimslpDelegateAndDataSource
LocalDelegateDataSourcelocalDelegateAndDataSource
PlaylistsDelegateDataSourceplaylistsDelegateAndDataSource
IBOutlet UISegmentedControl * libraryType
IBOutlet UISegmentedControl * searchType
IBOutlet UIView * libraryViewRight
IBOutlet UIView * libraryViewLeft
IBOutlet UIActivityIndicatorView * activityIndicatorLeft
IBOutlet UISearchBar * librarySearchbarLeft
IBOutlet UITableView * libraryTableViewLeft
IBOutlet UISearchBar * librarySearchbarRight
IBOutlet UITableView * libraryTableViewRight
IBOutlet UIBarButtonItem * notesButton

Member Function Documentation

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

very lazy search from arrayToSearch with given textToSearch.

Search's 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
- (void) configureCell: (UITableViewCell *)  cell

Configures cell for default appearance.

Default values are:
textLabel.lineBreakMode= UILineBreakModeWordWrap
textLabel.numberOfLines = 0
textLabel.font = defaultFont
selectionStyle = UITableViewCellSelectionStyleGray

Parameters:
configureCellUITableViewCell to be configurated
- (IBAction) fitToWidth: (id)  sender
- (void) hideToolbarWithAnimation

hide toolbar with animation

- (void) hideViewWithAnimation: (UIView *)  view

show any view with animation

- (void) openScorePopoverWithIMSLPCompositionData: (IMSLPCompositionData *)  scores

Open ScorePopoverController's view in UIPopoverController.

Initializes ScorePopoverController with data about selected composition's scores loaded from IMSLP's library. 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.

- (void) openScorePopoverWithLocalCompositionData: (LocalCompositionData *)  scores

Open ScorePopoverController's view in UIPopoverController.

Initializes ScorePopoverController with data about selected composition's scores loaded from IMSLP's library. 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.

- (void) scoreView_tapped: (UIGestureRecognizer *)  recognizer

Master method for recognizing tapping gestures in scoresView

If tapping is done near top border of view will show toolbar and if tapping is done near right border of view shows scrollbar, else will hide all other UI elements than scoresView

Parameters:
scoreView_tappedUIGestureRecognizer that sends the message
- (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 _libSearchL and _libSearchR. Searches _composer or _composition array for searchBar's text with arrayToSearch:textToSearch-function and selects the row returned by that function.

Parameters:
searchBarSearchButtonClicked_libSearchL or _libSearchR
- (IBAction) showHideLibrary: (id)  sender

Hide and show sheet search UI elements.

Parameters:
showHideLibraryhides and shows sender's search UI elements
- (IBAction) showHideNotes: (id)  sender

Shows and hides the notes popover.

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

Method for loading sheets defined in indexPath in scorePopover.

Should hide all UI elements after loading and show new sheets in _noteView.

Parameters:
showScoreSheetsshows score sheets from the index path
- (void) showToolbarWithAnimation

show toolbar with animation

- (void) showViewWithAnimation: (UIView *)  view

show any view with animation

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

Member Data Documentation

- (UIActivityIndicatorView*) _activityIndicatorL [protected]
- (NSMutableArray*) _composers [protected]
- (NSMutableArray*) _compositions [protected]
- (UIBarButtonItem*) _libraryButton [protected]
- (UISearchBar*) _libSearchL [protected]
- (UISearchBar*) _libSearchR [protected]
- (UITableView*) _libTabL [protected]
- (UITableView*) _libTabR [protected]
- (UISegmentedControl*) _libType [protected]
- (UIView*) _libViewL [protected]
- (UIView*) _libViewR [protected]
- (UIBarButtonItem*) _notesButton [protected]
- (UIScoreView*) _scoreView [protected]
- (UISegmentedControl*) _searchType [protected]
- (UIToolbar*) _toolbar [protected]
- (UIView*) _toolbarView [protected]
- (UIFont*) defaultFont [protected]
- (NSMutableArray*) downloadedFiles [protected]
- (Playlist*) dummyPlaylist [protected]
- (NSMutableArray*) IMSLPcomposers [protected]
- (NSMutableArray*) localcomposers [protected]
- (UIPopoverController*) notesPop [protected]
- (UITextView*) notesTextView [protected]
- (NSMutableArray*) playlists [protected]
- (UIPopoverController*) scorePop [protected]

Property Documentation

- (IBOutlet UIActivityIndicatorView*) activityIndicatorLeft [read, write, retain]
- (IMSLPDelegateDataSource*) imslpDelegateAndDataSource [read, write, retain]
- (IBOutlet UIBarButtonItem*) libraryButton [read, write, retain]
- (NSMutableArray*) libraryDataTableLeft [read, write, retain]
- (NSMutableArray*) libraryDataTableRight [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]
- (PlaylistsDelegateDataSource*) playlistsDelegateAndDataSource [read, write, retain]
- (IBOutlet UIScoreView*) scoreView [read, write, retain]
- (IBOutlet UISegmentedControl*) searchType [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 Properties Defines