Sayonara Player
CoverButton.h
1 /* CoverButton.h */
2 
3 /* Copyright (C) 2011-2015 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 COVER_BUTTON_H
24 #define COVER_BUTTON_H
25 
26 #include <QPushButton>
27 #include <QIcon>
28 #include "Components/Covers/CoverLocation.h"
29 
31 class CoverLookup;
32 
37 class CoverButton : public QPushButton
38 {
39  Q_OBJECT
40 
41 signals:
42  void sig_cover_replaced();
43  void sig_cover_found();
44 
45 public:
46  CoverButton(QWidget* parent=nullptr);
47  virtual ~CoverButton();
48 
49  bool has_valid_cover() const;
50  CoverLocation get_found_cover() const;
51  void set_cover_location(const CoverLocation& cl);
52  void force_icon(const QIcon& icon);
53 
54 private:
55  GUI_AlternativeCovers* _alternative_covers=nullptr;
56  CoverLookup* _cover_lookup=nullptr;
57  CoverLocation _found_cover_location;
58  CoverLocation _search_cover_location;
59  QString _text;
60  bool _cover_forced;
61 
62 private slots:
63  void cover_button_clicked();
64  void alternative_cover_fetched(const CoverLocation& cl);
65  void cover_found(const CoverLocation& cl);
66  void set_cover_image(const QString& cover_path);
67 };
68 
69 
70 #endif
The CoverButton class.
Definition: CoverButton.h:37
The CoverLocation class.
Definition: CoverLocation.h:38
The GUI_AlternativeCovers class.
Definition: GUI_AlternativeCovers.h:50
The CoverLookup class.
Definition: CoverLookup.h:65