1 /***************************************************************************
2 **                                                                        **
3 **  Polyphone, a soundfont editor                                         **
4 **  Copyright (C) 2013-2019 Davy Triponney                                **
5 **                                                                        **
6 **  This program is free software: you can redistribute it and/or modify  **
7 **  it under the terms of the GNU General Public License as published by  **
8 **  the Free Software Foundation, either version 3 of the License, or     **
9 **  (at your option) any later version.                                   **
10 **                                                                        **
11 **  This program is distributed in the hope that it will be useful,       **
12 **  but WITHOUT ANY WARRANTY; without even the implied warranty of        **
13 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          **
14 **  GNU General Public License for more details.                          **
15 **                                                                        **
16 **  You should have received a copy of the GNU General Public License     **
17 **  along with this program. If not, see http://www.gnu.org/licenses/.    **
18 **                                                                        **
19 ****************************************************************************
20 **           Author: Davy Triponney                                       **
21 **  Website/Contact: https://www.polyphone-soundfonts.com                 **
22 **             Date: 01.01.2013                                           **
23 ***************************************************************************/
24 
25 #ifndef SOUNDFONTCELLFULL_H
26 #define SOUNDFONTCELLFULL_H
27 
28 #include <QWidget>
29 class SoundfontInformation;
30 class SoundfontFilter;
31 
32 namespace Ui {
33 class SoundfontCellFull;
34 }
35 
36 class SoundfontCellFull : public QWidget
37 {
38     Q_OBJECT
39 
40 public:
41     explicit SoundfontCellFull(SoundfontInformation* soundfontInfo, QWidget *parent = nullptr);
42     ~SoundfontCellFull() override;
43     void setActive(bool isActive);
44     bool hasHeightForWidth() const override;
45     int heightForWidth(int width) const override;
getSoundfontId()46     int getSoundfontId() { return _soundfontId; }
47 
48 signals:
49     void itemClicked(SoundfontFilter * filter);
50 
51 protected:
52     void mouseDoubleClickEvent(QMouseEvent *event) override;
53 
54 private slots:
55     void on_labelAuthor_linkActivated(const QString &link);
56 
57 private:
58     class IconContainer
59     {
60     public:
61         IconContainer();
62 
63         QPixmap _downloadIcon;
64         QPixmap _downloadIconSelected;
65         QPixmap _commentIcon;
66         QPixmap _commentIconSelected;
67         QPixmap _userIcon;
68         QPixmap _userIconSelected;
69         QPixmap _dateIcon;
70         QPixmap _dateIconSelected;
71         QPixmap _copyrightIcon;
72         QPixmap _copyrightIconSelected;
73     };
74 
75     void initIcons();
76 
77     QString _title;
78     Ui::SoundfontCellFull *ui;
79     QString _normalStyleSheet;
80     QString _activeStyleSheet;
81     bool _active;
82     QString _authorTextNoColor;
83     int _soundfontId;
84     static IconContainer * s_icons;
85 };
86 
87 #endif // SOUNDFONTCELLFULL_H
88