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 #ifndef PLAYLISTCONTEXTMENU_H
22 #define PLAYLISTCONTEXTMENU_H
23 
24 #include "Gui/Utils/ContextMenu/LibraryContextMenu.h"
25 
26 class MetaData;
27 
34 {
35  Q_OBJECT
36  PIMPL(PlaylistContextMenu)
37 
38 signals:
39  void sig_rating_changed(Rating rating);
40  void sig_bookmark_pressed(Seconds timestamp);
41  void sig_jump_to_current_track();
42  void sig_find_track_triggered();
43 
44 public:
45  enum Entry
46  {
47  EntryRating=(LibraryContextMenu::EntryLast << 1),
48  EntryBookmarks=(EntryRating << 1),
49  EntryCurrentTrack=(EntryBookmarks << 1),
50  EntryFindInLibrary=(EntryCurrentTrack << 1)
51  };
52 
53  using Entries=LibraryContextMenu::Entries;
54 
55  explicit PlaylistContextMenu(QWidget* parent);
57 
58  PlaylistContextMenu::Entries get_entries() const override;
59  void show_actions(PlaylistContextMenu::Entries entries) override;
60 
65  void set_rating(Rating rating);
66  void set_metadata(const MetaData& md);
67 
68 private:
69  QAction* init_rating_action(Rating rating, QObject* parent);
70  void language_changed() override;
71  void skin_changed() override;
72 
73 private slots:
74  void bookmark_pressed(Seconds timestamp);
75 };
76 
77 
78 #endif // PLAYLISTCONTEXTMENU_H
The MetaData class.
Definition: MetaData.h:44
The PlaylistContextMenu class.
Definition: PlaylistContextMenu.h:32
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:39
void set_rating(Rating rating)
set rating for the rating entry
PlaylistContextMenu::Entries get_entries() const override
get all visible entries