-#ifndef _REMOTE_H_
-#define _REMOTE_H_
-
-#include "iremote.h"
-#include "model.h"
+#ifndef REMOTE_H
+#define REMOTE_H
+#include <QObject>
#include <QString>
+#include <QNetworkReply>
+#include <QNetworkAccessManager>
+#include <QSettings>
-class IrCtrl;
-class NetIO;
-class QSettings;
+#include "rating.h"
-class Remote : public IRemote
+class Remote : public QObject
{
+ Q_OBJECT
+
public:
Remote();
- Remote(const QString &id, NetIO *);
+ Remote(const QString &name, const QString &mfg = "",
+ int rating = 0, int voteCount = 0);
+ Remote(const Remote &);
+ Remote &operator=(const Remote &);
~Remote();
- const QString &id() const;
- void setId(const QString &id);
- void setNetIO(NetIO *);
+ //getters
+ QString name() const { return m_name; }
+ QString mfg() const { return m_mfg; }
+ int rating() const { return m_rating; }
+ int voteCount() const { return m_voteCount; }
- // visible for gui
- void updateRating();
- void sendRating(bool good);
- void sendCmd(RemoteCmd);
+public slots:
+ void saveToFile();
+ void updateInfo();
+ void sendRating(Rating::Rating);
-private:
- Remote(const Remote &remote);
+private slots:
+ void remoteDownloadFinished(QNetworkReply *reply);
+ void infoRequestFinished(QNetworkReply *reply);
+
+signals:
+ void infoUpdated();
private:
- bool rated;
- Model model;
- QSettings *settings;
- IrCtrl *irCtrl;
- NetIO *netIO;
+ QString m_name;
+ QString m_mfg;
+ int m_rating;
+ int m_voteCount;
+
+ QNetworkAccessManager *m_infoNAM;
+ QNetworkAccessManager *m_remoteNAM;
+ QNetworkAccessManager *m_ratingNAM;
};
-#endif // _REMOTE_H_
-
-
+#endif