Sayonara Player
PlaylistContextMenu.h
1 /* PlaylistContextMenu.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 sigRatingChanged(Rating rating);
42  void sigBookmarkPressed(Seconds timestamp);
43  void sigJumpToCurrentTrack();
44  void sigFindTrackTriggered();
45  void sigReverseTriggered();
46 
47  public:
48  enum Entry
49  {
50  EntryRating = (Library::ContextMenu::EntryLast << 1),
51  EntryBookmarks = (Library::ContextMenu::EntryLast << 2),
52  EntryCurrentTrack = (Library::ContextMenu::EntryLast << 3),
53  EntryFindInLibrary = (Library::ContextMenu::EntryLast << 4),
54  EntryReverse = (Library::ContextMenu::EntryLast << 5)
55  };
56 
57  explicit ContextMenu(QWidget* parent);
58  ~ContextMenu() override;
59 
60  ContextMenu::Entries entries() const override;
61  void showActions(ContextMenu::Entries entries) override;
62 
63  void setRating(Rating rating);
64  void setMetadata(const MetaData& md);
65 
66  private:
67  QAction* initRatingAction(Rating rating, QObject* parent);
68 
69  private slots:
70  void bookmarkPressed(Seconds timestamp);
71 
72  protected:
73  void languageChanged() override;
74  void skinChanged() override;
75  };
76 }
77 
78 
79 #endif // PLAYLISTCONTEXTMENU_H
Playlist::ContextMenu::entries
ContextMenu::Entries entries() const override
get all visible entries
Playlist::ContextMenu
The PlaylistContextMenu class.
Definition: PlaylistContextMenu.h:36
MetaData
The MetaData class.
Definition: MetaData.h:47
Library::ContextMenu
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:45
Playlist::ContextMenu::showActions
void showActions(ContextMenu::Entries entries) override
show a specific amount of Entries