Tp::Client::ChannelDispatchOperationInterface Class Reference

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

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Tp::Client::ChannelDispatchOperationInterface Class Reference
ChannelDispatchOperation proxies

`#include <TelepathyQt/ChannelDispatchOperation>`

Inherits Tp::AbstractInterface.

## Public Slots
QDBusPendingReply | HandleWith (const QString &handler, int timeout=-1)
QDBusPendingReply | Claim (int timeout=-1)
QDBusPendingReply | HandleWithTime (const QString &handler, qlonglong userActionTime, int timeout=-1)

## Signals
void | ChannelLost (const QDBusObjectPath &channel, const QString &error, const QString &message)
void | Finished ()
Signals inherited from Tp::AbstractInterface
void | propertiesChanged (const QVariantMap &changedProperties, const QStringList &invalidatedProperties)

## Public Member Functions
| ChannelDispatchOperationInterface (const QString &busName, const QString &objectPath, QObject *parent=0)
| ChannelDispatchOperationInterface (const QDBusConnection &connection, const QString &busName, const QString &objectPath, QObject *parent=0)
| ChannelDispatchOperationInterface (Tp::DBusProxy *proxy)
Tp::PendingVariant * | requestPropertyInterfaces () const
Tp::PendingVariant * | requestPropertyConnection () const
Tp::PendingVariant * | requestPropertyAccount () const
Tp::PendingVariant * | requestPropertyChannels () const
Tp::PendingVariant * | requestPropertyPossibleHandlers () const
Tp::PendingVariantMap * | requestAllProperties () const
Public Member Functions inherited from Tp::AbstractInterface
virtual | ~AbstractInterface ()
bool | isValid () const
QString | invalidationReason () const
QString | invalidationMessage () const
void | setMonitorProperties (bool monitorProperties)
bool | isMonitoringProperties () const

## Static Public Member Functions
static QLatin1String | staticInterfaceName ()

## Protected Member Functions
virtual void | invalidate (Tp::DBusProxy *, const QString &, const QString &)
Protected Member Functions inherited from Tp::AbstractInterface
| AbstractInterface (DBusProxy *proxy, const QLatin1String &interface)
| AbstractInterface (const QString &busName, const QString &path, const QLatin1String &interface, const QDBusConnection &connection, QObject *parent)
PendingVariant * | internalRequestProperty (const QString &name) const
PendingOperation * | internalSetProperty (const QString &name, const QVariant &newValue)
PendingVariantMap * | internalRequestAllProperties () const

## Additional Inherited Members
Protected Slots inherited from Tp::AbstractInterface

## Detailed Description

Proxy class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.ChannelDispatchOperation".

## Constructor & Destructor Documentation

Tp::Client::ChannelDispatchOperationInterface::ChannelDispatchOperationInterface | ( | const QString & | busName,
|  | const QString & | objectPath,
|  | QObject * | parent = `0`
| ) |  |

Creates a ChannelDispatchOperationInterface associated with the given object on the session bus.

Parameters

  busName | Name of the service the object is on.
  objectPath | Path to the object on the service.
  parent | Passed to the parent class constructor.

Tp::Client::ChannelDispatchOperationInterface::ChannelDispatchOperationInterface | ( | const QDBusConnection & | connection,
|  | const QString & | busName,
|  | const QString & | objectPath,
|  | QObject * | parent = `0`
| ) |  |

Creates a ChannelDispatchOperationInterface associated with the given object on the given bus.

Parameters

  connection | The bus via which the object can be reached.
  busName | Name of the service the object is on.
  objectPath | Path to the object on the service.
  parent | Passed to the parent class constructor.

Tp::Client::ChannelDispatchOperationInterface::ChannelDispatchOperationInterface | ( | Tp::DBusProxy * | proxy | ) |

Creates a ChannelDispatchOperationInterface associated with the same object as the given proxy.

Parameters

  proxy | The proxy to use. It will also be the QObject::parent() for this object.

## Member Function Documentation

static QLatin1String Tp::Client::ChannelDispatchOperationInterface::staticInterfaceName | ( |  | ) |
| inlinestatic

