/** * @RDE_HEADER@ * $Id$ * $HeadURL$ * $Author$ * Created by Hannes Fritsche, NLE, 2019-04-30 */ #pragma once #include "logger.h" #include #include #include class QTimer; namespace OcBaseDownload { class PdfDownloadSocket : public QObject { Q_OBJECT public: explicit PdfDownloadSocket(const QString &hostName, QObject *parent); ~PdfDownloadSocket(); void downloadFromHost(const int fileId, const qint64 fileSize); bool isConnected() const; void close() { m_socket->close(); } signals: void downloadFinished(const QByteArray &data); private slots: void readyRead(); void connected(); void onReadTimeout(); private: QTcpSocket *m_socket; QTimer *m_readTimeout; int m_sizeToDownload; QByteArray m_downloadedData; NGL::INGLLogger &m_logger; }; }