Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / msn / incomingtransfer.h
blob6fdf6cf90d62f5b1009dc5c8e5c3f4bf6f919b3e
1 /*
2 incomingtransfer.h - msn p2p protocol
4 Copyright (c) 2003-2005 by Olivier Goffart <ogoffart@kde.org>
5 Copyright (c) 2005 by Gregg Edghill <gregg.edghill@gmail.com>
7 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 *************************************************************************
19 #ifndef INCOMINGTRANSFER_H
20 #define INCOMINGTRANSFER_H
22 #include "p2p.h"
23 #include "dispatcher.h"
25 #include <qabstractsocket.h>
27 class QTcpServer;
28 class KTemporaryFile;
29 /**
30 @author Kopete Developers
32 namespace P2P{
33 class IncomingTransfer : public P2P::TransferContext
34 { Q_OBJECT
35 public:
36 IncomingTransfer(const QString& from, P2P::Dispatcher *dispatcher, quint32 sessionId);
37 virtual ~IncomingTransfer();
39 private slots:
40 void slotAccept();
41 void slotSocketRead();
42 void slotSocketClosed();
43 void slotSocketError(QAbstractSocket::SocketError errorCode);
45 void slotTransferAccepted(Kopete::Transfer* transfer, const QString& fileName);
46 void slotTransferRefused(const Kopete::FileTransferInfo& info);
49 private:
50 virtual void acknowledged();
51 virtual void processMessage(const Message& message);
53 KTemporaryFile *m_tempFile;
54 QTcpServer *m_listener;
58 #endif