TelepathyQt4: Tp::IncomingFileTransferChannel Class Reference

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

# Tp::IncomingFileTransferChannel Class Reference
[Channel proxies]

The IncomingFileTransferChannel class provides an object representing a Telepathy channel of type FileTransfer for incoming file transfers. More...

`#include <TelepathyQt4/IncomingFileTransferChannel>`

Inherits Tp::FileTransferChannel.

List of all members.

## Public Member Functions

- virtual ~IncomingFileTransferChannel ()
- PendingOperation * acceptFile (qulonglong offset, QIODevice *output)

## Static Public Member Functions

- static
  IncomingFileTransferChannelPtr create (const ConnectionPtr &connection, const QString &objectPath, const QVariantMap &immutableProperties)

## Static Public Attributes

- static const Feature FeatureCore

## Protected Member Functions

- IncomingFileTransferChannel (const ConnectionPtr &connection, const QString &objectPath, const QVariantMap &immutableProperties)

## Detailed Description

The IncomingFileTransferChannel class provides an object representing a Telepathy channel of type FileTransfer for incoming file transfers.

## Constructor & Destructor Documentation

Tp::IncomingFileTransferChannel::~IncomingFileTransferChannel | ( |  | ) | `[virtual]`

Class destructor.

Tp::IncomingFileTransferChannel::IncomingFileTransferChannel | ( | const ConnectionPtr & | connection,
|  | const QString & | objectPath,
|  | const QVariantMap & | immutableProperties |
| ) |  |  | `[protected]`

Construct a new IncomingFileTransfer channel.

Parameters:

  | connection | Connection owning this channel, and specifying the service.
  | objectPath | The object path of this channel.
  | immutableProperties | The immutable properties of this channel.

## Member Function Documentation

IncomingFileTransferChannelPtr Tp::IncomingFileTransferChannel::create | ( | const ConnectionPtr & | connection,
|  | const QString & | objectPath,
|  | const QVariantMap & | immutableProperties |
| ) |  |  | `[static]`

Create a new InconmingFileTransferChannel object.

Parameters:

  | connection | Connection owning this channel, and specifying the service.
  | objectPath | The object path of this channel.
  | immutableProperties | The immutable properties of this channel.

Returns:
  A StreamedMediaChannelPtr object pointing to the newly created StreamedMediaChannel object.

Reimplemented from Tp::FileTransferChannel.

PendingOperation * Tp::IncomingFileTransferChannel::acceptFile | ( | qulonglong | offset,
|  | QIODevice * | output |
| ) |  |  |

Accept a file transfer that's in the FileTransferStatePending state(). The state will change to FileTransferStateOpen as soon as the transfer starts. The given output device should not be closed/destroyed until the state() changes to FileTransferStateCompleted or FileTransferStateCancelled.

Only the primary handler of a file transfer channel may call this method.

This method requires FileTransferChannel::FeatureCore to be enabled.

Parameters:

  | offset | The desired offset in bytes where the file transfer should start. The offset is taken from the beginning of the file. Specifying an offset of zero will start the transfer from the beginning of the file. The offset that is actually given in the initialOffset() method can differ from this argument where the requested offset is not supported. (For example, some protocols do not support offsets at all so the initialOffset() will always be 0.).
  | output | A QIODevice object where the data will be written to. The device should be ready to use when the state() changes to FileTransferStateCompleted. If the transfer is cancelled, state() becomes FileTransferStateCancelled, the data in output should be ignored

Returns:
  A PendingOperation object which will emit PendingOperation::finished when the call has finished.

See also:
  stateChanged(), state(), stateReason(), initialOffset()

## Member Data Documentation

const Feature Tp::IncomingFileTransferChannel::FeatureCore`[static]`

Feature representing the core that needs to become ready to make the IncomingFileTransferChannel object usable.

Note that this feature must be enabled in order to use most IncomingFileTransferChannel methods. See specific methods documentation for more details.

When calling isReady(), becomeReady(), this feature is implicitly added to the requested features.

Reimplemented from Tp::FileTransferChannel.