Sayonara Player
LibraryContextMenu.h
1 /* LibraryContextMenu.h */
2 
3 /* Copyright (C) 2011-2016 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 LIBRARYCONTEXTMENU_H
24 #define LIBRARYCONTEXTMENU_H
25 
26 #include <QMenu>
27 #include <QAction>
28 #include <QEvent>
29 #include "Helper/Settings/SayonaraClass.h"
30 
31 typedef int LibraryContexMenuEntries;
32 
33 class LibraryContextMenu : public QMenu, private SayonaraClass
34 {
35  Q_OBJECT
36 
37 
38 public:
39  explicit LibraryContextMenu(QWidget *parent=nullptr);
40  virtual ~LibraryContextMenu();
41 
42 
43  enum Entry {
44  EntryNone=0,
45  EntryInfo=(1<<0),
46  EntryEdit=(1<<1),
47  EntryLyrics=(1<<2),
48  EntryRemove=(1<<3),
49  EntryDelete=(1<<4),
50  EntryPlayNext=(1<<5),
51  EntryAppend=(1<<6),
52  EntryRefresh=(1<<7),
53  EntryClear=(1<<8)
54  };
55 
56  LibraryContexMenuEntries get_entries() const;
57  void show_actions(LibraryContexMenuEntries entries);
58  void show_action(Entry entry, bool visible);
59  void show_all();
60 
61 
62 signals:
63  void sig_info_clicked();
64  void sig_edit_clicked();
65  void sig_lyrics_clicked();
66  void sig_remove_clicked();
67  void sig_delete_clicked();
68  void sig_play_next_clicked();
69  void sig_append_clicked();
70  void sig_refresh_clicked();
71  void sig_clear_clicked();
72 
73 
74 private:
75  QAction* _info_action=nullptr;
76  QAction* _lyrics_action=nullptr;
77  QAction* _edit_action=nullptr;
78  QAction* _remove_action=nullptr;
79  QAction* _delete_action=nullptr;
80  QAction* _play_next_action=nullptr;
81  QAction* _append_action=nullptr;
82  QAction* _refresh_action=nullptr;
83  QAction* _clear_action=nullptr;
84 
85 
86 
87 protected:
88  void changeEvent(QEvent* e);
89 
90 private slots:
91  void skin_changed();
92 
93 };
94 
95 
96 #endif // LIBRARYCONTEXTMENU_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:31
Definition: LibraryContextMenu.h:33