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

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

Inherits Tp::AbstractAdaptor.

Public Slots

QStringList GetAvatarRequirements (const QDBusMessage &dbusMessage, ushort &minWidth, ushort &minHeight, ushort &maxWidth, ushort &maxHeight, uint &maxBytes)
 
QStringList GetAvatarTokens (const Tp::UIntList &contacts, const QDBusMessage &dbusMessage)
 
Tp::AvatarTokenMap GetKnownAvatarTokens (const Tp::UIntList &contacts, const QDBusMessage &dbusMessage)
 
QByteArray RequestAvatar (uint contact, const QDBusMessage &dbusMessage, QString &MIMEType)
 
void RequestAvatars (const Tp::UIntList &contacts, const QDBusMessage &dbusMessage)
 
QString SetAvatar (const QByteArray &avatar, const QString &MIMEType, const QDBusMessage &dbusMessage)
 
void ClearAvatar (const QDBusMessage &dbusMessage)
 

Signals

void AvatarUpdated (uint contact, const QString &newAvatarToken)
 
void AvatarRetrieved (uint contact, const QString &token, const QByteArray &avatar, const QString &type)
 

Public Member Functions

QStringList SupportedAvatarMIMETypes () const
 
uint MinimumAvatarHeight () const
 
uint MinimumAvatarWidth () const
 
uint RecommendedAvatarHeight () const
 
uint RecommendedAvatarWidth () const
 
uint MaximumAvatarHeight () const
 
uint MaximumAvatarWidth () const
 
uint MaximumAvatarBytes () 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.Avatars".

Member Function Documentation

◆ SupportedAvatarMIMETypes()

QStringList Tp::Service::ConnectionInterfaceAvatarsAdaptor::SupportedAvatarMIMETypes ( ) const

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

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

An array of supported MIME types (e.g. "image/jpeg"). Clients MAY assume that the first type in this array is preferred. This property cannot change after the Connection goes to the Connected state.

Returns
The value of exported property SupportedAvatarMIMETypes.

◆ MinimumAvatarHeight()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::MinimumAvatarHeight ( ) const

Return the value of the exported D-Bus object property MinimumAvatarHeight of type uint.

Adaptees should export this property as a Qt property named 'minimumAvatarHeight' with type uint.

The minimum height in pixels of an avatar on this protocol, which MAY be 0. This property cannot change after the Connection goes to the Connected state.

Returns
The value of exported property MinimumAvatarHeight.

◆ MinimumAvatarWidth()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::MinimumAvatarWidth ( ) const

Return the value of the exported D-Bus object property MinimumAvatarWidth of type uint.

Adaptees should export this property as a Qt property named 'minimumAvatarWidth' with type uint.

The minimum width in pixels of an avatar on this protocol, which MAY be 0. This property cannot change after the Connection goes to the Connected state.

Returns
The value of exported property MinimumAvatarWidth.

◆ RecommendedAvatarHeight()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::RecommendedAvatarHeight ( ) const

Return the value of the exported D-Bus object property RecommendedAvatarHeight of type uint.

Adaptees should export this property as a Qt property named 'recommendedAvatarHeight' with type uint.

The recommended height in pixels of an avatar on this protocol, or 0 if there is no preferred height. This property cannot change after the Connection goes to the Connected state. In XMPP a recommended width is given by the protocol specification; in proprietary protocols, using the same avatar size as the proprietary client is likely to lead to the best display to other users.

Returns
The value of exported property RecommendedAvatarHeight.

◆ RecommendedAvatarWidth()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::RecommendedAvatarWidth ( ) const

Return the value of the exported D-Bus object property RecommendedAvatarWidth of type uint.

Adaptees should export this property as a Qt property named 'recommendedAvatarWidth' with type uint.

The recommended width in pixels of an avatar on this protocol, or 0 if there is no preferred width. This property cannot change after the Connection goes to the Connected state. The rationale is the same as for RecommendedAvatarHeight.

