1/*
2 * Copyright 2007-2010, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Stephan A��mus 	<superstippi@gmx.de>
7 *		Fredrik Mod��en 	<fredrik@modeen.se>
8 */
9#ifndef PLAYLIST_WINDOW_H
10#define PLAYLIST_WINDOW_H
11
12
13#include <Entry.h>
14#include <Window.h>
15
16#include "ListenerAdapter.h"
17
18
19class BMenuBar;
20class BMenuItem;
21class CommandStack;
22class Controller;
23class Notifier;
24class Playlist;
25class PlaylistListView;
26class RWLocker;
27class BButton;
28class BFilePanel;
29
30
31enum {
32	// file
33	M_PLAYLIST_OPEN = 'open',
34	M_PLAYLIST_SAVE = 'save',
35	M_PLAYLIST_SAVE_AS = 'svas',
36	M_PLAYLIST_SAVE_RESULT = 'psrs',
37
38	// edit
39	M_PLAYLIST_RANDOMIZE = 'rand',
40	M_PLAYLIST_REMOVE = 'rmov',
41	M_PLAYLIST_MOVE_TO_TRASH = 'trsh'
42};
43
44
45class PlaylistWindow : public BWindow {
46public:
47								PlaylistWindow(BRect frame,
48									Playlist* playlist,
49									Controller* controller);
50	virtual						~PlaylistWindow();
51
52	virtual	bool				QuitRequested();
53	virtual	void				MessageReceived(BMessage* message);
54
55private:
56			void				_CreateMenu(BRect& frame);
57			void				_ObjectChanged(const Notifier* object);
58			void				_SavePlaylist(const BMessage* filePanelMessage);
59			void				_SavePlaylist(const entry_ref& ref);
60			void				_SavePlaylist(BEntry& origEntry,
61									BEntry& tempEntry, const char* finalName);
62
63			Playlist*			fPlaylist;
64			PlaylistListView*	fListView;
65
66			BView*				fTopView;
67			BMenuItem*			fUndoMI;
68			BMenuItem*			fRedoMI;
69
70			RWLocker*			fLocker;
71			CommandStack*		fCommandStack;
72			ListenerAdapter		fCommandStackListener;
73
74			entry_ref			fSavedPlaylistRef;
75};
76
77
78#endif // PLAYLIST_WINDOW_H
79