aboutsummaryrefslogtreecommitdiff
path: root/src/protocols/webclient.hpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-22 21:10:04 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-22 21:10:04 +0200
commit75ec461eeaa851cb5c53f4cfffc434e3e529ed1d (patch)
tree3944737340718ca3675381aa06636045d397e780 /src/protocols/webclient.hpp
parent8dbfb0890560fd1cd698d06fa05ac868c4db8576 (diff)
downloadkristall-75ec461eeaa851cb5c53f4cfffc434e3e529ed1d.tar.gz
Restructures the project source and cleans up a bit
Diffstat (limited to 'src/protocols/webclient.hpp')
-rw-r--r--src/protocols/webclient.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/protocols/webclient.hpp b/src/protocols/webclient.hpp
new file mode 100644
index 0000000..58ae029
--- /dev/null
+++ b/src/protocols/webclient.hpp
@@ -0,0 +1,48 @@
+#ifndef WEBCLIENT_HPP
+#define WEBCLIENT_HPP
+
+#include <QObject>
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
+
+#include "protocolhandler.hpp"
+
+class WebClient: public ProtocolHandler
+{
+private:
+ Q_OBJECT
+public:
+ explicit WebClient();
+
+ ~WebClient() override;
+
+ bool supportsScheme(QString const & scheme) const override;
+
+ bool startRequest(QUrl const & url, RequestOptions options) override;
+
+ bool isInProgress() const override;
+
+ bool cancelRequest() override;
+
+ bool enableClientCertificate(CryptoIdentity const & ident) override;
+ void disableClientCertificate() override;
+
+private slots:
+ void on_data();
+ void on_finished();
+ void on_sslErrors(const QList<QSslError> &errors);
+ void on_redirected(const QUrl &url);
+
+private:
+ QNetworkAccessManager manager;
+ QNetworkReply * current_reply;
+
+ QByteArray body;
+ RequestOptions options;
+
+ CryptoIdentity current_identity;
+
+ bool suppress_socket_tls_error;
+};
+
+#endif // WEBCLIENT_HPP