2013-01-10 21:21:55 +01:00
|
|
|
#ifndef REMOTECLIENT_H
|
|
|
|
#define REMOTECLIENT_H
|
|
|
|
|
|
|
|
#include <QAbstractSocket>
|
2014-05-08 15:12:55 +02:00
|
|
|
#include <QObject>
|
2013-01-10 21:21:55 +01:00
|
|
|
|
2013-07-12 12:31:27 +02:00
|
|
|
#include "remotecontrolmessages.pb.h"
|
2013-01-10 21:21:55 +01:00
|
|
|
|
2014-05-08 15:12:55 +02:00
|
|
|
class Application;
|
|
|
|
class QByteArray;
|
2015-01-19 13:47:14 +01:00
|
|
|
class SongSender;
|
2014-05-08 15:12:55 +02:00
|
|
|
|
2013-01-10 21:21:55 +01:00
|
|
|
class RemoteClient : public QObject {
|
2014-02-07 16:34:20 +01:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-05-08 15:12:55 +02:00
|
|
|
RemoteClient(Application* app, QObject* parent = nullptr);
|
2013-01-10 21:21:55 +01:00
|
|
|
|
2014-05-08 15:12:55 +02:00
|
|
|
virtual void SendData(pb::remote::Message* msg) = 0;
|
|
|
|
virtual void DisconnectClient(pb::remote::ReasonDisconnect reason) = 0;
|
|
|
|
virtual QAbstractSocket::SocketState state() = 0;
|
2013-01-10 21:21:55 +01:00
|
|
|
|
2014-05-08 15:12:55 +02:00
|
|
|
void set_downloader(bool downloader) { downloader_ = downloader; }
|
|
|
|
bool downloader() const { return downloader_; }
|
2014-11-13 22:31:49 +01:00
|
|
|
SongSender* song_sender() { return song_sender_; }
|
2013-01-10 21:21:55 +01:00
|
|
|
|
2014-05-08 15:12:55 +02:00
|
|
|
signals:
|
2014-05-08 17:06:31 +02:00
|
|
|
void Parse(const pb::remote::Message& msg);
|
2013-01-23 20:02:12 +01:00
|
|
|
|
2014-05-15 17:59:22 +02:00
|
|
|
protected:
|
2013-01-10 21:21:55 +01:00
|
|
|
Application* app_;
|
2013-07-12 12:31:27 +02:00
|
|
|
bool downloader_;
|
2015-01-19 13:47:14 +01:00
|
|
|
SongSender* song_sender_;
|
2013-01-10 21:21:55 +01:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // REMOTECLIENT_H
|