Home · All Classes · All Namespaces · Modules · Functions · Files |
The ChannelRequest class represents a Telepathy channel request. More...
#include <TelepathyQt4/ChannelRequest>
Inherits Tp::StatefulDBusProxy, and OptionalInterfaceFactory< ChannelRequest >.
The ChannelRequest class represents a Telepathy channel request.
A channel request is an object in the channel dispatcher representing an ongoing request for some channels to be created or found. There can be any number of channel request objects at the same time.
A channel request can be cancelled by any client (not just the one that requested it). This means that the channel dispatcher will close the resulting channel, or refrain from requesting it at all, rather than dispatching it to a handler.
Tp::ChannelRequest::~ChannelRequest | ( | ) | [virtual] |
Class destructor.
Tp::ChannelRequest::ChannelRequest | ( | const QDBusConnection & | bus, | |
const QString & | objectPath, | |||
const QVariantMap & | immutableProperties, | |||
const AccountFactoryConstPtr & | accountFactory, | |||
const ConnectionFactoryConstPtr & | connectionFactory, | |||
const ChannelFactoryConstPtr & | channelFactory, | |||
const ContactFactoryConstPtr & | contactFactory | |||
) | [protected] |
Construct a new channel request object using the given bus and the given factories.
bus | QDBusConnection to use. | |
objectPath | The channel request object path. | |
accountFactory | The account factory to use. | |
connectionFactory | The connection factory to use. | |
channelFactory | The channel factory to use. | |
contactFactory | The contact factory to use. | |
immutableProperties | The immutable properties of the channel request. |
Tp::ChannelRequest::ChannelRequest | ( | const AccountPtr & | account, | |
const QString & | objectPath, | |||
const QVariantMap & | immutableProperties | |||
) | [protected] |
Construct a new channel request object using the given account.
The constructed instance will use the factories from the account.
account | Account to use. | |
objectPath | The channel request object path. | |
immutableProperties | The immutable properties of the channel request. |
ChannelRequestPtr Tp::ChannelRequest::create | ( | const QDBusConnection & | bus, | |
const QString & | objectPath, | |||
const QVariantMap & | immutableProperties, | |||
const AccountFactoryConstPtr & | accountFactory, | |||
const ConnectionFactoryConstPtr & | connectionFactory, | |||
const ChannelFactoryConstPtr & | channelFactory, | |||
const ContactFactoryConstPtr & | contactFactory | |||
) | [static] |
Create a new channel request object using the given bus and the given factories.
objectPath | The channel request object path. | |
immutableProperties | The channel request immutable properties. | |
accountFactory | The account factory to use. | |
connectionFactory | The connection factory to use. | |
channelFactory | The channel factory to use. | |
contactFactory | The contact factory to use. |
ChannelRequestPtr Tp::ChannelRequest::create | ( | const AccountPtr & | account, | |
const QString & | objectPath, | |||
const QVariantMap & | immutableProperties | |||
) | [static] |
Create a new channel request object for the given account.
The returned instance will use factories from the account.
account | The account that the request was made through. | |
objectPath | The channel request object path. | |
immutableProperties | The channel request immutable properties. |
AccountPtr Tp::ChannelRequest::account | ( | ) | const |
Return the account on which this request was made.
This method can be used even before the ChannelRequest is ready, in which case the account object corresponding to the immutable properties is returned. In this case, the Account object is not necessarily ready either. This is useful for eg. matching ChannelRequests from ClientHandlerInterface::addRequest() with existing accounts in the application: either by object path, or if account factories are in use, even by object identity.
If the account is not provided in the immutable properties, this will only return a non-NULL
AccountPtr once ChannelRequest::FeatureCore is ready on this object.
QDateTime Tp::ChannelRequest::userActionTime | ( | ) | const |
Return the time at which the user action occurred, or 0 if this channel request is for some reason not involving user action.
Unix developers: this corresponds to the _NET_WM_USER_TIME property in EWMH.
This property is set when the channel request is created, and can never change.
This method can be used even before the ChannelRequest is ready: in this case, the user action time from the immutable properties, if any, is returned.
QString Tp::ChannelRequest::preferredHandler | ( | ) | const |
Return either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable.
This property is set when the channel request is created, and can never change.
This method can be used even before the ChannelRequest is ready: in this case, the preferred handler from the immutable properties, if any, is returned.
QualifiedPropertyValueMapList Tp::ChannelRequest::requests | ( | ) | const |
Return the desirable properties for the channel or channels to be created, as specified when placing the request in the first place.
This property is set when the channel request is created, and can never change.
This method can be used even before the ChannelRequest is ready: in this case, the requested channel properties from the immutable properties, if any, are returned. This is useful for e.g. matching ChannelRequests from ClientHandlerInterface::addRequest() with existing requests in the application (by the target ID or handle, most likely).
ChannelRequestHints Tp::ChannelRequest::hints | ( | ) | const |
Return the dictionary of metadata provided by the channel requester when requesting the channel.
This property is set when the channel request is created, and can never change.
This method can be used even before the ChannelRequest is ready: in this case, the requested channel properties from the immutable properties, if any, are returned. This is useful for e.g. matching ChannelRequests from ClientHandlerInterface::addRequest() with existing requests in the application (by the target ID or handle, most likely).
QVariantMap Tp::ChannelRequest::immutableProperties | ( | ) | const |
Return all of the immutable properties passed to this object when created.
This is useful for e.g. getting to domain-specific properties of channel requests.
PendingOperation * Tp::ChannelRequest::cancel | ( | ) |
Cancel the channel request.
If failed() is emitted in response to this method, the error will be TP_QT4_ERROR_CANCELLED.
If the channel has already been dispatched to a handler, then it's too late to call this method, and the channel request will no longer exist.
ChannelPtr Tp::ChannelRequest::channel | ( | ) | const |
Return the Channel which this request succeeded with, if any.
This will only ever be populated if Account::requestsSucceedWithChannel() is true
, and succeeded() has already been emitted on this ChannelRequest. Note that a PendingChannelRequest being successfully finished already implies succeeded() has been emitted.
void Tp::ChannelRequest::failed | ( | const QString & | errorName, | |
const QString & | errorMessage | |||
) | [signal] |
Emitted when the channel request has failed. No further methods must not be called on it.
errorName | The name of a D-Bus error. | |
errorMessage | The error message. |
void Tp::ChannelRequest::succeeded | ( | ) | [signal] |
void Tp::ChannelRequest::succeeded | ( | const Tp::ChannelPtr & | channel | ) | [signal] |
Emitted when the channel request has succeeded. No further methods must not be called on it.
The channel parameter can be used to observe the channel resulting from the request (e.g. for it getting closed). The pointer may be NULL if the Channel Dispatcher implementation is too old. Whether a non-NULL channel can be expected can be checked with Account::requestsSucceedWithChannel().
If there is a channel, it will be of the subclass determined by and made ready (or not) according to the settings of the ChannelFactory on the Account the request was made through.
channel | Pointer to a proxy for the resulting channel, if the Channel Dispatcher reported it. |
Client::ChannelRequestInterface * Tp::ChannelRequest::baseInterface | ( | ) | const [protected] |
Return the ChannelRequestInterface for this ChannelRequest class. This method is protected since the convenience methods provided by this class should always be used instead of the interface by users of the class.
void Tp::ChannelRequest::connectNotify | ( | const char * | signalName | ) | [protected] |
const Feature Tp::ChannelRequest::FeatureCore [static] |
Feature representing the core that needs to become ready to make the ChannelRequest object usable.
Note that this feature must be enabled in order to use most ChannelRequest methods.
When calling isReady(), becomeReady(), this feature is implicitly added to the requested features.
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation |
Telepathy-Qt4 0.6.5
|