00001
00023 #ifndef _TelepathyQt4_incoming_file_transfer_channel_h_HEADER_GUARD_
00024 #define _TelepathyQt4_incoming_file_transfer_channel_h_HEADER_GUARD_
00025
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029
00030 #include <TelepathyQt4/FileTransferChannel>
00031
00032 #include <QAbstractSocket>
00033
00034 namespace Tp
00035 {
00036
00037 class TELEPATHY_QT4_EXPORT IncomingFileTransferChannel : public FileTransferChannel
00038 {
00039 Q_OBJECT
00040 Q_DISABLE_COPY(IncomingFileTransferChannel)
00041
00042 public:
00043 static const Feature FeatureCore;
00044
00045 static IncomingFileTransferChannelPtr create(const ConnectionPtr &connection,
00046 const QString &objectPath, const QVariantMap &immutableProperties);
00047
00048 virtual ~IncomingFileTransferChannel();
00049
00050 PendingOperation *setUri(const QString& uri);
00051 PendingOperation *acceptFile(qulonglong offset, QIODevice *output);
00052
00053 Q_SIGNALS:
00054 void uriDefined(const QString &uri);
00055
00056 protected:
00057 IncomingFileTransferChannel(const ConnectionPtr &connection,
00058 const QString &objectPath,
00059 const QVariantMap &immutableProperties,
00060 const Feature &coreFeature = IncomingFileTransferChannel::FeatureCore);
00061
00062 private Q_SLOTS:
00063 TELEPATHY_QT4_NO_EXPORT void onAcceptFileFinished(Tp::PendingOperation *op);
00064
00065 TELEPATHY_QT4_NO_EXPORT void onSocketConnected();
00066 TELEPATHY_QT4_NO_EXPORT void onSocketDisconnected();
00067 TELEPATHY_QT4_NO_EXPORT void onSocketError(QAbstractSocket::SocketError error);
00068 TELEPATHY_QT4_NO_EXPORT void doTransfer();
00069
00070 private:
00071 TELEPATHY_QT4_NO_EXPORT void connectToHost();
00072 TELEPATHY_QT4_NO_EXPORT void setFinished();
00073
00074 struct Private;
00075 friend struct Private;
00076 Private *mPriv;
00077 };
00078
00079 }
00080
00081 #endif