Home · All Classes · All Namespaces · Modules · Functions · Files |
The FileTransferChannel class represents a Telepathy channel of type FileTransfer. More...
#include <TelepathyQt4/FileTransferChannel>
Inherits Tp::Channel.
Inherited by Tp::IncomingFileTransferChannel, and Tp::OutgoingFileTransferChannel.
The FileTransferChannel class represents a Telepathy channel of type FileTransfer.
For more specialized file transfer classes, please refer to OutgoingFileTransferChannel and IncomingFileTransferChannel.
Tp::FileTransferChannel::~FileTransferChannel | ( | ) | [virtual] |
Class destructor.
Tp::FileTransferChannel::FileTransferChannel | ( | const ConnectionPtr & | connection, |
const QString & | objectPath, | ||
const QVariantMap & | immutableProperties, | ||
const Feature & | coreFeature = FileTransferChannel::FeatureCore |
||
) | [protected] |
Construct a new file transfer channel associated with the given objectPath on the same service as the given connection.
connection | Connection owning this channel, and specifying the service. |
objectPath | Path to the object on the service. |
immutableProperties | The immutable properties of the channel. |
coreFeature | The core feature of the channel type. The corresponding introspectable should depend on FileTransferChannel::FeatureCore. |
FileTransferChannelPtr Tp::FileTransferChannel::create | ( | const ConnectionPtr & | connection, |
const QString & | objectPath, | ||
const QVariantMap & | immutableProperties | ||
) | [static] |
Create a new FileTransferChannel object.
connection | Connection owning this channel, and specifying the service. |
objectPath | The object path of this channel. |
immutableProperties | The immutable properties of this channel. |
Reimplemented from Tp::Channel.
Reimplemented in Tp::IncomingFileTransferChannel, and Tp::OutgoingFileTransferChannel.
FileTransferState Tp::FileTransferChannel::state | ( | ) | const |
Return the state of the file transfer as described by the FileTransferState enum.
This method requires FileTransferChannel::FeatureCore to be enabled.
FileTransferStateChangeReason Tp::FileTransferChannel::stateReason | ( | ) | const |
Return the for the state change as described by the FileTransferStateChangeReason enum.
This method requires FileTransferChannel::FeatureCore to be enabled.
QString Tp::FileTransferChannel::fileName | ( | ) | const |
Return the name of the file on the sender's side. This is given as a suggested filename for the receiver. This cannot change once the channel has been created.
This property should be the basename of the file being sent. For example, if the sender sends the file /home/user/monkey.pdf then this property should be set to monkey.pdf.
This method requires FileTransferChannel::FeatureCore to be enabled.
QString Tp::FileTransferChannel::contentType | ( | ) | const |
Return the file's MIME type. This cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be enabled.
qulonglong Tp::FileTransferChannel::size | ( | ) | const |
The size of the file. This cannot change once the channel has been created.
Note that the size is not guaranteed to be exactly right for incoming files. This is merely a hint and should not be used to know when the transfer finished.
For unknown sizes the return value can be UINT64_MAX.
This method requires FileTransferChannel::FeatureCore to be enabled.
QString Tp::FileTransferChannel::uri | ( | ) | const |
The URI of the file.
On outgoing file transfers, this property cannot change after the channel is requested. For incoming file transfers, this property may be set by the channel handler before calling AcceptFile to inform observers where the incoming file will be saved. When the URI property is set, the signal IncomingFileTransferChannel::uriDefined() is emitted.
This method requires FileTransferChannel::FeatureCore to be enabled.
FileHashType Tp::FileTransferChannel::contentHashType | ( | ) | const |
Return the type of the contentHash().
This method requires FileTransferChannel::FeatureCore to be enabled.
QString Tp::FileTransferChannel::contentHash | ( | ) | const |
Return the hash of the contents of the file transfer, of type described in the value of the contentHashType().
Its value MUST correspond to the appropriate type of the contentHashType(). If the contentHashType() is set to FileHashTypeNone, then the returned value is an empty string.
This method requires FileTransferChannel::FeatureCore to be enabled.
QString Tp::FileTransferChannel::description | ( | ) | const |
Return the description of the file transfer. This cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be enabled.
QDateTime Tp::FileTransferChannel::lastModificationTime | ( | ) | const |
Return the last modification time of the file being transferred. This cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be enabled.
qulonglong Tp::FileTransferChannel::initialOffset | ( | ) | const |
Return the offset in bytes from which the file will be sent.
This method requires FileTransferChannel::FeatureCore to be enabled.
qulonglong Tp::FileTransferChannel::transferredBytes | ( | ) | const |
Return the number of bytes that have been transferred. This will be updated as the file transfer continues.
This method requires FileTransferChannel::FeatureCore to be enabled.
PendingOperation * Tp::FileTransferChannel::cancel | ( | ) |
Cancel a file transfer.
void Tp::FileTransferChannel::stateChanged | ( | Tp::FileTransferState | state, |
Tp::FileTransferStateChangeReason | reason | ||
) | [signal] |
void Tp::FileTransferChannel::initialOffsetDefined | ( | qulonglong | initialOffset | ) | [signal] |
This signal is emitted when the initial offset for the file transfer is defined.
initialOffset | The new initial offset for the file transfer. |
void Tp::FileTransferChannel::transferredBytesChanged | ( | qulonglong | count | ) | [signal] |
This signal is emitted when the number of bytes transferred changes.
count | The new number of bytes transferred. |
SupportedSocketMap Tp::FileTransferChannel::availableSocketTypes | ( | ) | const [protected] |
Return a mapping from address types (members of SocketAddressType) to arrays of access-control type (members of SocketAccessControl) that the connection manager supports for sockets with that address type. For simplicity, if a CM supports offering a particular type of file transfer, it is assumed to support accepting it. All connection Managers support at least SocketAddressTypeIPv4.
This method requires FileTransferChannel::FeatureCore to be enabled.
void Tp::FileTransferChannel::connectToHost | ( | ) | [protected, virtual] |
Protected virtual method called when the state becomes FileTransferStateOpen.
Specialized classes should reimplement this method and call setConnected() when the connection is established.
bool Tp::FileTransferChannel::isConnected | ( | ) | const [protected] |
Return whether a connection has been established.
void Tp::FileTransferChannel::setConnected | ( | ) | [protected] |
Indicate whether a connection has been established.
Specialized classes that reimplement connectToHost() must call this method once the connection has been established or setFinished() if an error occurred.
bool Tp::FileTransferChannel::isFinished | ( | ) | const [protected] |
Return whether sending/receiving has finished.
void Tp::FileTransferChannel::setFinished | ( | ) | [protected, virtual] |
Protected virtual method called when an error occurred and the transfer should finish.
Specialized classes should reimplement this method and close the IO devices and do all the needed cleanup.
Note that for specialized classes that reimplement connectToHost() and set isConnected() to true, the state will not change to FileTransferStateCompleted once the state change is received.
When finished sending/receiving the specialized class MUST call this method and then the state will change to the latest pending state.
void Tp::FileTransferChannel::onUriDefined | ( | const QString & | uri | ) | [protected, slot] |
const Feature Tp::FileTransferChannel::FeatureCore [static] |
Feature representing the core that needs to become ready to make the FileTransferChannel object usable.
Note that this feature must be enabled in order to use most FileTransferChannel methods. See specific methods documentation for more details.
When calling isReady(), becomeReady(), this feature is implicitly added to the requested features.
Reimplemented from Tp::Channel.
Reimplemented in Tp::IncomingFileTransferChannel, and Tp::OutgoingFileTransferChannel.
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation | Telepathy-Qt4 0.7.1 |