Returns the name of the interface "org.freedesktop.Telepathy.ChannelDispatchOperation", which this class represents.

Returns
  The D-Bus interface name.

Tp::PendingVariant* Tp::Client::ChannelDispatchOperationInterface::requestPropertyInterfaces | ( |  | ) | const
| inline

Asynchronous getter for the remote object property `Interfaces` of type `QStringList`.

A list of the extra interfaces provided by this channel dispatch operation. This property cannot change.

Returns
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelDispatchOperationInterface::requestPropertyConnection | ( |  | ) | const
| inline

Asynchronous getter for the remote object property `Connection` of type `QDBusObjectPath`.

The Connection with which the Channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'. This property cannot change.

Returns
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelDispatchOperationInterface::requestPropertyAccount | ( |  | ) | const
| inline

Asynchronous getter for the remote object property `Account` of type `QDBusObjectPath`.

The Account with which the Connection and Channels are associated. This property cannot change.

Returns
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelDispatchOperationInterface::requestPropertyChannels | ( |  | ) | const
| inline

Asynchronous getter for the remote object property `Channels` of type `Tp::ChannelDetailsList`.

The Channels to be dispatched, and their properties. Change notification is via the ChannelLost signal (channels cannot be added to this property, only removed).

Returns
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelDispatchOperationInterface::requestPropertyPossibleHandlers | ( |  | ) | const
| inline

Asynchronous getter for the remote object property `PossibleHandlers` of type `QStringList`.

The well known bus names (starting with org.freedesktop.Telepathy.Client.) of the possible Handlers for these channels. The channel dispatcher MUST place the most preferred handlers first, according to some reasonable heuristic. As a result, approvers SHOULD use the first handler by default. The heuristic used to prioritize handlers SHOULD give a higher priority to handlers that are already running. If, for instance, Empathy and Kopete have similar functionality, and Empathy is running, we should prefer to send channels to it rather than launching Kopete via service activation.

Returns
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariantMap* Tp::Client::ChannelDispatchOperationInterface::requestAllProperties | ( |  | ) | const
| inline

Request all of the DBus properties on the interface.

Returns
  A pending variant map which will emit finished when the properties have been retrieved.

QDBusPendingReply Tp::Client::ChannelDispatchOperationInterface::HandleWith | ( | const QString & | handler,
|  | int | timeout = `-1`
| ) |  |
| inlineslot

Begins a call to the D-Bus method `HandleWith` on the remote object.

Called by an approver to accept a channel bundle and request that the given handler be used to handle it.

If successful, this method will cause the ChannelDispatchOperation object to disappear, emitting Finished() .

However, this method may fail because the dispatch has already been completed and the object has already gone. If this occurs, it indicates that another approver has asked for the bundle to be handled by a particular handler. The approver MUST NOT attempt to interact with the channels further in this case, unless it is separately invoked as the handler.

Approvers which are also channel handlers SHOULD use Claim() instead of HandleWith to request that they can handle a channel bundle themselves.

(FIXME: list some possible errors)

If the channel handler raises an error from ClientHandlerInterface::HandleChannels() , this method MAY respond by raising that same error, even if it is not specifically documented here.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters

  handler | The well-known bus name (starting with `org.freedesktop.Telepathy.Client.`) of the channel handler that should handle the channel, or the empty string if the client has no preferred channel handler.
  timeout | The timeout in milliseconds.

QDBusPendingReply Tp::Client::ChannelDispatchOperationInterface::Claim | ( | int | timeout = `-1` | ) |
| inlineslot

Begins a call to the D-Bus method `Claim` on the remote object.

Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel, but does not have the ClientHandlerInterface::HandleChannels() method called on it.

Clients that call Claim on channels but do not immediately close them SHOULD implement the Handler interface and its ClientHandlerInterface::HandledChannels property.

Approvers wishing to reject channels MUST call this method to claim ownership of them, and MUST NOT call ChannelInterface::Close() on the channels unless/until this method returns successfully.

