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

incoming-file-transfer-channel.h

    00001
    00023 #ifndef _TelepathyQt_incoming_file_transfer_channel_h_HEADER_GUARD_
    00024 #define _TelepathyQt_incoming_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 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     TP_QT_NO_EXPORT void onAcceptFileFinished(Tp::PendingOperation *op);
    00064
    00065     TP_QT_NO_EXPORT void onSocketConnected();
    00066     TP_QT_NO_EXPORT void onSocketDisconnected();
    00067     TP_QT_NO_EXPORT void onSocketError(QAbstractSocket::SocketError error);
    00068     TP_QT_NO_EXPORT void doTransfer();
    00069
    00070 private:
    00071     TP_QT_NO_EXPORT void connectToHost();
    00072     TP_QT_NO_EXPORT void setFinished();
    00073
    00074     struct Private;
    00075     friend struct Private;
    00076     Private *mPriv;
    00077 };
    00078
    00079 } // Tp
    00080
    00081 #endif