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

Public Member Functions | Static Public Member Functions | Protected Member Functions
Tp::OutgoingDBusTubeChannel Class Reference
Channel proxies

The OutgoingDBusTubeChannel class represents an outgoing Telepathy channel of type DBusTube. More...

`#include <TelepathyQt/OutgoingDBusTubeChannel>`

Inherits Tp::DBusTubeChannel.

List of all members.

## Public Member Functions

- virtual ~OutgoingDBusTubeChannel ()
- PendingDBusTubeConnection * offerTube (const QVariantMap &parameters, bool allowOtherUsers=false)

## Static Public Member Functions

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

## Protected Member Functions

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

## Detailed Description

The OutgoingDBusTubeChannel class represents an outgoing Telepathy channel of type DBusTube.

Outgoing (locally initiated/requested) tubes are initially in the TubeChannelStateNotOffered state. When offerTube is called, the connection manager takes care of instantiating a new DBus server, at which point the tube state becomes TubeChannelStateRemotePending.

If the target accepts the connection request, the state goes TubeChannelStateOpen and both sides can start using the new private bus, the address of which can be retrieved from the completed PendingDBusTubeConnection or from this class.

Note:
  If you plan to use QtDBus for the DBus connection, please note you should always use QDBusConnection::connectToPeer(), regardless of the fact this tube is a p2p or a group one. The above function has been introduced in Qt 4.8, previous versions of Qt do not allow the use of DBus Tubes through QtDBus.

For more details, please refer to Telepathy specification.

See Asynchronous Object Model, Shared Pointer Usage

## Constructor & Destructor Documentation

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

Class destructor.

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

Construct a new OutgoingDBusTubeChannel 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.

## Member Function Documentation

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

Create a new OutgoingDBusTubeChannel 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.

Returns:
  A OutgoingDBusTubeChannelPtr object pointing to the newly created OutgoingDBusTubeChannel object.

Reimplemented from Tp::DBusTubeChannel.

PendingDBusTubeConnection * Tp::OutgoingDBusTubeChannel::offerTube | ( | const QVariantMap & | parameters,
|  | bool | allowOtherUsers = `false`
| ) |  |

Offer the tube

This method sets up a private DBus connection to the channel target(s), and offers it through the tube.

The PendingDBusTubeConnection returned by this method will be completed as soon as the tube is opened and ready to be used.

This method requires DBusTubeChannel::FeatureCore to be enabled.

Parameters:

  parameters | A dictionary of arbitrary Parameters to send with the tube offer. The other end will receive this QVariantMap in the parameters() method of the corresponding IncomingDBusTubeChannel.
  allowOtherUsers | Whether the server should allow other users to connect to this tube more than just the current one. If your application has no specific needs, it is advisable not to modify the default value of this argument.

Note:
  If allowOtherUsers == false, but one of the ends does not support current user restriction, the tube will be offered regardless, falling back to allowing any connection. If your application requires strictly this condition to be enforced, you should check DBusTubeChannel::supportsRestrictingToCurrentUser before offering the tube, and take action from there. The tube is guaranteed either to be offered with the desired restriction or to fail the accept phase if supportsRestrictingToCurrentUser is true and allowOtherUsers is false.

Returns:
  A PendingDBusTubeConnection which will finish as soon as the tube is ready to be used (hence in the Open state)