Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Fritsche, NLE, 2019-04-30
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "logger.h"
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
#include <QString>
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user