Sayonara Player
Loading...
Searching...
No Matches
CoverView.h
1/* CoverView.h */
2
3/* Copyright (C) 2011-2024 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 COVERVIEW_H
22#define COVERVIEW_H
23
24#include "CoverViewSortorderInfo.h"
25#include "Gui/Library/ItemView.h"
26#include "Utils/Library/Sortorder.h"
27
28class LocalLibrary;
29class QAction;
30
31namespace Library
32{
33 class MergeData;
34
39 class CoverView :
40 public ItemView
41 {
42 Q_OBJECT
43 PIMPL(CoverView)
44
45 public:
46 explicit CoverView(QWidget* parent = nullptr);
47 ~CoverView() override;
48
49 void init(LocalLibrary* library);
50 AbstractLibrary* library() const override;
51
52 // QAbstractItemView
53 QStyleOptionViewItem viewOptions() const override;
54
55 //SayonaraSelectionView
56 int mapModelIndexToIndex(const QModelIndex& idx) const override;
57 ModelIndexRange mapIndexToModelIndexes(int idx) const override;
58 SelectionViewInterface::SelectionType selectionType() const override;
59
60 int zoom() const;
61 void changeZoom(int zoom = -1);
62 void changeSortorder(AlbumSortorder so);
63
64 static QList<CoverViewSortorderInfo> sortingActions();
65 static QList<int> zoomFactors();
66
67 public slots:
68 void reload();
69 void clearCache();
70
71 protected:
72 void fill() override;
73 void initContextMenu() override;
74
75 void languageChanged() override;
76
77 // ItemView
78 bool isMergeable() const override;
79 MD::Interpretation metadataInterpretation() const override;
80
81 int sizeHintForColumn(int) const override;
82
83 void wheelEvent(QWheelEvent* e) override;
84 void resizeEvent(QResizeEvent* e) override;
85 void hideEvent(QHideEvent* e) override;
86
87 private:
88 void resizeSections();
89
90 // Library::ItemView
91 void playClicked() override;
92 void playNewTabClicked() override;
93 void playNextClicked() override;
94 void appendClicked() override;
95 void selectedItemsChanged(const IndexSet& indexes) override;
96 void refreshClicked() override;
97 void runMergeOperation(const Library::MergeData& mergedata) override;
98 };
99}
100
101#endif // COVERVIEW_H
Definition AbstractLibrary.h:41
bool isMergeable() const override
indicates if multiple ids can be merged into one. For example if the same artist is written in three ...
Definition MergeData.h:33
Definition LocalLibrary.h:38
Definition EngineUtils.h:33