TelepathyQt4: Tp::PendingChannel Class Reference

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

# Tp::PendingChannel Class Reference
[Channel proxies]

Class containing the parameters of and the reply to an asynchronous channel request. Instances of this class cannot be constructed directly; the only way to get one is trough Connection. More...

`#include <TelepathyQt4/PendingChannel>`

Inherits Tp::PendingOperation.

List of all members.

## Public Member Functions

- ~PendingChannel ()
- ConnectionPtr connection () const
- bool yours () const
- const QString & channelType () const
- uint targetHandleType () const
- uint targetHandle () const
- QVariantMap immutableProperties () const
- ChannelPtr channel () const
- QString objectPath () const

## Detailed Description

Class containing the parameters of and the reply to an asynchronous channel request. Instances of this class cannot be constructed directly; the only way to get one is trough Connection.

## Constructor & Destructor Documentation

Tp::PendingChannel::~PendingChannel | ( |  | ) |

Class destructor.

## Member Function Documentation

ConnectionPtr Tp::PendingChannel::connection | ( |  | ) | const

Return the Connection object through which the channel request was made.

Returns:
  Pointer to the Connection.

bool Tp::PendingChannel::yours | ( |  | ) | const

Return whether this channel belongs to this process.

If false, the caller MUST assume that some other process is handling this channel; if true, the caller SHOULD handle it themselves or delegate it to another client.

Note that the value is undefined until the operation finishes.

Returns:
  Boolean indicating whether this channel belongs to this process.

const QString & Tp::PendingChannel::channelType | ( |  | ) | const

Return the channel type specified in the channel request.

Returns:
  The D-Bus interface name of the interface specific to the requested channel type.

uint Tp::PendingChannel::targetHandleType | ( |  | ) | const

If the channel request has finished, return the handle type of the resulting channel. Otherwise, return the handle type that was requested.

(One example of a request producing a different target handle type is that on protocols like MSN, one-to-one conversations don't really exist, and if you request a text channel with handle type HandleTypeContact, what you will actually get is a text channel with handle type HandleTypeNone, with the requested contact as a member.)

Returns:
  The handle type, as specified in HandleType.

uint Tp::PendingChannel::targetHandle | ( |  | ) | const

If the channel request has finished, return the target handle of the resulting channel. Otherwise, return the target handle that was requested (which might be different in some situations - see targetHandleType).

Returns:
  The handle.

QVariantMap Tp::PendingChannel::immutableProperties | ( |  | ) | const

If this channel request has finished, return the immutable properties of the resulting channel. Otherwise, return an empty map.

The keys and values in this map are defined by the Telepathy D-Bus specification, or by third-party extensions to that specification. These are the properties that cannot change over the lifetime of the channel; they're announced in the result of the request, for efficiency. This map should be passed to the constructor of Channel or its subclasses (such as TextChannel).

These properties can also be used to process channels in a way that does not require the creation of a Channel object - for instance, a ChannelDispatcher implementation should be able to classify and process channels based on their immutable properties, without needing to create Channel objects.

Returns:
  A map in which the keys are D-Bus property names and the values are the corresponding values.

ChannelPtr Tp::PendingChannel::channel | ( |  | ) | const

Returns a shared pointer to a Channel high-level proxy object associated with the remote channel resulting from the channel request. If isValid() returns `false`, the request has not (at least yet) completed successfully, and a null ChannelPtr will be returned.

Returns:
  Shared pointer to the new Channel object, 0 if an error occurred.

QString Tp::PendingChannel::objectPath | ( |  | ) | const

Returns the channel object path or an empty string on error.

This method is useful for creating custom Channel objects, so instead of using PendingChannel::channel, one could construct a new custom channel with the object path.

Returns:
  Channel object path.