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

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

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

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

## Public Slots

QString | NormalizeVCardAddress (const QString &VCardField, const QString &VCardAddress, const QDBusMessage &dbusMessage)
QString | NormalizeContactURI (const QString &URI, const QDBusMessage &dbusMessage)

## Public Member Functions

QStringList | AddressableVCardFields () const
QStringList | AddressableURISchemes () 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.Protocol.Interface.Addressing".

## Member Function Documentation

## § AddressableVCardFields()

QStringList Tp::Service::ProtocolInterfaceAddressingAdaptor::AddressableVCardFields | ( |  | ) | const

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

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

The vCard fields that can be used to request a contact with normalized to lower case. If the `URL` vCard field is addressable, a colon, followed by the supported URI schemes will be concatenated.

For example: `["tel", "x-sip"]`.

The `url` vCard field MUST NOT appear here; see AddressableURISchemes instead.

In practice, protocols have a limited set of URI schemes that make sense to resolve as a contact.

Connection managers with a `.manager` file MUST cache this property in the protocol's section of the `.manager` file if it is non-empty, using the key `AddressableVCardFields`. The corresponding value is a list of strings, each followed with a semicolon and in the syntax of the "localestring" type from the Desktop Entry Specification.

Well-known vCard fields:

`tel`
  The TEL vCard field. Used for phone numbers.
`x-sip`
  The X-SIP vCard field. Used for SIP addresses.
`x-aim`
  The X-AIM vCard field. Used for AIM user IDs.
`x-icq`
  The X-ICQ vCard field. Used for ICQ UINs.
`x-skype`
  The X-SKYPE vCard field. Used for Skype user names or telephone numbers. There is also a X-SKYPE-USERNAME field, but for Telepathy purposes, `x-skype` is preferred
`x-groupwise`
  The X-GROUPWISE vCard field. Used for Groupwise contacts.
`x-gadugadu`
  The X-GADUGADU vCard field. Used for Gadu-Gadu contacts.
`x-jabber`
  The X-JABBER vCard field. Used for XMPP JIDs.
`x-msn`
  The X-MSN vCard field. Used for MSN contacts.
`x-yahoo`
  The X-YAHOO vCard field. Used for Yahoo! IDs.
`x-facebook-id`
  Used for Facebook IDs in XMPP. If the user JID is "-12345@chat.facebook.com" then the x-facebook-id is "12345"

Returns
  The value of exported property `AddressableVCardFields`.

## § AddressableURISchemes()

QStringList Tp::Service::ProtocolInterfaceAddressingAdaptor::AddressableURISchemes | ( |  | ) | const

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

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

The URI schemes that are supported by this protocol.

For example: `["tel", "sip"]`.

This property should only be used when the connection is offline. When it is connected the addressable URI schemes should be retrieved from the ConnectionInterfaceRequestsInterface::RequestableChannelClasses 's TargetURIScheme fixed-property instead.

Connection managers with a `.manager` file MUST cache this property in the protocol's section of the `.manager` file if it is non-empty, using the key `AddressableURISchemes`. The corresponding value is a list of strings, each followed with a semicolon and in the syntax of the "localestring" type from the Desktop Entry Specification.

Well-known URI schemes:

`sip`
  SIP protocol. For example: `sip:julien@example.com`.
`sips`
  Secure (encrypted) SIP protocol. For example: `sips:julien@example.com`.
`tel`
  Used for telephone numbers. For example: `tel:+12065551234`.
`xmpp`
  XMPP protocol. For example: `xmpp:julien@example.com`.
`msnim`
  For the purposes of ProtocolInterfaceAddressingInterface , ConnectionInterfaceAddressingInterface , and org.freedesktop.Telepathy.Channel.Interface.Addressing1 , the verb part is ignored, and SHOULD be `add`; the `contact` field in the query string is used to identify the contact. For example: `msnim:add?contact=julien`.
`aim`
  For the purposes of ProtocolInterfaceAddressingInterface , ConnectionInterfaceAddressingInterface , and org.freedesktop.Telepathy.Channel.Interface.Addressing1 , the verb part is ignored, and SHOULD be `addbuddy`; the `screenname` field in the query string is used to identify the contact. For example: `aim:addbuddy?screenname=julien`.
