hyperion.ng/libsrc/webserver/QtHttpRequest.h
LordGrey 160c5d0b3a
UI and Web updates (#1421)
* Stop Web-Capture when priority changes

* Remote control UI: Treat duration=0 as endless

* Stop Web-Capture on non-Image events changes

* LED Matrix Layout - Support vertical cabling direction

* Additional Yeelight models

* Treat http headers case insensitive

* Update change log

* Treat http headers case insensitive (consider Qt version)

* API - Consider provided format when setImage

* UI - Support Boblight configuration per LED instance

* Support multiple Boblight clients with different priorities

* Update changelog

* Simplify isGUI rules allowing for QT only builds

* Sysinfo: Fix indents

* LED-Devices: Show warning, if get properties failed

* Qt-Grabber: Fixed position handling of multiple monitors

* LED layout: Remove indention limitations

* Yeelight: Test YLTD003

* hyperion-remote: Provide image filename to muxer/UI

* Refactor PriorityMuxer and related

* Temp: Build under Windows 2019

* Yeelight: Remove YLTD003 as it is not working without additional changes

* Test Windows-latest with out removing redistributables/new MSVC

* correct workflows

* correct CI script

* Build Windows with Qt 5.15.2

* Priority Muxer: Updates after testing

* Fix Typo

* Update BGHandler

* QTGrabber - Reactivate windows code to avoid cursor issues

* Emit prioritiesChanged when autoselect was changed by user

Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-02-22 20:58:59 +01:00

65 lines
2.2 KiB
C++

#ifndef QTHTTPREQUEST_H
#define QTHTTPREQUEST_H
#include <QObject>
#include <QString>
#include <QByteArray>
#include <QHash>
#include <QUrl>
#include <QHostAddress>
#include <QMap>
class QtHttpServer;
class QtHttpClientWrapper;
using QtHttpPostData = QMap<QString,QByteArray>;
class QtHttpRequest : public QObject
{
Q_OBJECT
public:
explicit QtHttpRequest (QtHttpClientWrapper * client, QtHttpServer * parent);
struct ClientInfo
{
QHostAddress serverAddress;
QHostAddress clientAddress;
};
int getRawDataSize (void) const { return m_data.size (); };
QUrl getUrl (void) const { return m_url; };
QString getCommand (void) const { return m_command; };
QByteArray getRawData (void) const { return m_data; };
QList<QByteArray> getHeadersList (void) const { return m_headersHash.keys (); };
QtHttpClientWrapper * getClient (void) const { return m_clientHandle; };
QtHttpPostData getPostData (void) const { return m_postData; };
ClientInfo getClientInfo (void) const { return m_clientInfo; };
QByteArray getHeader (const QByteArray & header) const
{
return m_headersHash.value (header.toLower(), QByteArray ());
};
public slots:
void setUrl (const QUrl & url) { m_url = url; };
void setCommand (const QString & command) { m_command = command; };
void appendRawData (const QByteArray & data) { m_data.append (data); };
void setPostData (const QtHttpPostData & data) { m_postData = data; };
void setClientInfo (const QHostAddress & server, const QHostAddress & client);
void addHeader (const QByteArray & header, const QByteArray & value);
private:
QUrl m_url;
QString m_command;
QByteArray m_data;
QtHttpServer * m_serverHandle;
QtHttpClientWrapper * m_clientHandle;
QHash<QByteArray, QByteArray> m_headersHash;
ClientInfo m_clientInfo;
QtHttpPostData m_postData;
};
#endif // QTHTTPREQUEST_H