diff options
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 |
