CatNiP prefinal
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
00001 00027 00028 00029 00030 00031 00032 00033 #import <UIKit/UIKit.h> 00034 00035 #import "UIScoreView.h" 00036 00037 #import "NotesPopoverController.h" 00038 #import "ScorePopoverController.h" 00039 #import "DetailPopoverController.h" 00040 #import "PlaylistPopoverController.h" 00041 00042 #import "IMSLPQueryHelper.h" 00043 00044 #import "IMSLPDelegateDataSource.h" 00045 #import "LocalDelegateDataSource.h" 00046 #import "PlaylistsDelegateDataSource.h" 00047 00048 #import "ScoreData.h" 00049 #import "CompositionData.h" 00050 00051 #import "LocalDataHandler.h" 00052 #import "LocalScoreData.h" 00053 #import "Playlist.h" 00054 00055 #import "CatNiPErrorConsumer.h" 00056 #import "CatNiPErrorManager.h" 00057 00059 00060 #define IMSLP 0 00061 #define LOCAL 1 00062 #define PLAYLISTS 2 00063 00064 @interface CatNiPViewController : UIViewController <CatNiPErrorConsumer> { 00065 00066 // toolbar and its contents 00067 UIView *toolbarView; 00068 UIToolbar *toolbar; 00069 UIBarButtonItem *libraryButton; 00070 UISegmentedControl *libraryType; 00071 UISegmentedControl *searchType; // not currently implemented 00072 UIBarButtonItem *notesButton; 00073 00074 // left side of library elements 00075 UIView *libraryViewLeft; 00076 UITableView *libraryTableViewLeft; 00077 UISearchBar *librarySearchbarLeft; 00078 UIActivityIndicatorView *libraryActivityIndicatorLeft; 00079 00080 // right side of library elements 00081 UIView *libraryViewRight; 00082 UITableView *libraryTableViewRight; 00083 UIBarButtonItem *fitToWidthButton; 00084 UISearchBar *librarySearchbarRight; 00085 00086 // default UIFont. Initialized in controller's init. 00087 UIFont *defaultFont; 00088 00089 // popover for showing all scores of selected composition 00090 UIPopoverController *scorePop; 00091 00092 // popover for showing detail info about score 00093 UIPopoverController *detailPop; 00094 00095 // popover and its view for user's own notes about currently selected sheets 00096 UIPopoverController *notesPop; 00097 UITextView *notesTextView; 00098 00099 // popover for selecting playlist in which previously selected score should be added 00100 UIPopoverController *playlistPop; 00101 00102 // popovers' contentviews' controllers 00103 DetailPopoverController *dpc; 00104 NotesPopoverController *npc; 00105 ScorePopoverController *spc; 00106 PlaylistPopoverController *ppc; 00107 00108 // 00109 CompositionData *_readComposition; 00110 00111 // delegates and datasources for different librarytypes 00112 IMSLPDelegateDataSource *IMSLPdds; 00113 LocalDelegateDataSource *LOCALdds; 00114 PlaylistsDelegateDataSource *PLAYLISTSdds; 00115 00116 //Playlist *dummyPlaylist; 00117 00118 Playlist *_currentPlaylist; 00119 LocalScoreData *currentScore; 00120 //NSString *currentlyOpenedFile; 00121 NSInteger currentPlaylistIndex; 00122 00123 // view for showing currently selected sheets for details check ScoreViewer-group 00124 UIScoreView *scoreView; 00125 } 00126 00127 /*** Toolbar for all teh fun, yeh? ***/ 00128 @property (nonatomic, retain) IBOutlet UIToolbar *toolbar; 00129 /*** which has a home in some view ***/ 00130 @property (nonatomic, retain) IBOutlet UIView *toolbarView; 00131 /*** and some fancy button in there ***/ 00132 @property (nonatomic, retain) IBOutlet UIBarButtonItem *libraryButton; 00133 /*** previous/next score in playlist button ***/ 00134 @property (nonatomic, retain) IBOutlet UIBarButtonItem *playlistNavigateButton; 00135 /*** view for sheets ***/ 00136 @property (nonatomic, retain) IBOutlet UIScoreView *scoreView; 00137 00138 /*** delegates and datasources for different library types ***/ 00139 @property (nonatomic, retain) IMSLPDelegateDataSource *imslpDelegateAndDataSource; 00140 @property (nonatomic, retain) LocalDelegateDataSource *localDelegateAndDataSource; 00141 @property (nonatomic, retain) PlaylistsDelegateDataSource *playlistsDelegateAndDataSource; 00142 00143 /*** Control for searching local or IMSLP(net) files ***/ 00144 /* IMSLP = 0 - LOCAL = 1 - PLAYLIST = 2 */ 00145 @property (nonatomic, retain) IBOutlet UISegmentedControl *libraryType; 00146 00147 @property (nonatomic, retain) IBOutlet UISegmentedControl *playlistNavigateSControl; 00148 00149 /*** NOT SHOWN IN UI AT THE MOMENT. Control for searchType. Only composer search implemented yet. ***/ 00150 @property (nonatomic, retain) IBOutlet UISegmentedControl *searchType; 00151 00152 /*** libraryViewX contains librarySearchbarX,libraryTableViewX and activityIndicatorX ***/ 00153 @property (nonatomic, retain) IBOutlet UIView *libraryViewRight; 00154 @property (nonatomic, retain) IBOutlet UIView *libraryViewLeft; 00155 @property (nonatomic, retain) IBOutlet UIActivityIndicatorView *libraryActivityIndicatorLeft; 00156 00157 // composer search and results 00158 @property (nonatomic, retain) IBOutlet UISearchBar *librarySearchbarLeft; 00159 @property (nonatomic, retain) IBOutlet UITableView *libraryTableViewLeft; 00160 00161 // composition search and results 00162 @property (nonatomic, retain) IBOutlet UISearchBar *librarySearchbarRight; 00163 @property (nonatomic, retain) IBOutlet UITableView *libraryTableViewRight; 00164 00165 // button for resizing the score view to fit-to-width 00166 @property (nonatomic, retain) IBOutlet UIBarButtonItem *fitToWidthButton; 00167 00168 // button for showing notes about the open score 00169 @property (nonatomic, retain) IBOutlet UIBarButtonItem *notesButton; 00170 00171 // popovers 00172 @property (nonatomic, retain) IBOutlet NotesPopoverController *npc; 00173 @property (nonatomic, retain) IBOutlet ScorePopoverController *spc; 00174 @property (nonatomic, retain) IBOutlet DetailPopoverController *dpc; 00175 @property (nonatomic, retain) IBOutlet PlaylistPopoverController *ppc; 00176 00177 @property (nonatomic, retain) UIFont *defaultFont; 00178 @property (retain) Playlist* currentPlaylist; 00179 @property (retain) LocalScoreData *currentScore; 00180 @property (copy) NSString* currentlyOpenedFile; 00181 @property (assign) NSInteger currentPlaylistIndex; 00182 00184 - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar; 00185 - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText; 00186 00188 -(void)scoreView_tapped:(UIGestureRecognizer *)recognizer; 00189 00191 - (IBAction)fitToWidth:(id)sender; 00192 00194 - (IBAction)showHideNotes:(id)sender; 00195 00197 - (IBAction)showHideLibrary:(id)sender; 00198 00199 // gief animations plox 00200 -(void)showToolbarWithAnimation; 00201 -(void)hideToolbarWithAnimation; 00202 -(void)hideViewWithAnimation:(UIView *)view; 00203 -(void)showViewWithAnimation:(UIView *)view; 00204 00206 - (NSInteger)arrayToSearch:(NSArray *)array textToSearch:(NSString *)text; 00207 -(NSInteger)compositionDatasToSearch:(NSArray *)array textToSearch:(NSString *)text; 00208 00210 -(void)showScoreSheets:(LocalScoreData *)score; 00212 -(BOOL)openScoreSheet:(LocalScoreData *)score; 00214 -(UITableViewCell *)tableView:(UITableView *)tb createCellWithIdentifier:(NSString *)identifier; 00215 00217 -(void)openScorePopover:(CompositionData *)scores editable:(BOOL)ed; 00218 -(void)dismissScorePopover; 00219 00221 -(void)openDetailPopoverFromRect:(CGRect)rect inView:(UIView *)view withScore:(ScoreData *)score ofComposer:(NSString *)composer andComposition:(NSString *)composition; 00222 00224 -(void)openPlaylistPopoverFromRect:(CGRect)rect inView:(UIView *)view withScore:(LocalScoreData *)score; 00226 -(void)dismissPlaylistPopover; 00227 00228 @end