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

incoming-file-transfer-channel.h
1
23 #ifndef _TelepathyQt_incoming_file_transfer_channel_h_HEADER_GUARD_
24 #define _TelepathyQt_incoming_file_transfer_channel_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/FileTransferChannel>
31
32 #include <QAbstractSocket>
33
34 namespace Tp
35 {
36
37 class TP_QT_EXPORT IncomingFileTransferChannel : public FileTransferChannel
38 {
39 Q_OBJECT
40 Q_DISABLE_COPY(IncomingFileTransferChannel)
41
42 public:
43 static const Feature FeatureCore;
44
45 static IncomingFileTransferChannelPtr create(const ConnectionPtr &connection,
46 const QString &objectPath, const QVariantMap &immutableProperties);
47
48 virtual ~IncomingFileTransferChannel();
49
50 PendingOperation *setUri(const QString& uri);
51 PendingOperation *acceptFile(qulonglong offset, QIODevice *output);
52
53 Q_SIGNALS:
54 void uriDefined(const QString &uri);
55
56 protected:
57 IncomingFileTransferChannel(const ConnectionPtr &connection,
58 const QString &objectPath,
59 const QVariantMap &immutableProperties,
60 const Feature &coreFeature = IncomingFileTransferChannel::FeatureCore);
61
62 private Q_SLOTS:
63 TP_QT_NO_EXPORT void onAcceptFileFinished(Tp::PendingOperation *op);
64
65 TP_QT_NO_EXPORT void onSocketConnected();
66 TP_QT_NO_EXPORT void onSocketDisconnected();
67 TP_QT_NO_EXPORT void onSocketError(QAbstractSocket::SocketError error);
68 TP_QT_NO_EXPORT void doTransfer();
69
70 private:
71 TP_QT_NO_EXPORT void connectToHost();
72 TP_QT_NO_EXPORT void setFinished();
73
74 struct Private;
75 friend struct Private;
76 Private *mPriv;
77 };
78
79 } // Tp
80
81 #endif
QIODevice
QString
Tp::IncomingFileTransferChannel::FeatureCore
static const Feature FeatureCore
Definition: incoming-file-transfer-channel.h:43
Tp::Feature
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
Tp::PendingOperation
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
Tp::IncomingFileTransferChannel
The IncomingFileTransferChannel class represents a Telepathy channel of type FileTransfer for incomin...
Definition: incoming-file-transfer-channel.h:37
Tp::FileTransferChannel
The FileTransferChannel class represents a Telepathy channel of type FileTransfer.
Definition: file-transfer-channel.h:35
Tp
Definition: abstract-adaptor.cpp:31