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

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

Inherits Tp::AbstractAdaptor.

Public Slots

Tp::ContactAttributesMap GetContactAttributes (const Tp::UIntList &handles, const QStringList &interfaces, bool hold, const QDBusMessage &dbusMessage)
 
uint GetContactByID (const QString &identifier, const QStringList &interfaces, const QDBusMessage &dbusMessage, QVariantMap &attributes)
 

Public Member Functions

QStringList ContactAttributeInterfaces () 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.Connection.Interface.Contacts".

Member Function Documentation

QStringList Tp::Service::ConnectionInterfaceContactsAdaptor::ContactAttributeInterfaces ( ) const

Return the value of the exported D-Bus object property ContactAttributeInterfaces of type QStringList.

Adaptees should export this property as a Qt property named 'contactAttributeInterfaces' with type QStringList.

A list of D-Bus interfaces for which GetContactAttributes is expected to work. This cannot change during the lifetime of the Connection.

Returns
The value of exported property ContactAttributeInterfaces.
Tp::ContactAttributesMap Tp::Service::ConnectionInterfaceContactsAdaptor::GetContactAttributes ( const Tp::UIntList handles,
const QStringList &  interfaces,
bool  hold,
const QDBusMessage &  dbusMessage 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void getContactAttributes(const Tp::UIntList& handles, const QStringList& interfaces, bool hold, const Tp::Service::ConnectionInterfaceContactsAdaptor::GetContactAttributesContextPtr &context);

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

Return any number of contact attributes for the given handles.

Parameters
handles
An array of handles representing contacts.
interfaces

A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.

Connection managers SHOULD ignore interfaces requested which they do not support (i.e. those not mentioned in the \\\ \\link requestPropertyContactAttributeInterfaces() ContactAttributeInterfaces \\endlink \\htmlonly property.)

This simplifies client-side code. Clients which care may distinguish between unsupported interfaces (e.g. this Connection does not support Avatars), and interfaces on which no information is known for these contacts (e.g. we don't know the avatar tokens of any of the contacts, so we omitted them all) by inspecting \\endhtmlonly \\link requestPropertyContactAttributeInterfaces() ContactAttributeInterfaces \\endlink \\htmlonly .

Attributes from the interface \\endhtmlonly ConnectionInterface \\htmlonly are always returned, and need not be requested explicitly.

As well as returning cached information immediately, the connection MAY start asynchronous requests to obtain better values for the contact attributes. If better values are later obtained by this process, they will be indicated with the usual signals (such as \\endhtmlonly ConnectionInterfaceAliasingInterface::AliasesChanged() \\htmlonly ).

For instance, an XMPP connection manager could download vCards in response to a request for \\endhtmlonly ConnectionInterfaceAliasingInterface \\htmlonly attributes.
Parameters
hold

If true, all handles that appear as keys in the result have been held on behalf of the calling process, as if by a call to \\\ ConnectionInterface::HoldHandles() \\htmlonly . (If \\endhtmlonly \\link ConnectionInterface::requestPropertyHasImmortalHandles() ConnectionInterface::HasImmortalHandles \\endlink \\htmlonly is true, which SHOULD be the case in all new connection managers, this has no effect.)

For further round-trip avoidance.
Returns

A dictionary mapping the contact handles to contact attributes. If any of the requested handles are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (org.freedesktop.Telepathy.Connection/contact-id).

uint Tp::Service::ConnectionInterfaceContactsAdaptor::GetContactByID ( const QString &  identifier,
const QStringList &  interfaces,
const QDBusMessage &  dbusMessage,
QVariantMap &  attributes 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void getContactByID(const QString& identifier, const QStringList& interfaces, const Tp::Service::ConnectionInterfaceContactsAdaptor::GetContactByIDContextPtr &context);

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

Return any number of contact attributes for the given identifier. This is for a single identifier to make it simpler to use for the most common use case. For multiple contacts case, GetContactAttributes should be used.

Parameters
identifier
An identifier representing a contact.
interfaces

A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.

See \\\ GetContactAttributes() \\htmlonly for details.

attributesOutput parameter

All supported attributes of the contact on the given interfaces that can be returned without network round-trips. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

The contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (org.freedesktop.Telepathy.Connection/contact-id).

Returns

The contact's handle, as returned by \\\ ConnectionInterface::RequestHandles() \\htmlonly


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.7