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

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

The IncomingStreamTubeChannel class represents an incoming Telepathy channel of type StreamTube. More...

`#include <TelepathyQt/IncomingDBusTubeChannel>`

Inherits Tp::DBusTubeChannel.

List of all members.

## Public Member Functions

- virtual ~IncomingDBusTubeChannel ()
- PendingDBusTubeConnection * acceptTube (bool allowOtherUsers=false)

## Static Public Member Functions

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

## Protected Member Functions

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

## Detailed Description

The IncomingStreamTubeChannel class represents an incoming Telepathy channel of type StreamTube.

In particular, this class is meant to be used as a comfortable way for accepting incoming DBus tubes. Unless a different behavior is specified, tubes will be always accepted allowing connections just from the current user, unless this or one of the other ends do not support that. Unless your application has specific needs, you usually want to keep this behavior.

Once a tube is successfully accepted and open (the PendingDBusTubeConnection returned from the accepting methods has finished), the application can connect to the DBus server, the address of which can be retrieved from PendingDBusTubeConnection::address().

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::IncomingDBusTubeChannel::~IncomingDBusTubeChannel | ( |  | ) | `[virtual]`

Class destructor.

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

Construct a new IncomingDBusTubeChannel 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

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

Create a new IncomingDBusTubeChannel 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 IncomingDBusTubeChannelPtr object pointing to the newly created IncomingDBusTubeChannel object.

Reimplemented from Tp::DBusTubeChannel.

PendingDBusTubeConnection * Tp::IncomingDBusTubeChannel::acceptTube | ( | bool | allowOtherUsers = `false` | ) |

Accepts an incoming DBus tube.

This method accepts an incoming connection request for a DBus tube. It can be called only if the tube is in the `LocalPending` state.

Once called, this method will try opening the tube, and will create a new private DBus connection which can be used to communicate with the other end. You can then retrieve the address either from `PendingDBusTubeConnection` or from address().

This method requires DBusTubeChannel::FeatureCore to be enabled.

Parameters:

  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 accepting the tube, and take action from there. The tube is guaranteed either to be accepted 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)