Home · All Classes · All Namespaces · Modules · Functions · Files
file-transfer-channel.h
1 
23 #ifndef _TelepathyQt_file_transfer_channel_h_HEADER_GUARD_
24 #define _TelepathyQt_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/Channel>
31 
32 namespace Tp
33 {
34 
35 class TP_QT_EXPORT FileTransferChannel : public Channel
36 {
37  Q_OBJECT
38  Q_DISABLE_COPY(FileTransferChannel)
39 
40 public:
41  static const Feature FeatureCore;
42 
43  static FileTransferChannelPtr create(const ConnectionPtr &connection,
44  const QString &objectPath, const QVariantMap &immutableProperties);
45 
46  virtual ~FileTransferChannel();
47 
48  FileTransferState state() const;
49  FileTransferStateChangeReason stateReason() const;
50 
51  QString fileName() const;
52  QString contentType() const;
53  qulonglong size() const;
54  QString uri() const;
55 
56  FileHashType contentHashType() const;
57  QString contentHash() const;
58 
59  QString description() const;
60 
61  QDateTime lastModificationTime() const;
62 
63  qulonglong initialOffset() const;
64 
65  qulonglong transferredBytes() const;
66 
67  PendingOperation *cancel();
68 
69 Q_SIGNALS:
70  void stateChanged(Tp::FileTransferState state,
72  void initialOffsetDefined(qulonglong initialOffset);
73  void transferredBytesChanged(qulonglong count);
74 
75 protected:
76  FileTransferChannel(const ConnectionPtr &connection, const QString &objectPath,
77  const QVariantMap &immutableProperties,
78  const Feature &coreFeature = FileTransferChannel::FeatureCore);
79 
80  SupportedSocketMap availableSocketTypes() const;
81 
82  virtual void connectToHost();
83  bool isConnected() const;
84  void setConnected();
85 
86  bool isFinished() const;
87  virtual void setFinished();
88 
89 private Q_SLOTS:
90  TP_QT_NO_EXPORT void gotProperties(QDBusPendingCallWatcher *watcher);
91 
92  TP_QT_NO_EXPORT void changeState();
93  TP_QT_NO_EXPORT void onStateChanged(uint state, uint stateReason);
94  TP_QT_NO_EXPORT void onInitialOffsetDefined(qulonglong initialOffset);
95  TP_QT_NO_EXPORT void onTransferredBytesChanged(qulonglong count);
96 
97 protected Q_SLOTS:
98  TP_QT_NO_EXPORT void onUriDefined(const QString &uri);
99 
100 private:
101  struct Private;
102  friend struct Private;
103  Private *mPriv;
104 };
105 
106 } // Tp
107 
108 #endif
static const Feature FeatureCore
Definition: file-transfer-channel.h:41
FileHashType
Definition: build/TelepathyQt/_gen/constants.h:2678
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
FileTransferState
Definition: build/TelepathyQt/_gen/constants.h:2577
FileTransferStateChangeReason
Definition: build/TelepathyQt/_gen/constants.h:2630
Definition: build/TelepathyQt/_gen/types.h:3100
The FileTransferChannel class represents a Telepathy channel of type FileTransfer.
Definition: file-transfer-channel.h:35
The Channel class represents a Telepathy channel.
Definition: channel.h:51


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.6.1