Sayonara Player
CoverViewContextMenu.h
1 /* CoverViewContextMenu.h */
2 
3 /* Copyright (C) 2011-2017 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 COVERVIEWCONTEXTMENU_H
24 #define COVERVIEWCONTEXTMENU_H
25 
26 #include "GUI/Utils/ContextMenu/LibraryContextMenu.h"
27 #include "Utils/Library/Sortorder.h"
28 #include <QStringList>
29 
30 class MetaData;
31 struct ActionPair;
32 
34  public LibraryContextMenu
35 {
36  Q_OBJECT
38 
39 signals:
40  void sig_zoom_changed(int zoom);
41  void sig_sorting_changed(Library::SortOrder sortorder);
42 
43 public:
44  enum Entry
45  {
46  EntryShowUtils=(LibraryContextMenu::EntryLast << 1),
47  EntrySorting=(EntryShowUtils << 1),
48  EntryZoom=(EntrySorting << 1),
49  EntryShowArtist=(EntryZoom << 1)
50  };
51 
52  using Entries=LibraryContextMenu::Entries;
53 
54  explicit CoverViewContextMenu(QWidget* parent);
56 
57  CoverViewContextMenu::Entries get_entries() const override;
58  void show_actions(CoverViewContextMenu::Entries entries) override;
59 
60 protected:
61  void showEvent(QShowEvent* e) override;
62 
63 private:
64  void language_changed() override;
65  void skin_changed() override;
66 
67  void init();
68  void init_sorting_actions();
69  void init_zoom_actions();
70 
71  void set_zoom(int zoom);
72  void set_sorting(Library::SortOrder so);
73 
74 private slots:
75  void action_zoom_triggered(bool b);
76  void action_sorting_triggered(bool b);
77 
78 
79 };
80 #endif // COVERVIEWCONTEXTMENU_H
Definition: CoverViewContextMenu.h:33
Definition: ActionPair.h:30
The MetaData class.
Definition: MetaData.h:48
CoverViewContextMenu::Entries get_entries() const override
get all visible entries
void show_actions(CoverViewContextMenu::Entries entries) override
show a specific amount of Entries
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:36