Sayonara Player
AlbumCoverModel.h
1 /* AlbumCoverModel.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 ALBUMCOVERMODEL_H
24 #define ALBUMCOVERMODEL_H
25 
26 #include "GUI/Library/Models/LibraryItemModel.h"
27 #include "Helper/Pimpl.h"
28 #include <QThread>
29 
30 class Album;
31 class AlbumList;
32 class CoverLocation;
33 class CoverLookup;
35  public LibraryItemModel
36 {
37  Q_OBJECT
38  PIMPL(AlbumCoverModel)
39 
40 private:
41 
42 public:
43  explicit AlbumCoverModel(QObject* parent=nullptr);
44  virtual ~AlbumCoverModel();
45 
46  void set_data(const AlbumList& albums);
47 
48  // QAbstractItemModel interface
49 public:
50  int rowCount(const QModelIndex& parent=QModelIndex()) const override;
51  int columnCount(const QModelIndex& paren=QModelIndex()) const override;
52  QVariant data(const QModelIndex& index, int role) const override;
53  QSize get_item_size() const;
54 
55  QModelIndex getFirstRowIndexOf(const QString& substr) override;
56  QModelIndex getNextRowIndexOf(const QString& substr, int cur_row, const QModelIndex& parent=QModelIndex()) override;
57  QModelIndex getPrevRowIndexOf(const QString& substr, int cur_row, const QModelIndex& parent=QModelIndex()) override;
58  QMap<QChar, QString> getExtraTriggers() override;
59 
60  int get_searchable_column() const override;
61  QString get_string(int idx) const override;
62  int get_id_by_row(int idx) override;
63  CoverLocation get_cover(const SP::Set<int>& indexes) const override;
64 
65  void set_max_columns(int columns);
66 
67 public slots:
68  void set_zoom(int zoom);
69 
70 private slots:
71  void next_hash();
72 
73 };
74 
75 #endif // ALBUMCOVERMODEL_H
Definition: AlbumCoverModel.h:34
The CoverLocation class.
Definition: CoverLocation.h:37
The AlbumList class.
Definition: Album.h:78
Definition: LibraryItemModel.h:33
The Album class.
Definition: Album.h:38
The CoverLookup class.
Definition: CoverLookup.h:42
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: AbstractPlaylist.h:37
Definition: org_mpris_media_player2_adaptor.h:21