`skype`
  Skype protocol. For example: `skype:julien`.
`ymsgr`
  For the purposes of ProtocolInterfaceAddressingInterface , ConnectionInterfaceAddressingInterface , and org.freedesktop.Telepathy.Channel.Interface.Addressing1 , the verb part is ignored, and SHOULD be `addfriend`; the query string is used to identify the contact. For example: `ymsgr:addfriend?julien`.
`gg`
  Gadu-Gadu protocol. For example: `gg:julien`.

Returns
  The value of exported property `AddressableURISchemes`.

## § NormalizeVCardAddress

QString Tp::Service::ProtocolInterfaceAddressingAdaptor::NormalizeVCardAddress | ( | const QString & | VCardField,
|  | const QString & | VCardAddress,
|  | const QDBusMessage & | dbusMessage
| ) |  |

slot

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

Adaptees should export this method as a Qt slot with the following signature: void normalizeVCardAddress(const QString& VCardField, const QString& VCardAddress, const Tp::Service::ProtocolInterfaceAddressingAdaptor::NormalizeVCardAddressContextPtr &context);

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

Attempt to normalize the given vCard address. Where possible, this SHOULD return an address that would appear in the `org.freedesktop.Telepathy.Connection.Interface.Addressing1/addresses` attribute for a contact on a connected ConnectionInterface .

If full normalization requires network activity or is otherwise impossible to do without a ConnectionInterface , this method SHOULD perform a best-effort normalization.

An example would be a vCard TEL field with a formatted number in the form of `+1 (206) 555 1234`, this would be normalized to `+12065551234`.

This method MAY simply raise NotImplemented on some protocols, if it has no use.

Parameters

  VCardField

      The vCard field of the address we are normalizing. The field name
      SHOULD be in lower case, and MUST appear in AddressableVCardFields.

  VCardAddress

      The address to normalize, which is assumed to belong to a contact
      (and not, for instance, a chatroom or server).

Returns

      The vCard address, normalized as much as possible.

## § NormalizeContactURI

QString Tp::Service::ProtocolInterfaceAddressingAdaptor::NormalizeContactURI | ( | const QString & | URI,
|  | const QDBusMessage & | dbusMessage
| ) |  |

slot

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

Adaptees should export this method as a Qt slot with the following signature: void normalizeContactURI(const QString& URI, const Tp::Service::ProtocolInterfaceAddressingAdaptor::NormalizeContactURIContextPtr &context);

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

Attempt to normalize the given contact URI. Where possible, this SHOULD return an address that would appear in the `org.freedesktop.Telepathy.Connection.Interface.Addressing1/uris` attribute for a contact on a connected ConnectionInterface .

If full normalization requires network activity or is otherwise impossible to do without a ConnectionInterface , this method SHOULD perform a best-effort normalization.

If the URI has extra information beyond what's necessary to identify a particular contact, such as an XMPP resource or an action to carry out, this extra information SHOULD be removed. If all URIs in a scheme contain a verb or action (like `aim`, `ymsgr` and `msnim` URIs), then the verb SHOULD be replaced with the one specified in AddressableURISchemes .

This method is intended to normalize URIs stored in address books, for instance. In protocols like XMPP, if you vary the resource or action (query string), the URI still refers to the same high-level contact.

For instance, `xmpp:romeo@Example.Com/Empathy?message;body=Hello` would be normalized to `xmpp:romeo@example.com`, and `aim:goim?screenname=Romeo%20M&message=Hello` would be normalized to `aim:addbuddy?screenname=romeom`.

This method MAY simply raise NotImplemented on some protocols, if it has no use.

Parameters

  URI

      The URI to normalize, which is assumed to refer to a contact (as
      opposed to, for instance, a chatroom or a server). In some
      protocols, like XMPP, there is no way to tell whether a given URI
      refers to a contact or a chatroom by looking at its syntax. The
      URI&apos;s scheme (i.e. the part before the first colon) MUST
      appear in AddressableURISchemes.

Returns

      A URI, normalized as much as possible.