2010-10-02 18:23:33 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-10-02 18:23:33 +02:00
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COLLAPSIBLEINFOPANE_H
|
|
|
|
#define COLLAPSIBLEINFOPANE_H
|
|
|
|
|
2010-10-09 14:39:49 +02:00
|
|
|
#include <QIcon>
|
2010-10-02 18:23:33 +02:00
|
|
|
#include <QWidget>
|
|
|
|
|
2010-10-07 23:06:26 +02:00
|
|
|
class CollapsibleInfoHeader;
|
|
|
|
|
2010-10-02 18:23:33 +02:00
|
|
|
class CollapsibleInfoPane : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2010-10-09 14:39:49 +02:00
|
|
|
struct Data {
|
|
|
|
Data() : type_(Type_Biography), relevance_(0) {}
|
2010-10-02 18:23:33 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
bool operator<(const Data& other) const;
|
2010-10-09 14:39:49 +02:00
|
|
|
|
|
|
|
enum Type {
|
2010-10-10 19:59:23 +02:00
|
|
|
Type_PlayCounts,
|
|
|
|
Type_Tags,
|
2010-10-10 23:45:01 +02:00
|
|
|
Type_Similar,
|
2010-10-10 19:59:23 +02:00
|
|
|
Type_Biography,
|
|
|
|
Type_Lyrics,
|
2010-10-09 14:39:49 +02:00
|
|
|
TypeCount
|
|
|
|
};
|
|
|
|
|
2010-10-11 21:49:12 +02:00
|
|
|
QString id_;
|
2010-10-09 14:39:49 +02:00
|
|
|
QString title_;
|
|
|
|
QIcon icon_;
|
|
|
|
Type type_;
|
|
|
|
int relevance_;
|
|
|
|
|
|
|
|
QWidget* contents_;
|
2013-10-09 19:33:59 +02:00
|
|
|
QObject* content_object_;
|
2010-10-09 14:39:49 +02:00
|
|
|
};
|
|
|
|
|
2014-02-10 16:03:54 +01:00
|
|
|
CollapsibleInfoPane(const Data& data, QWidget* parent = nullptr);
|
2010-10-09 14:39:49 +02:00
|
|
|
|
|
|
|
const Data& data() const { return data_; }
|
2010-10-02 18:23:33 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public slots:
|
2010-10-02 18:23:33 +02:00
|
|
|
void Expand();
|
|
|
|
void Collapse();
|
|
|
|
|
2020-09-18 16:15:19 +02:00
|
|
|
signals:
|
2010-10-11 23:42:31 +02:00
|
|
|
void Toggled(bool expanded);
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private slots:
|
2010-10-07 23:06:26 +02:00
|
|
|
void ExpandedToggled(bool expanded);
|
2010-10-02 18:23:33 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2010-10-09 14:39:49 +02:00
|
|
|
Data data_;
|
2010-10-07 23:06:26 +02:00
|
|
|
CollapsibleInfoHeader* header_;
|
2010-10-02 18:23:33 +02:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // COLLAPSIBLEINFOPANE_H
|