2012-11-27 18:35:06 +01:00
|
|
|
#ifndef UBUNTUONESERVICE_H
|
|
|
|
#define UBUNTUONESERVICE_H
|
|
|
|
|
2012-11-28 16:13:10 +01:00
|
|
|
#include "internet/cloudfileservice.h"
|
2012-11-27 18:35:06 +01:00
|
|
|
|
2012-11-28 14:43:03 +01:00
|
|
|
#include "core/tagreaderclient.h"
|
|
|
|
|
2012-11-27 18:35:06 +01:00
|
|
|
class QNetworkReply;
|
|
|
|
class UbuntuOneAuthenticator;
|
|
|
|
|
2012-11-28 16:13:10 +01:00
|
|
|
class UbuntuOneService : public CloudFileService {
|
2012-11-27 18:35:06 +01:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
UbuntuOneService(Application* app, InternetModel* parent);
|
|
|
|
|
|
|
|
static const char* kServiceName;
|
|
|
|
static const char* kSettingsGroup;
|
|
|
|
|
|
|
|
QUrl GetStreamingUrlFromSongId(const QString& song_id);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void AuthenticationFinished(UbuntuOneAuthenticator* authenticator);
|
|
|
|
void FileListRequestFinished(QNetworkReply* reply);
|
2012-11-28 15:26:09 +01:00
|
|
|
void ShowCoverManager();
|
|
|
|
void AddToPlaylist(QMimeData* mime);
|
2012-11-29 16:07:05 +01:00
|
|
|
void VolumeListRequestFinished(QNetworkReply* reply);
|
2012-11-27 18:35:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Connect();
|
2012-11-29 16:07:05 +01:00
|
|
|
QNetworkReply* SendRequest(const QUrl& url);
|
|
|
|
void RequestVolumeList();
|
2012-11-28 15:05:06 +01:00
|
|
|
void RequestFileList(const QString& path);
|
2012-11-28 16:13:10 +01:00
|
|
|
bool has_credentials() const;
|
2012-11-27 18:35:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
QByteArray GenerateAuthorisationHeader();
|
|
|
|
|
|
|
|
QString consumer_key_;
|
|
|
|
QString consumer_secret_;
|
|
|
|
QString token_;
|
|
|
|
QString token_secret_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UBUNTUONESERVICE_H
|