| Home · All Classes · All Namespaces · Modules · Functions · Files

outgoing-file-transfer-channel.h

    00001
    00023 #ifndef _TelepathyQt_outgoing_file_transfer_channel_h_HEADER_GUARD_
    00024 #define _TelepathyQt_outgoing_file_transfer_channel_h_HEADER_GUARD_
    00025
    00026 #ifndef IN_TP_QT_HEADER
    00027 #error IN_TP_QT_HEADER
    00028 #endif
    00029
    00030 #include <TelepathyQt/FileTransferChannel>
    00031
    00032 #include <QAbstractSocket>
    00033
    00034 namespace Tp
    00035 {
    00036
    00037 class TP_QT_EXPORT OutgoingFileTransferChannel : public FileTransferChannel
    00038 {
    00039     Q_OBJECT
    00040     Q_DISABLE_COPY(OutgoingFileTransferChannel)
    00041
    00042 public:
    00043     static const Feature FeatureCore;
    00044
    00045     static OutgoingFileTransferChannelPtr create(const ConnectionPtr &connection,
    00046             const QString &objectPath, const QVariantMap &immutableProperties);
    00047
    00048     virtual ~OutgoingFileTransferChannel();
    00049
    00050     PendingOperation *provideFile(QIODevice *input);
    00051
    00052 protected:
    00053     OutgoingFileTransferChannel(const ConnectionPtr &connection,
    00054             const QString &objectPath,
    00055             const QVariantMap &immutableProperties,
    00056             const Feature &coreFeature = OutgoingFileTransferChannel::FeatureCore);
    00057
    00058 private Q_SLOTS:
    00059     TP_QT_NO_EXPORT void onProvideFileFinished(Tp::PendingOperation *op);
    00060
    00061     TP_QT_NO_EXPORT void onSocketConnected();
    00062     TP_QT_NO_EXPORT void onSocketDisconnected();
    00063     TP_QT_NO_EXPORT void onSocketError(QAbstractSocket::SocketError error);
    00064     TP_QT_NO_EXPORT void onInputAboutToClose();
    00065     TP_QT_NO_EXPORT void doTransfer();
    00066
    00067 private:
    00068     TP_QT_NO_EXPORT void connectToHost();
    00069     TP_QT_NO_EXPORT void setFinished();
    00070
    00071     struct Private;
    00072     friend struct Private;
    00073     Private *mPriv;
    00074 };
    00075
    00076 } // Tp
    00077
    00078 #endif