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.
For more details, please refer to Telepathy specification.
See Asynchronous Object Model, Shared Pointer Usage
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 FileTransferChannel object.
connection | Connection owning this channel, and specifying the service. | |
objectPath | The channel object path. | |
immutableProperties | The channel immutable properties. | |
coreFeature | The core feature of the channel type, if any. 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 channel object path. | |
immutableProperties | The channel immutable properties. |
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 FileTransferState.
Change notification is via the stateChanged() signal.
This method requires FileTransferChannel::FeatureCore to be ready.
FileTransferStateChangeReason Tp::FileTransferChannel::stateReason | ( | ) | const |
Return the reason for the state change as described by the FileTransferStateChangeReason.
Change notification is via the stateChanged() signal.
This method requires FileTransferChannel::FeatureCore to be ready.
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 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 property cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be ready.
QString Tp::FileTransferChannel::contentType | ( | ) | const |
Return the file's MIME type.
This property cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be ready.
qulonglong Tp::FileTransferChannel::size | ( | ) | const |
Return the size of the file.
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 property cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be ready.
QString Tp::FileTransferChannel::uri | ( | ) | const |
Return 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 ready.
FileHashType Tp::FileTransferChannel::contentHashType | ( | ) | const |
Return the type of the contentHash().
This method requires FileTransferChannel::FeatureCore to be ready.
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 ready.
QString Tp::FileTransferChannel::description | ( | ) | const |
Return the description of the file transfer.
This property cannot change once the channel has been created.
This method requires FileTransferChannel::FeatureCore to be ready.
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 ready.
qulonglong Tp::FileTransferChannel::initialOffset | ( | ) | const |
Return the offset in bytes from which the file will be sent.
This method requires FileTransferChannel::FeatureCore to be ready.
qulonglong Tp::FileTransferChannel::transferredBytes | ( | ) | const |
Return the number of bytes that have been transferred.
Change notification is via the transferredBytesChanged() signal.
This method requires FileTransferChannel::FeatureCore to be ready.
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] |
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] |
Emitted when the value of transferredBytes() 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 CM 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 CMs support at least SocketAddressTypeIPv4.
This method requires FileTransferChannel::FeatureCore to be ready.
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.
true
if the connections has been established, false
otherwise.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.
true
if sending/receiving has finished, false
otherwise.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.6.5
|