65 lines
2.3 KiB
C++
65 lines
2.3 KiB
C++
/***************************************************************************
|
|
* Copyright (C) 2008 by Oliver Groß *
|
|
* z.o.gross@gmx.de *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
* This program is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU General Public License *
|
|
* along with this program; if not, write to the *
|
|
* Free Software Foundation, Inc., *
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
***************************************************************************/
|
|
#ifndef QFTRANS_CRECIEVETHREAD_H
|
|
#define QFTRANS_CRECIEVETHREAD_H
|
|
|
|
#include <QThread>
|
|
#include "common.h"
|
|
|
|
class QTcpSocket;
|
|
|
|
namespace qftrans {
|
|
/**
|
|
@author Oliver Groß <z.o.gross@gmx.de>
|
|
*/
|
|
class CRecieveThread : public QThread {
|
|
Q_OBJECT
|
|
public:
|
|
CRecieveThread(QString & destinationDir, QTcpSocket * socket, QObject * parent = 0);
|
|
~CRecieveThread();
|
|
signals:
|
|
void downloadAdded(TransferData * data);
|
|
void downloadRemoved(TransferData * data);
|
|
void downloadUpdated(TransferData * transfer);
|
|
|
|
void downloadAcknowledged(quint32 id);
|
|
void uploadStartRequest(quint32 id);
|
|
public slots:
|
|
void setDestinationDir(QString & value);
|
|
|
|
void removeDownload(TransferData * data);
|
|
protected slots:
|
|
void readData();
|
|
protected:
|
|
QTcpSocket * m_Socket;
|
|
|
|
QString m_DestinationDir;
|
|
|
|
QTransferDataHash m_DataDict;
|
|
|
|
TransferHeader m_LastHeader;
|
|
bool m_LastHeaderValid;
|
|
|
|
void run();
|
|
};
|
|
}
|
|
|
|
#endif
|