mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
31 lines
575 B
C++
31 lines
575 B
C++
#ifndef WEBSOCKETJSONHANDLER_H
|
|
#define WEBSOCKETJSONHANDLER_H
|
|
|
|
#include <utils/Logger.h>
|
|
#include <api/JsonAPI.h>
|
|
|
|
#include <QObject>
|
|
#include <QWebSocket>
|
|
#include <QScopedPointer>
|
|
|
|
class WebSocketJsonHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
WebSocketJsonHandler(QWebSocket* websocket, QObject* parent = nullptr);
|
|
|
|
private slots:
|
|
void onTextMessageReceived(const QString& message);
|
|
void onDisconnected();
|
|
qint64 sendMessage(QJsonObject obj);
|
|
|
|
private:
|
|
QWebSocket* _websocket;
|
|
|
|
Logger* _log;
|
|
QScopedPointer<JsonAPI> _jsonAPI;
|
|
};
|
|
|
|
#endif // WEBSOCKETJSONHANDLER_H
|