Diffstat (limited to 'noncore/net/opieirc/dcctransfer.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/dcctransfer.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/noncore/net/opieirc/dcctransfer.h b/noncore/net/opieirc/dcctransfer.h new file mode 100644 index 0000000..775ed24 --- a/dev/null +++ b/noncore/net/opieirc/dcctransfer.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef DCCTRANSFER_H | ||
2 | #define DCCTRANSFER_H | ||
3 | |||
4 | #include <qobject.h> | ||
5 | |||
6 | class QSocket; | ||
7 | class QFile; | ||
8 | class QString; | ||
9 | |||
10 | class DCCTransfer: public QObject { | ||
11 | Q_OBJECT | ||
12 | public: | ||
13 | enum Type { Send, Recv }; | ||
14 | enum EndCode { Successfull, SelfAborted, PeerAborted, Timeout }; | ||
15 | |||
16 | DCCTransfer(Q_UINT32 ip4Addr, Q_UINT16 port, const QString &filename, unsigned int size); | ||
17 | virtual ~DCCTransfer(); | ||
18 | |||
19 | void cancel(); | ||
20 | |||
21 | QString filename(); | ||
22 | |||
23 | signals: | ||
24 | virtual void finished(DCCTransfer *transfer, EndCode code); | ||
25 | virtual void progress(int progress); | ||
26 | |||
27 | protected slots: | ||
28 | virtual void slotProcess() = 0; | ||
29 | virtual void slotFinished() = 0; | ||
30 | |||
31 | protected: | ||
32 | QSocket *m_socket; | ||
33 | QFile *m_file; | ||
34 | unsigned int m_bufSize; | ||
35 | char *m_buffer; | ||
36 | Q_UINT32 m_ip4Addr; | ||
37 | Q_UINT16 m_port; | ||
38 | unsigned int m_totalSize; | ||
39 | unsigned int m_processedSize; | ||
40 | bool m_cancel; | ||
41 | bool m_timeout; | ||
42 | }; | ||
43 | |||
44 | #endif | ||