Returns
The value of exported property RecommendedAvatarWidth.

◆ MaximumAvatarHeight()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::MaximumAvatarHeight ( ) const

Return the value of the exported D-Bus object property MaximumAvatarHeight of type uint.

Adaptees should export this property as a Qt property named 'maximumAvatarHeight' with type uint.

The maximum height in pixels of an avatar on this protocol, or 0 if there is no limit. This property cannot change after the Connection goes to the Connected state.

Returns
The value of exported property MaximumAvatarHeight.

◆ MaximumAvatarWidth()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::MaximumAvatarWidth ( ) const

Return the value of the exported D-Bus object property MaximumAvatarWidth of type uint.

Adaptees should export this property as a Qt property named 'maximumAvatarWidth' with type uint.

The maximum width in pixels of an avatar on this protocol, or 0 if there is no limit. This property cannot change after the Connection goes to the Connected state.

Returns
The value of exported property MaximumAvatarWidth.

◆ MaximumAvatarBytes()

uint Tp::Service::ConnectionInterfaceAvatarsAdaptor::MaximumAvatarBytes ( ) const

Return the value of the exported D-Bus object property MaximumAvatarBytes of type uint.

Adaptees should export this property as a Qt property named 'maximumAvatarBytes' with type uint.

The maximum size in bytes of an avatar on this protocol, or 0 if there is no limit. This property cannot change after the Connection goes to the Connected state.

Returns
The value of exported property MaximumAvatarBytes.

◆ GetAvatarRequirements

