2010-05-09 22:18:05 +02:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
|
|
|
|
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 RADIOVIEWCONTAINER_H
|
|
|
|
#define RADIOVIEWCONTAINER_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2010-06-09 17:38:00 +02:00
|
|
|
#include <QMap>
|
2010-05-09 22:18:05 +02:00
|
|
|
|
2010-06-09 17:38:00 +02:00
|
|
|
class LibraryFilterWidget;
|
2010-05-09 22:18:05 +02:00
|
|
|
class RadioModel;
|
|
|
|
class RadioService;
|
|
|
|
class RadioView;
|
2010-05-10 23:50:31 +02:00
|
|
|
class Ui_RadioViewContainer;
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
class QTimeLine;
|
2010-05-10 23:50:31 +02:00
|
|
|
class QModelIndex;
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
class RadioViewContainer : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RadioViewContainer(QWidget* parent = 0);
|
2010-05-10 23:50:31 +02:00
|
|
|
~RadioViewContainer();
|
2010-05-09 22:18:05 +02:00
|
|
|
|
2010-06-09 17:38:00 +02:00
|
|
|
static const int kAnimationDuration;
|
|
|
|
|
2010-05-09 22:18:05 +02:00
|
|
|
void SetModel(RadioModel* model);
|
|
|
|
|
2010-05-10 23:50:31 +02:00
|
|
|
RadioView* tree() const;
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
private slots:
|
2010-05-09 23:16:54 +02:00
|
|
|
void Collapsed(const QModelIndex& index);
|
|
|
|
void Expanded(const QModelIndex& index);
|
2010-05-09 22:18:05 +02:00
|
|
|
void CurrentIndexChanged(const QModelIndex& index);
|
2010-06-09 17:38:00 +02:00
|
|
|
void SetHeaderHeight(int height);
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
private:
|
2010-06-09 17:38:00 +02:00
|
|
|
void ServiceChanged(const QModelIndex& index);
|
|
|
|
void SetHeaderVisible(QWidget* header, bool visible);
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
private:
|
2010-05-10 23:50:31 +02:00
|
|
|
Ui_RadioViewContainer* ui_;
|
2010-05-09 22:18:05 +02:00
|
|
|
RadioModel* model_;
|
|
|
|
RadioService* current_service_;
|
|
|
|
|
2010-06-09 17:38:00 +02:00
|
|
|
QWidget* current_header_;
|
|
|
|
|
|
|
|
struct HeaderData {
|
|
|
|
bool visible_;
|
|
|
|
QTimeLine* animation_;
|
|
|
|
};
|
|
|
|
QMap<QWidget*, HeaderData> headers_;
|
2010-05-09 22:18:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RADIOVIEWCONTAINER_H
|