Sayonara Player
CoverViewContextMenu.h
1 /* CoverViewContextMenu.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 COVERVIEWCONTEXTMENU_H
22 #define COVERVIEWCONTEXTMENU_H
23 
24 #include "Gui/Utils/ContextMenu/LibraryContextMenu.h"
25 #include "Utils/Library/Sortorder.h"
26 #include <QStringList>
27 
28 class MetaData;
29 
30 namespace Library
31 {
32  class ActionPair;
33 
41  {
42  Q_OBJECT
44 
45  signals:
46  void sig_zoom_changed(int zoom);
47  void sig_sorting_changed(Library::SortOrder sortorder);
48 
49  public:
50  enum Entry
51  {
52  EntryShowUtils=(LibraryContextMenu::EntryLast << 1),
53  EntrySorting=(EntryShowUtils << 1),
54  EntryZoom=(EntrySorting << 1),
55  EntryShowArtist=(EntryZoom << 1)
56  };
57 
58  using Entries=LibraryContextMenu::Entries;
59 
60  explicit CoverViewContextMenu(QWidget* parent);
61  ~CoverViewContextMenu() override;
62 
63  CoverViewContextMenu::Entries get_entries() const override;
64  void show_actions(CoverViewContextMenu::Entries entries) override;
65 
66  protected:
67  void showEvent(QShowEvent* e) override;
68 
69  private:
70  void language_changed() override;
71  void skin_changed() override;
72 
73  void init();
74  void init_sorting_actions();
75  void init_zoom_actions();
76 
77  void set_zoom(int zoom);
78  void set_sorting(Library::SortOrder so);
79 
80  private slots:
81  void action_zoom_triggered(bool b);
82  void action_sorting_triggered(bool b);
83  };
84 }
85 #endif // COVERVIEWCONTEXTMENU_H
Context menu with some additional actions compared to Gui::LibraryContextMenu.
Definition: CoverViewContextMenu.h:39
SortOrder
The SortOrder enum.
Definition: Sortorder.h:31
The MetaData class.
Definition: MetaData.h:44
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:39
CoverViewContextMenu::Entries get_entries() const override
get all visible entries
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32