Home · Modules · All Classes · All Namespaces
Public Slots | Signals | Public Member Functions | List of all members
Tp::Service::ChannelTypeStreamTubeAdaptor Class Reference

#include <TelepathyQt/_gen/svc-channel.h>

Inherits Tp::AbstractAdaptor.

Public Slots

void Offer (uint addresstype, const QDBusVariant &address, uint accesscontrol, const QVariantMap &parameters, const QDBusMessage &dbusMessage)
 
QDBusVariant Accept (uint addresstype, uint accesscontrol, const QDBusVariant &accesscontrolparam, const QDBusMessage &dbusMessage)
 

Signals

void NewRemoteConnection (uint handle, const QDBusVariant &connectionParam, uint connectionID)
 
void NewLocalConnection (uint connectionID)
 
void ConnectionClosed (uint connectionID, const QString &error, const QString &message)
 

Public Member Functions

QString Service () const
 
Tp::SupportedSocketMap SupportedSocketTypes () const
 
- Public Member Functions inherited from Tp::AbstractAdaptor
 AbstractAdaptor (const QDBusConnection &connection, QObject *adaptee, QObject *parent)
 
 ~AbstractAdaptor ()
 
QDBusConnection dbusConnection () const
 
QObject * adaptee () const
 

Detailed Description

Adaptor class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.Channel.Type.StreamTube".

Member Function Documentation

◆ Service()

QString Tp::Service::ChannelTypeStreamTubeAdaptor::Service ( ) const

Return the value of the exported D-Bus object property Service of type QString.

Adaptees should export this property as a Qt property named 'service' with type QString.

A string representing the service name that will be used over the tube. It should be a well-known TCP service name as defined by http://www.iana.org/assignments/port-numbers or http://www.dns-sd.org/ServiceTypes.html, for instance "rsync" or "daap".

When the tube is offered, the service name is transmitted to the other end.

When requesting a channel with ConnectionInterfaceRequestsInterface::CreateChannel() , this property MUST be included in the request.

Returns
The value of exported property Service.

◆ SupportedSocketTypes()

Tp::SupportedSocketMap Tp::Service::ChannelTypeStreamTubeAdaptor::SupportedSocketTypes ( ) const

Return the value of the exported D-Bus object property SupportedSocketTypes of type Tp::SupportedSocketMap.

Adaptees should export this property as a Qt property named 'supportedSocketTypes' with type Tp::SupportedSocketMap.

A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for stream tubes with that address type. For simplicity, if a CM supports offering a particular type of tube, it is assumed to support accepting it.

A typical value for a host without IPv6 support:

  {
    Socket_Address_Type_IPv4:
      [Socket_Access_Control_Localhost, Socket_Access_Control_Port,
       Socket_Access_Control_Netmask],
    Socket_Address_Type_Unix:
      [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials]
  }

Connection Managers MUST support at least IPv4 with the localhost access control.

When requesting a channel with ConnectionInterfaceRequestsInterface::CreateChannel() , this property MUST NOT be included in the request.

Returns
The value of exported property SupportedSocketTypes.

◆ Offer

void Tp::Service::ChannelTypeStreamTubeAdaptor::Offer ( uint  addresstype,
const QDBusVariant &  address,
uint  accesscontrol,
const QVariantMap &  parameters,
const QDBusMessage &  dbusMessage 
)
slot

Begins a call to the exported D-Bus method Offer on this object.

Adaptees should export this method as a Qt slot with the following signature: void offer(uint addresstype, const QDBusVariant& address, uint accesscontrol, const QVariantMap& parameters, const Tp::Service::ChannelTypeStreamTubeAdaptor::OfferContextPtr &context);

Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError accordingly) on the received context object once the method has finished processing.

Offer a stream tube exporting the local socket specified.

Parameters
addresstype
The type of the listening address of the local service, as a member 
of Socket_Address_Type.
address
The listening address of the local service, as indicated by the 
address_type.
accesscontrol
The access control the local service applies to the local socket, 
specified so the connection manager can behave appropriately when 
it connects.
parameters
The dictionary of arbitrary Parameters to send with the tube offer.

