diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-08 20:45:08 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-08 20:45:08 +0200 |
| commit | 4276fd7662167fbabf78edf75e75a85218dff4a5 (patch) | |
| tree | f7009b55f9bbdecc77477d3f3191e5aef8356a86 /src/fingerclient.hpp | |
| parent | 24adf0b41746449a163cfd2daaa2feefd67e9d57 (diff) | |
| download | kristall-4276fd7662167fbabf78edf75e75a85218dff4a5.tar.gz | |
Adds support for finger protocol.
Diffstat (limited to 'src/fingerclient.hpp')
| -rw-r--r-- | src/fingerclient.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/fingerclient.hpp b/src/fingerclient.hpp new file mode 100644 index 0000000..7fd2ae5 --- /dev/null +++ b/src/fingerclient.hpp @@ -0,0 +1,41 @@ +#ifndef FINGERCLIENT_HPP +#define FINGERCLIENT_HPP + +#include <QObject> +#include <QTcpSocket> +#include <QUrl> + +class FingerClient : public QObject +{ + Q_OBJECT +public: + explicit FingerClient(QObject *parent = nullptr); + + ~FingerClient() override; + + bool startRequest(QUrl const & url); + + bool isInProgress() const; + + bool cancelRequest(); + +signals: + void requestProgress(qint64 transferred); + + void requestComplete(QByteArray const & data, QString const & mime); + + void requestFailed(QString const & message); + +private slots: + void on_connected(); + void on_readRead(); + void on_finished(); + +private: + QTcpSocket socket; + QByteArray body; + bool was_cancelled; + QString requested_user; +}; + +#endif // FINGERCLIENT_HPP |
