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=(Library::ContextMenu::EntryLast << 1),
53  EntrySorting=(EntryShowUtils << 1),
54  EntryZoom=(EntrySorting << 1),
55  EntryShowArtist=(EntryZoom << 1)
56  };
57 
58  explicit CoverViewContextMenu(QWidget* parent);
59  ~CoverViewContextMenu() override;
60 
61  CoverViewContextMenu::Entries get_entries() const override;
62  void show_actions(CoverViewContextMenu::Entries entries) override;
63 
64  protected:
65  void showEvent(QShowEvent* e) override;
66 
67  private:
68  void language_changed() override;
69 
70  void init();
71  void init_sorting_actions();
72  void init_zoom_actions();
73 
74  void set_zoom(int zoom);
75  void set_sorting(Library::SortOrder so);
76 
77  private slots:
78  void action_zoom_triggered(bool b);
79  void action_sorting_triggered(bool b);
80  };
81 }
82 #endif // COVERVIEWCONTEXTMENU_H
Library::CoverViewContextMenu
Context menu with some additional actions compared to Gui::LibraryContextMenu.
Definition: CoverViewContextMenu.h:39
Library::CoverViewContextMenu::get_entries
CoverViewContextMenu::Entries get_entries() const override
get all visible entries
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32
Library::CoverViewContextMenu::show_actions
void show_actions(CoverViewContextMenu::Entries entries) override
show a specific amount of Entries
MetaData
The MetaData class.
Definition: MetaData.h:44
Library::ContextMenu
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:43
Library::SortOrder
SortOrder
The SortOrder enum.
Definition: Sortorder.h:31