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

Public Slots | Signals | Public Member Functions | List of all members
Tp::Service::ConnectionInterfaceAvatarsAdaptor Class Reference
Service-side implementation » Connection service implementation

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

Inheritance diagram for Tp::Service::ConnectionInterfaceAvatarsAdaptor:
[legend]

## 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
Public Member Functions inherited from QDBusAbstractAdaptor
| ~QDBusAbstractAdaptor ()
Public Member Functions inherited from QObject
| QObject (QObject *parent)
virtual | ~QObject ()
virtual bool | event (QEvent *e)
virtual bool | eventFilter (QObject *watched, QEvent *event)
virtual const QMetaObject * | metaObject () const
QString | objectName () const
void | setObjectName (const QString &name)
bool | isWidgetType () const
bool | signalsBlocked () const
bool | blockSignals (bool block)
QThread * | thread () const
void | moveToThread (QThread *targetThread)
int | startTimer (int interval)
void | killTimer (int id)
T | findChild (const QString &name) const
QList< T > | findChildren (const QString &name) const
QList< T > | findChildren (const QRegExp &regExp) const
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
const QObjectList & | children () const
void | setParent (QObject *parent)
void | installEventFilter (QObject *filterObj)
void | removeEventFilter (QObject *obj)
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
bool | disconnect (const char *signal, const QObject *receiver, const char *method)
bool | disconnect (const QObject *receiver, const char *method)
void | dumpObjectTree ()
void | dumpObjectInfo ()
bool | setProperty (const char *name, const QVariant &value)
QVariant | property (const char *name) const
QList< QByteArray > | dynamicPropertyNames () const
void | destroyed (QObject *obj)
QObject * | parent () const
bool | inherits (const char *className) const
void | deleteLater ()
| QObject (QObject *parent, const char *name)
void | insertChild (QObject *object)
void | removeChild (QObject *object)
bool | isA (const char *className) const
const char * | className () const
const char * | name () const
const char * | name (const char *defaultName) const
void | setName (const char *name)

## Additional Inherited Members

Static Public Member Functions inherited from QObject
QString | tr (const char *sourceText, const char *disambiguation, int n)
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n)
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
Protected Member Functions inherited from QDBusAbstractAdaptor
| QDBusAbstractAdaptor (QObject *obj)
void | setAutoRelaySignals (bool enable)
bool | autoRelaySignals () const
Protected Member Functions inherited from QObject
QObject * | sender () const
int | senderSignalIndex () const
int | receivers (const char *signal) const
virtual void | timerEvent (QTimerEvent *event)
virtual void | childEvent (QChildEvent *event)
virtual void | customEvent (QEvent *event)
virtual void | connectNotify (const char *signal)
virtual void | disconnectNotify (const char *signal)
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method)
Static Protected Member Functions inherited from QObject
QByteArray | normalizeSignalSlot (const char *signalSlot)
Properties inherited from QObject
| objectName

## 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

  minWidth

  Output parameter

      The minimum image width in pixels

  minHeight

  Output parameter

      The minimum image height in pixels

  maxWidth

  Output parameter

      The maximum image width in pixels, or 0 if there is no limit

  maxHeight

  Output parameter

      The maximum image height in pixels, or 0 if there is no limit

  maxBytes

  Output 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

  MIMEType

  Output 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