Sayonara Player
PlaylistContextMenu.h
1 /* PlaylistContextMenu.h */
2 
3 /* Copyright (C) 2011-2019 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  void sig_jump_to_current_track();
39 
40 public:
41  enum Entry
42  {
43  EntryRating=(LibraryContextMenu::EntryLast << 1),
44  EntryBookmarks=(EntryRating << 1),
45  EntryCurrentTrack=(EntryBookmarks << 1)
46  };
47 
48  using Entries=LibraryContextMenu::Entries;
49 
50  explicit PlaylistContextMenu(QWidget* parent);
52 
53  PlaylistContextMenu::Entries get_entries() const override;
54  void show_actions(PlaylistContextMenu::Entries entries) override;
55 
60  void set_rating(Rating rating);
61  void set_metadata(const MetaData& md);
62 
63 private:
64  QAction* init_rating_action(Rating rating, QObject* parent);
65  void language_changed() override;
66  void skin_changed() override;
67 
68 private slots:
69  void bookmark_pressed(Seconds timestamp);
70 };
71 
72 
73 #endif // PLAYLISTCONTEXTMENU_H
The MetaData class.
Definition: MetaData.h:44
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