#import <UIKit/UIKit.h>

@class TuneViewController;
@class Playlist;

#define SECTION_INDEX 0//FIXME

@interface MainViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate>
{
	NSMutableArray *menuList;
	IBOutlet UITableView *tableView;
	IBOutlet UISearchBar *searchBar;
	IBOutlet UIBarButtonItem *searchButton;
	IBOutlet UIBarButtonItem *manageButton;
  IBOutlet UIBarButtonItem *bookmarkButtonItem;

	NSArray	*listContent;
	NSMutableArray *filteredListContent;
  Playlist *playlist;
  BOOL loading;
  Playlist *choosingTunes;
#if SECTION_INDEX
  int sectionCount;
  int sectionIndex[27];
#endif
}

@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) UISearchBar *searchBar;

@property (nonatomic, retain) NSArray *listContent;
@property (nonatomic, retain) NSMutableArray *filteredListContent;

@property (nonatomic, retain) Playlist *playlist;

@property (nonatomic, retain) Playlist *choosingTunes;

- (void)databaseChanged:(id)sender;
- (UITableViewCell *)tableviewCellWithReuseIdentifier:(NSString *)identifier;

- (void)setPlaylist:(Playlist *)playlist;

- (IBAction)donePressed:(id)sender;
- (IBAction)cancelPressed:(id)sender;
- (IBAction)bookmarkPressed:(id)sender;

#if SECTION_INDEX
- (void)buildSectionIndex;
#endif

- (void)filterTunes;

@end