The channel dispatcher can't know how best to close arbitrary channel types, so it leaves it up to the approver to do so. For instance, for Text channels it is necessary to acknowledge any messages that have already been displayed to the user first - ideally, the approver would display and then acknowledge the messages - or to call ChannelInterfaceDestroyableInterface::Destroy() if the destructive behaviour of that method is desired.

Similarly, an Approver for StreamedMedia channels can close the channel with a reason (e.g. "busy") if desired. The channel dispatcher, which is designed to have no specific knowledge of particular channel types, can't do that.

If successful, this method will cause the ChannelDispatchOperation object to disappear, emitting Finished() , in the same way as for HandleWith() .

This method may fail because the dispatch operation has already been completed. Again, see HandleWith for more details. The approver MUST NOT attempt to interact with the channels further in this case.

(FIXME: list some other possible errors)

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters

  timeout | The timeout in milliseconds.

QDBusPendingReply Tp::Client::ChannelDispatchOperationInterface::HandleWithTime | ( | const QString & | handler,
|  | qlonglong | userActionTime,
|  | int | timeout = `-1`
| ) |  |
| inlineslot

Begins a call to the D-Bus method `HandleWithTime` on the remote object.

A variant of HandleWith() allowing the approver to pass an user action time. This timestamp will be passed to the Handler when ClientHandlerInterface::HandleChannels() is called.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters

  handler | The well-known bus name (starting with `org.freedesktop.Telepathy.Client.`) of the channel handler that should handle the channel, or the empty string if the client has no preferred channel handler.
  userActionTime | The time at which user action occurred.
  timeout | The timeout in milliseconds.

void Tp::Client::ChannelDispatchOperationInterface::ChannelLost | ( | const QDBusObjectPath & | channel,
|  | const QString & | error,
|  | const QString & | message
| ) |  |
| signal

Represents the signal `ChannelLost` on the remote object.

A channel has closed before it could be claimed or handled. If this is emitted for the last remaining channel in a channel dispatch operation, it MUST immediately be followed by Finished() .

This signal MUST NOT be emitted until all Approvers that were invoked have returned (successfully or with an error) from their ClientApproverInterface::AddDispatchOperation() method.

This means that Approvers can connect to the ChannelLost signal in a race-free way. Non-approver processes that discover a channel dispatch operation in some way (such as observers) will have to follow the usual "connect to signals then recover state" model - first connect to ChannelLost and Finished() , then download Channels (and on error, perhaps assume that the operation has already Finished).

Parameters

  channel |
      The Channel that closed.
  error | The name of a D-Bus error indicating why the channel closed. If no better reason can be found, `org.freedesktop.Telepathy.Error.NotAvailable` MAY be used as a fallback; this means that this error SHOULD NOT be given any more specific meaning.
  message |
      A string associated with the D-Bus error.

void Tp::Client::ChannelDispatchOperationInterface::Finished | ( |  | ) |
| signal

Represents the signal `Finished` on the remote object.

Emitted when this dispatch operation finishes. The dispatch operation is no longer present and further methods must not be called on it.

Approvers that have a user interface SHOULD stop notifying the user about the channels in response to this signal; they MAY assume that on errors, they would have received ChannelLost() first.

Its object path SHOULD NOT be reused for a subsequent dispatch operation; the ChannelDispatcher MUST choose object paths in a way that avoids immediate re-use.

Otherwise, clients might accidentally call HandleWith() or Claim() on a new dispatch operation instead of the one they intended to handle.

This signal MUST NOT be emitted until all Approvers that were invoked have returned (successfully or with an error) from their ClientApproverInterface::AddDispatchOperation() method.

This means that Approvers can connect to the ChannelLost signal in a race-free way. Non-approver processes that discover a channel dispatch operation in some way (such as observers) will have to follow the usual "connect to signals then recover state" model - first connect to ChannelLost() and Finished, then download Channels (and on error, perhaps assume that the operation has already Finished).

void Tp::Client::ChannelDispatchOperationInterface::invalidate | ( | Tp::DBusProxy * | proxy,
|  | const QString & | error,
|  | const QString & | message
| ) |  |
| protectedvirtual

Reimplemented from Tp::AbstractInterface.