diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-07 01:06:07 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-07 01:06:07 +0200 |
| commit | 093bfcc50d5889358ed806096ac5652a9e925cfc (patch) | |
| tree | f0276f86cf9b14309851b9d3136c370503ecea64 /src/webclient.hpp | |
| parent | d4d353dab0f7c2fe2e1d76f6666f848e077d07dd (diff) | |
| download | kristall-093bfcc50d5889358ed806096ac5652a9e925cfc.tar.gz | |
Implements multi-protocol support. Adds support for HTTP/HTTPS, adds settings to enable/disable protocols
Diffstat (limited to 'src/webclient.hpp')
| -rw-r--r-- | src/webclient.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/webclient.hpp b/src/webclient.hpp new file mode 100644 index 0000000..bc7c13b --- /dev/null +++ b/src/webclient.hpp @@ -0,0 +1,38 @@ +#ifndef WEBCLIENT_HPP +#define WEBCLIENT_HPP + +#include <QObject> +#include <QNetworkAccessManager> + +class WebClient: public QObject +{ +private: + Q_OBJECT +public: + explicit WebClient(QObject *parent = nullptr); + + ~WebClient() override; + + bool startRequest(QUrl const & url); + + bool isInProgress() const; + + bool cancelRequest(); + +signals: + void requestComplete(QByteArray const & data, QString const & mime); + + void requestFailed(QString const & message); + +private slots: + void on_data(); + void on_finished(); + +private: + QNetworkAccessManager manager; + QNetworkReply * current_reply; + + QByteArray body; +}; + +#endif // WEBCLIENT_HPP |
