Sayonara Player
CoverView.h
1 /* CoverView.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 #ifndef ALBUMCOVERVIEW_H
23 #define ALBUMCOVERVIEW_H
24 
25 #include "GUI/Library/Views/ItemView.h"
26 #include "Utils/Pimpl.h"
27 #include "Utils/Library/Sortorder.h"
28 
29 namespace Library
30 {
31  class CoverModel;
32  class CoverView :
33  public Library::ItemView
34  {
35  Q_OBJECT
36  PIMPL(CoverView)
37 
38  public:
39  explicit CoverView(AbstractLibrary* library, QWidget* topbar, QWidget* parent=nullptr);
40  virtual ~CoverView();
41 
42  void refresh();
43  void language_changed() override;
44 
45 
46  protected:
47  void wheelEvent(QWheelEvent* e) override;
48  void resizeEvent(QResizeEvent* e) override;
49  void showEvent(QShowEvent* e) override;
50 
51  QStyleOptionViewItem viewOptions() const override;
52 
53  void init_context_menu() override;
54  void init_sorting_actions();
55  void init_zoom_actions();
56 
57  //SayonaraSelectionView
58  int index_by_model_index(const QModelIndex& idx) const override;
59  QModelIndex model_index_by_index(int idx) const override;
60 
61  private:
62  void change_zoom(int zoom=-1);
63  void middle_clicked() override;
64  void play_next_clicked() override;
65  void append_clicked() override;
66  void selection_changed(const IndexSet& indexes) override;
67 
68 
69  private slots:
70  void albums_ready();
71  void timed_out();
72  void change_sortorder(::Library::SortOrder so);
73  void menu_sorting_triggered();
74  void combo_sorting_changed(int idx);
75  void combo_zoom_changed(int idx);
76  void show_utils_triggered();
77  void cover_changed();
78 
79  void double_clicked(const QModelIndex& index);
80  };
81 }
82 
83 #endif // ALBUMCOVERVIEW_H
Definition: AbstractLibrary.h:47
An interface class needed when implementing a library plugin.
Definition: LibraryManager.h:36
Definition: CoverView.h:32
Definition: ItemView.h:51
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: AbstractPlaylist.h:36