Sayonara Player
PlaylistContextMenu.h
1 /* PlaylistContextMenu.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef PLAYLISTCONTEXTMENU_H
24 #define PLAYLISTCONTEXTMENU_H
25 
26 #include "GUI/Utils/ContextMenu/LibraryContextMenu.h"
27 
28 class MetaData;
30  public LibraryContextMenu
31 {
32  Q_OBJECT
33  PIMPL(PlaylistContextMenu)
34 
35 signals:
36  void sig_rating_changed(Rating rating);
37  void sig_bookmark_pressed(Seconds timestamp);
38 
39 public:
40  enum Entry
41  {
42  EntryRating=(LibraryContextMenu::EntryLast << 1),
43  EntryBookmarks=(EntryRating << 1)
44  };
45 
46  using Entries=LibraryContextMenu::Entries;
47 
48  explicit PlaylistContextMenu(QWidget* parent);
50 
51  PlaylistContextMenu::Entries get_entries() const override;
52  void show_actions(PlaylistContextMenu::Entries entries) override;
53 
58  void set_rating(Rating rating);
59  void set_metadata(const MetaData& md);
60 
61 private:
62  QAction* init_rating_action(Rating rating, QObject* parent);
63  void language_changed() override;
64  void skin_changed() override;
65 
66 private slots:
67  void bookmark_pressed(Seconds timestamp);
68 };
69 
70 
71 #endif // PLAYLISTCONTEXTMENU_H
The MetaData class.
Definition: MetaData.h:48
Definition: PlaylistContextMenu.h:29
void set_rating(Rating rating)
set rating for the rating entry
PlaylistContextMenu::Entries get_entries() const override
get all visible entries
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:36
void show_actions(PlaylistContextMenu::Entries entries) override
show a specific amount of Entries