Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

dcctransfer.h

Go to the documentation of this file.
00001 #ifndef DCCTRANSFER_H
00002 #define DCCTRANSFER_H
00003 
00004 #include <qobject.h>
00005 
00006 class QSocket;
00007 class QFile;
00008 class QString;
00009 
00010 class DCCTransfer: public QObject {
00011     Q_OBJECT
00012 public:
00013     enum Type { Send, Recv };
00014     enum EndCode { Successfull, SelfAborted, PeerAborted, Timeout };
00015 
00016     DCCTransfer(Q_UINT32 ip4Addr, Q_UINT16 port, const QString &filename, unsigned int size);
00017     virtual ~DCCTransfer();
00018 
00019     void cancel();
00020 
00021     QString filename();
00022 
00023 signals:
00024     virtual void finished(DCCTransfer *transfer, EndCode code);
00025     virtual void progress(int progress);
00026 
00027 protected slots:
00028     virtual void slotProcess() = 0;
00029     virtual void slotFinished() = 0;
00030 
00031 protected:
00032     QSocket *m_socket;
00033     QFile *m_file;
00034     unsigned int m_bufSize;
00035     char *m_buffer;
00036     Q_UINT32 m_ip4Addr;
00037     Q_UINT16 m_port;
00038     unsigned int m_totalSize;
00039     unsigned int m_processedSize;
00040     bool m_cancel;
00041     bool m_timeout;
00042 };
00043 
00044 #endif

Generated on Sat Nov 5 16:17:40 2005 for OPIE by  doxygen 1.4.2