finally kill NC::List
[ncmpcpp.git] / src / playlist_editor.h
blob266a04178465826cec181b027ceee809e67352ac
1 /***************************************************************************
2 * Copyright (C) 2008-2012 by Andrzej Rybczak *
3 * electricityispower@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef _PLAYLIST_EDITOR_H
22 #define _PLAYLIST_EDITOR_H
24 #include "playlist.h"
26 class PlaylistEditor : public Screen<NC::Window>, public Filterable, public HasSongs, public Searchable
28 public:
29 virtual void SwitchTo();
30 virtual void Resize();
32 virtual std::basic_string<my_char_t> Title();
34 virtual void Refresh();
35 virtual void Update();
37 virtual void EnterPressed() { AddToPlaylist(1); }
38 virtual void SpacePressed();
39 virtual void MouseButtonPressed(MEVENT);
40 virtual bool isTabbable() { return true; }
42 /// Filterable implementation
43 virtual std::string currentFilter();
44 virtual void applyFilter(const std::string &filter);
46 /// Searchable implementation
47 virtual bool search(const std::string &constraint);
48 virtual void nextFound(bool wrap);
49 virtual void prevFound(bool wrap);
51 /// HasSongs implementation
52 virtual std::shared_ptr<ProxySongList> getProxySongList();
54 virtual bool allowsSelection();
55 virtual void reverseSelection();
56 virtual MPD::SongList getSelectedSongs();
58 virtual void Locate(const std::string &);
60 virtual bool isMergable() { return true; }
62 void MoveSelectedItems(Playlist::Movement where);
64 bool isContentFiltered();
65 bool isNextColumnAvailable();
66 bool NextColumn();
67 bool isPrevColumnAvailable();
68 bool PrevColumn();
70 NC::Menu<std::string> *Playlists;
71 NC::Menu<MPD::Song> *Content;
73 protected:
74 virtual void Init();
75 virtual bool isLockable() { return true; }
77 private:
78 void AddToPlaylist(bool);
81 extern PlaylistEditor *myPlaylistEditor;
83 #endif