QStringList Tp::Service::ConnectionInterfaceAvatarsAdaptor::GetAvatarRequirements ( const QDBusMessage &  dbusMessage,
ushort &  minWidth,
ushort &  minHeight,
ushort &  maxWidth,
ushort &  maxHeight,
uint &  maxBytes 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void getAvatarRequirements(const Tp::Service::ConnectionInterfaceAvatarsAdaptor::GetAvatarRequirementsContextPtr &context);

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

Get the required format of avatars on this connection.

Parameters
minWidthOutput parameter
The minimum image width in pixels
minHeightOutput parameter
The minimum image height in pixels
maxWidthOutput parameter
The maximum image width in pixels, or 0 if there is no limit
maxHeightOutput parameter
The maximum image height in pixels, or 0 if there is no limit
maxBytesOutput parameter
The maximum image size in bytes, or 0 if there is no limit
Returns
An array of supported MIME types (eg image/jpeg)

◆ GetAvatarTokens

QStringList Tp::Service::ConnectionInterfaceAvatarsAdaptor::GetAvatarTokens ( const Tp::UIntList contacts,
const QDBusMessage &  dbusMessage 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void getAvatarTokens(const Tp::UIntList& contacts, const Tp::Service::ConnectionInterfaceAvatarsAdaptor::GetAvatarTokensContextPtr &context);

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

Get the unique tokens for all of the given contacts' avatars. Using this method in new Telepathy clients is deprecated; use GetKnownAvatarTokens instead.

Parameters
contacts
An array of handles representing contacts
Returns
An array of avatar tokens or empty strings (if no avatar is set) in 
the same order as the given array of contact handles

◆ GetKnownAvatarTokens

Tp::AvatarTokenMap Tp::Service::ConnectionInterfaceAvatarsAdaptor::GetKnownAvatarTokens ( const Tp::UIntList contacts,
const QDBusMessage &  dbusMessage 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void getKnownAvatarTokens(const Tp::UIntList& contacts, const Tp::Service::ConnectionInterfaceAvatarsAdaptor::GetKnownAvatarTokensContextPtr &context);

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

Get the unique tokens for the given contacts' avatars. These tokens can be persisted across connections, and should be used by the client to check whether the avatars have been updated. For handles other than the self handle, only tokens that are already known are returned; an empty token means the given contact has no avatar. However, a CM must always have the tokens for the self handle if one is set (even if it is set to no avatar). On protocols where the avatar does not persist between connections, a CM should omit the self handle from the returned map until an avatar is explicitly set or cleared.

Parameters
contacts
An array of handles representing contacts
Returns
A dictionary of handles mapped to avatar tokens, containing only 
the known avatar tokens.

◆ RequestAvatar

QByteArray Tp::Service::ConnectionInterfaceAvatarsAdaptor::RequestAvatar ( uint  contact,
const QDBusMessage &  dbusMessage,
QString &  MIMEType 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void requestAvatar(uint contact, const Tp::Service::ConnectionInterfaceAvatarsAdaptor::RequestAvatarContextPtr &context);

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

Request the avatar for a given contact. Using this method in new Telepathy clients is deprecated; use RequestAvatars instead.

Parameters
contact
An integer handle for the contact to request the avatar for
MIMETypeOutput parameter
A string containing the image MIME type (eg image/jpeg), or empty 
if unknown
Returns
An array of bytes containing the image data

◆ RequestAvatars

void Tp::Service::ConnectionInterfaceAvatarsAdaptor::RequestAvatars ( const Tp::UIntList contacts,
const QDBusMessage &  dbusMessage 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void requestAvatars(const Tp::UIntList& contacts, const Tp::Service::ConnectionInterfaceAvatarsAdaptor::RequestAvatarsContextPtr &context);

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

Request avatars for a number of contacts. The AvatarRetrieved signal is emitted for each avatar retrieved. If the handles are valid but retrieving an avatar fails (for any reason, including the contact not having an avatar) the AvatarRetrieved signal is not emitted for that contact.

Parameters
contacts
The contacts to retrieve avatars for

◆ SetAvatar

QString Tp::Service::ConnectionInterfaceAvatarsAdaptor::SetAvatar ( const QByteArray &  avatar,
const QString &  MIMEType,
const QDBusMessage &  dbusMessage 
)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void setAvatar(const QByteArray& avatar, const QString& MIMEType, const Tp::Service::ConnectionInterfaceAvatarsAdaptor::SetAvatarContextPtr &context);

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

Set a new avatar image for this connection. The avatar image must respect the requirements obtained by GetAvatarRequirements.

Parameters
avatar
An array of bytes representing the avatar image data
MIMEType
A string representing the image MIME type
Returns
The string token of the new avatar

◆ ClearAvatar

void Tp::Service::ConnectionInterfaceAvatarsAdaptor::ClearAvatar ( const QDBusMessage &  dbusMessage)
slot

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

Adaptees should export this method as a Qt slot with the following signature: void clearAvatar(const Tp::Service::ConnectionInterfaceAvatarsAdaptor::ClearAvatarContextPtr &context);

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

Remove the avatar image for this connection.

◆ AvatarUpdated

void Tp::Service::ConnectionInterfaceAvatarsAdaptor::AvatarUpdated ( uint  contact,
const QString &  newAvatarToken 
)
signal

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

Adaptees should export this signal as a Qt signal with the following signature: void avatarUpdated(uint contact, const QString& newAvatarToken);

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

Parameters
contact
An integer handle for the contact whose avatar has changed
newAvatarToken
Unique token for their new avatar

◆ AvatarRetrieved

void Tp::Service::ConnectionInterfaceAvatarsAdaptor::AvatarRetrieved ( uint  contact,
const QString &  token,
const QByteArray &  avatar,
const QString &  type 
)
signal

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

Adaptees should export this signal as a Qt signal with the following signature: void avatarRetrieved(uint contact, const QString& token, const QByteArray& avatar, const QString& type);

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

Parameters
contact
The contact whose avatar has been retrieved
token
The token corresponding to the avatar
avatar
An array of bytes containing the image data
type
A string containing the image MIME type (eg image/jpeg), or empty 
if unknown