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 
27 class MetaData;
28 
29 namespace Playlist
30 {
35  class ContextMenu :
37  {
38  Q_OBJECT
39  PIMPL(ContextMenu)
40 
41  signals:
42  void sigRatingChanged(Rating rating);
43  void sigBookmarkPressed(Seconds timestamp);
44  void sigJumpToCurrentTrack();
45  void sigFindTrackTriggered();
46  void sigReverseTriggered();
47 
48  public:
49  enum Entry
50  {
51  EntryRating = (Library::ContextMenu::EntryLast << 1),
52  EntryBookmarks = (Library::ContextMenu::EntryLast << 2),
53  EntryCurrentTrack = (Library::ContextMenu::EntryLast << 3),
54  EntryFindInLibrary = (Library::ContextMenu::EntryLast << 4),
55  EntryReverse = (Library::ContextMenu::EntryLast << 5)
56  };
57 
58  ContextMenu(DynamicPlaybackChecker* dynamicPlaybackChecker, QWidget* parent);
59  ~ContextMenu() override;
60 
61  ContextMenu::Entries entries() const override;
62  void showActions(ContextMenu::Entries entries) override;
63 
64  ContextMenu::Entries setTrack(const MetaData& track, bool isCurrentTrack);
65  void clearTrack();
66 
67  private:
68  void setRating(Rating rating);
69  QAction* initRatingAction(Rating rating, QObject* parent);
70 
71  private slots:
72  void bookmarkPressed(Seconds timestamp);
73 
74  protected:
75  void languageChanged() override;
76  void skinChanged() override;
77  };
78 }
79 
80 #endif // PLAYLISTCONTEXTMENU_H
Definition: DynamicPlayback.h:24
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:45
The MetaData class.
Definition: MetaData.h:47
The PlaylistContextMenu class.
Definition: PlaylistContextMenu.h:37
ContextMenu::Entries entries() const override
get all visible entries
void showActions(ContextMenu::Entries entries) override
show a specific amount of Entries