scrollpad: explicitely include iostream
[ncmpcpp.git] / src / sel_items_adder.h
blob9366d819c58c71cc99bd63089cc89bfdc1bf4d7c
1 /***************************************************************************
2 * Copyright (C) 2008-2014 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 NCMPCPP_SEL_ITEMS_ADDER_H
22 #define NCMPCPP_SEL_ITEMS_ADDER_H
24 #include "runnable_item.h"
25 #include "interfaces.h"
26 #include "screen.h"
27 #include "song.h"
29 struct SelectedItemsAdder: Screen<NC::Menu<RunnableItem<std::string, void()>> *>, Tabbable
31 typedef SelectedItemsAdder Self;
32 typedef typename std::remove_pointer<WindowType>::type Component;
33 typedef Component::Item::Type Entry;
35 SelectedItemsAdder();
37 virtual void switchTo() OVERRIDE;
38 virtual void resize() OVERRIDE;
39 virtual void refresh() OVERRIDE;
41 virtual std::wstring title() OVERRIDE;
42 virtual ScreenType type() OVERRIDE { return ScreenType::SelectedItemsAdder; }
44 virtual void update() OVERRIDE { }
46 virtual void enterPressed() OVERRIDE;
47 virtual void spacePressed() OVERRIDE { }
48 virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
50 virtual bool isMergable() OVERRIDE { return false; }
52 protected:
53 virtual bool isLockable() OVERRIDE { return false; }
55 private:
56 void populatePlaylistSelector(BaseScreen *screen);
58 void addToCurrentPlaylist();
59 void addToNewPlaylist() const;
60 void addToExistingPlaylist(const std::string &playlist) const;
61 void addAtTheEndOfPlaylist() const;
62 void addAtTheBeginningOfPlaylist() const;
63 void addAfterCurrentSong() const;
64 void addAfterCurrentAlbum() const;
65 void addAfterHighlightedSong() const;
66 void cancel();
67 void exitSuccessfully(bool success) const;
69 void setDimensions();
71 size_t m_playlist_selector_width;
72 size_t m_playlist_selector_height;
74 size_t m_position_selector_width;
75 size_t m_position_selector_height;
77 Component m_playlist_selector;
78 Component m_position_selector;
80 MPD::SongList m_selected_items;
83 extern SelectedItemsAdder *mySelectedItemsAdder;
85 #endif // NCMPCPP_SEL_ITEMS_ADDER_H