2009-12-26 16:13:38 +01:00
|
|
|
#ifndef LASTFMSERVICE_H
|
|
|
|
#define LASTFMSERVICE_H
|
|
|
|
|
|
|
|
#include "radioservice.h"
|
|
|
|
|
2009-12-26 18:19:14 +01:00
|
|
|
class LastFMConfig;
|
|
|
|
|
2009-12-26 16:13:38 +01:00
|
|
|
class LastFMService : public RadioService {
|
2009-12-26 18:19:14 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2009-12-26 16:13:38 +01:00
|
|
|
public:
|
|
|
|
LastFMService(QObject* parent = 0);
|
2009-12-26 18:19:14 +01:00
|
|
|
~LastFMService();
|
|
|
|
|
|
|
|
static const char* kSettingsGroup;
|
2009-12-26 16:13:38 +01:00
|
|
|
|
|
|
|
enum ItemType {
|
|
|
|
Type_MyRecommendations = 1000,
|
|
|
|
Type_MyRadio,
|
|
|
|
Type_MyLoved,
|
|
|
|
Type_MyNeighbourhood,
|
|
|
|
};
|
|
|
|
|
|
|
|
RadioItem* CreateRootItem(RadioItem* parent);
|
|
|
|
void LazyPopulate(RadioItem *item);
|
|
|
|
|
2009-12-26 18:19:14 +01:00
|
|
|
void Authenticate(const QString& username, const QString& password);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void AuthenticationComplete(bool success);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void AuthenticateReplyFinished();
|
|
|
|
|
2009-12-26 16:13:38 +01:00
|
|
|
private:
|
|
|
|
RadioItem* CreateStationItem(ItemType type, const QString& name,
|
|
|
|
const QString& icon, RadioItem* parent);
|
2009-12-26 18:19:14 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
LastFMConfig* config_;
|
2009-12-26 16:13:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LASTFMSERVICE_H
|