1 /*
2    Project: MPDCon
3 
4    Copyright (C) 2004
5 
6    Author: Daniel Luederwald
7 
8    Created: 2004-05-12 17:59:14 +0200 by flip
9 
10    Collection Controller
11 
12    This application is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public
14    License as published by the Free Software Foundation; either
15    version 2 of the License, or (at your option) any later version.
16 
17    This application is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20    Library General Public License for more details.
21 
22    You should have received a copy of the GNU General Public
23    License along with this library; if not, write to the Free
24    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
25 */
26 
27 #ifndef _PCAPPPROJ_COLLECTIONCONTROLLER_H
28 #define _PCAPPPROJ_COLLECTIONCONTROLLER_H
29 
30 #include <AppKit/AppKit.h>
31 #include "MPDController.h"
32 #include "PlaylistItem.h"
33 #include "Strings.h"
34 #include "BoldFormatter.h"
35 #include "NormalFormatter.h"
36 
37 
38 @interface CollectionController : NSWindowController
39 {
40   IBOutlet NSBrowser *collectionView;
41   IBOutlet NSTableView *trackView;
42   IBOutlet NSWindow *window;
43   IBOutlet NSTextField *filterField;
44 
45   NSArray *allArtists;
46   NSArray *allAlbums;
47   NSArray *allSongs;
48   NSArray *filteredTracks;
49 }
50 
51 
52 
53 // Initialization Methods
54 + (id) sharedCollectionController;
55 
56 // Playlist Methods
57 - (void) addSelected: (id)sender;
58 
59 // Gui Methods
60 - (void) updateCollection: (id)sender;
61 - (void) doubleClicked: (id)sender;
62 - (void) filterCollection: (id)sender;
63 - (void) clearFilter: (id)sender;
64 
65 - (NSArray *) getAllTracks;
66 
67 // TableView dataSource Methods
68 - (NSInteger) numberOfRowsInTableView: (NSTableView *)tableView;
69 
70 -            (id) tableView: (NSTableView *)tableView
71   objectValueForTableColumn: (NSTableColumn *)tableColumn
72                         row:(NSInteger) row;
73 
74 
75 // Browser delegate Methods
76 - (NSInteger)browser:(NSBrowser *)sender numberOfRowsInColumn:(NSInteger)column;
77 - (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell
78           atRow:(NSInteger)row
79          column:(NSInteger)column;
80 - (NSString *)browser:(NSBrowser *)sender
81         titleOfColumn:(NSInteger)column;
82 
83 - (void) selectionChanged: (id)sender;
84 
85 
86 // TableView dragging Methods
87 - (BOOL) tableView: (NSTableView *)tv
88          writeRows: (NSArray *)rows
89       toPasteboard: (NSPasteboard*)pboard;
90 
91 // Notification Methods
92 - (void) didNotConnect: (NSNotification *)aNotif;
93 @end
94 
95 #endif
96