◆ Accept

QDBusVariant Tp::Service::ChannelTypeStreamTubeAdaptor::Accept ( uint  addresstype,
uint  accesscontrol,
const QDBusVariant &  accesscontrolparam,
const QDBusMessage &  dbusMessage 
)
slot

Begins a call to the exported D-Bus method Accept on this object.

Adaptees should export this method as a Qt slot with the following signature: void accept(uint addresstype, uint accesscontrol, const QDBusVariant& accesscontrolparam, const Tp::Service::ChannelTypeStreamTubeAdaptor::AcceptContextPtr &context);

Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError accordingly) on the received context object once the method has finished processing.

Accept a stream tube that's in the "local pending" state. The connection manager will attempt to open the tube. The tube remains in the "local pending" state until the TubeChannelStateChanged signal is emitted.

Parameters
addresstype
The type of address the connection manager should listen on.
accesscontrol

The type of access control the connection manager should apply to the socket.

Note that if you plan to establish more than one connection through the tube, the Socket_Access_Control_Port access control can't be used as you can't connect more than once from the same port.

accesscontrolparam
A parameter for the access control type, to be interpreted as 
specified in the documentation for the Socket_Access_Control enum.
Returns
The address on which the connection manager will listen for 
connections to this tube. The client should not attempt to connect 
to the address until the tube is open.

◆ NewRemoteConnection

void Tp::Service::ChannelTypeStreamTubeAdaptor::NewRemoteConnection ( uint  handle,
const QDBusVariant &  connectionParam,
uint  connectionID 
)
signal

Represents the exported D-Bus signal NewRemoteConnection on this object.

Adaptees should export this signal as a Qt signal with the following signature: void newRemoteConnection(uint handle, const QDBusVariant& connectionParam, uint connectionID);

The adaptee signal will be automatically relayed as a D-Bus signal once emitted.

Parameters
handle
The handle of the participant who opened the new connection
connectionParam

A parameter which can be used by the listening process to identify the connection. Note that this parameter has a meaningful value only in the Socket_Access_Control_Port and Socket_Access_Control_Credentials cases. If a different Socket_Access_Control has been chosen when offering the tube, this parameter should be ignored.

In the Socket_Access_Control_Port case, the variant contains a struct Socket_Address_IPv4 (or Socket_Address_IPv6) containing the address from which the CM is connected to the client application.

In the Socket_Access_Control_Credentials case, the variant contains the byte (D-Bus signature 'y') that has been sent with the credentials.

connectionID
The unique ID associated with this connection. This ID will be used 
to identifiy the connection when reporting errors with 
ConnectionClosed.

◆ NewLocalConnection

void Tp::Service::ChannelTypeStreamTubeAdaptor::NewLocalConnection ( uint  connectionID)
signal

Represents the exported D-Bus signal NewLocalConnection on this object.

Adaptees should export this signal as a Qt signal with the following signature: void newLocalConnection(uint connectionID);

The adaptee signal will be automatically relayed as a D-Bus signal once emitted.

Parameters
connectionID
The unique ID associated with this connection. This ID will be used 
to identifiy the connection when reporting errors with 
ConnectionClosed.

◆ ConnectionClosed

void Tp::Service::ChannelTypeStreamTubeAdaptor::ConnectionClosed ( uint  connectionID,
const QString &  error,
const QString &  message 
)
signal

Represents the exported D-Bus signal ConnectionClosed on this object.

Adaptees should export this signal as a Qt signal with the following signature: void connectionClosed(uint connectionID, const QString& error, const QString& message);

The adaptee signal will be automatically relayed as a D-Bus signal once emitted.

Parameters
connectionID
The ID of the connection.
error

The name of a D-Bus error describing the error that occurred.

The following errors can be used:

  • org.freedesktop.Telepathy.Error.Cancelled: user closed the socket or the tube.
  • org.freedesktop.Telepathy.Error.ConnectionLost: the bytestream relaying connection's data has been broken.
  • org.freedesktop.Telepathy.Error.ConnectionRefused: the tube offer refused the connection.
message
A debug message.