Sayonara Player
CoverViewContextMenu.h
1 /* CoverViewContextMenu.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 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 sigZoomChanged(int zoom);
47  void sigSortingChanged(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 entries() const override;
62  void showActions(CoverViewContextMenu::Entries entries) override;
63 
64  private:
65  void init();
66  void initSortingActions();
67  void initZoomActions();
68 
69  void setZoom(int zoom);
70  void setSorting(Library::SortOrder so);
71 
72  private slots:
73  void actionZoomTriggered(bool b);
74  void actionSortingTriggered(bool b);
75 
76  protected:
77  void languageChanged() override;
78  void showEvent(QShowEvent* e) override;
79  };
80 }
81 #endif // COVERVIEWCONTEXTMENU_H
Library::CoverViewContextMenu
Context menu with some additional actions compared to Gui::LibraryContextMenu.
Definition: CoverViewContextMenu.h:41
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31
Library::CoverViewContextMenu::showActions
void showActions(CoverViewContextMenu::Entries entries) override
show a specific amount of Entries
MetaData
The MetaData class.
Definition: MetaData.h:47
Library::CoverViewContextMenu::entries
CoverViewContextMenu::Entries entries() const override
get all visible entries
Library::ContextMenu
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:45
Library::SortOrder
SortOrder
The SortOrder enum.
Definition: Sortorder.h:32