This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2014-04-05 01:55:56 +02:00

42 lines
755 B
C++

#ifndef HTTPDAEMON_H
#define HTTPDAEMON_H
#include <QTcpServer>
#include <QUuid>
#include <QDateTime>
class Device;
class DevicePlugin;
class HttpDaemon : public QTcpServer
{
Q_OBJECT
public:
HttpDaemon(Device *device, DevicePlugin* parent = 0);
void incomingConnection(qintptr socket) override;
void actionExecuted(const QUuid&actionTypeId);
signals:
void setState(const QUuid &stateTypeId, const QVariant &value);
void triggerEvent(const QUuid &eventTypeId);
private slots:
void readClient();
void discardClient();
private:
QString generateWebPage();
private:
bool disabled;
DevicePlugin *m_plugin;
Device *m_device;
QList<QPair<QUuid, QDateTime> > m_actionList;
};
#endif // HTTPDAEMON_H