Sayonara Player
AlbumCoverView.h
1 /* AlbumCoverView.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 ALBUMCOVERVIEW_H
24 #define ALBUMCOVERVIEW_H
25 
26 #include "GUI/Library/Views/LibraryView.h"
27 #include "Helper/Pimpl.h"
28 
29 class AlbumCoverModel;
31  public LibraryView
32 {
33  Q_OBJECT
34  PIMPL(AlbumCoverView)
35 
36 public:
37  explicit AlbumCoverView(QWidget* parent=nullptr);
38  virtual ~AlbumCoverView();
39 
40  int get_index_by_model_index(const QModelIndex& idx) const override;
41  QModelIndex get_model_index_by_index(int idx) const override;
42 
43  void setModel(AlbumCoverModel* model);
44  void refresh();
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 private:
54  void change_zoom(int zoom=-1);
55 
56  void setModel(QAbstractItemModel* m) override;
57  void setModel(LibraryItemModel* m) override;
58 
59 private slots:
60  void timed_out();
61 };
62 
63 #endif // ALBUMCOVERVIEW_H
Definition: AlbumCoverModel.h:34
Definition: LibraryItemModel.h:33
Definition: LibraryView.h:53
Definition: AlbumCoverView.h:30