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 
28 namespace Playlist
29 {
34  class ContextMenu :
36  {
37  Q_OBJECT
38  PIMPL(ContextMenu)
39 
40  signals:
41  void sig_rating_changed(Rating rating);
42  void sig_bookmark_pressed(Seconds timestamp);
43  void sig_jump_to_current_track();
44  void sig_find_track_triggered();
45 
46  public:
47  enum Entry
48  {
49  EntryRating=(Library::ContextMenu::EntryLast << 1),
50  EntryBookmarks=(EntryRating << 1),
51  EntryCurrentTrack=(EntryBookmarks << 1),
52  EntryFindInLibrary=(EntryCurrentTrack << 1)
53  };
54 
55  explicit ContextMenu(QWidget* parent);
56  ~ContextMenu() override;
57 
58  ContextMenu::Entries get_entries() const override;
59  void show_actions(ContextMenu::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 
79 #endif // PLAYLISTCONTEXTMENU_H
The PlaylistContextMenu class.
Definition: PlaylistContextMenu.h:34
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:43
void show_actions(ContextMenu::Entries entries) override
show a specific amount of Entries
The MetaData class.
Definition: MetaData.h:44
ContextMenu::Entries get_entries() const override
get all visible entries
void set_rating(Rating rating)
set rating for the rating entry