Tp::Service::ProtocolInterfaceAddressingAdaptor Class Reference

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

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

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

Inherits Tp::AbstractAdaptor.

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

## Detailed Description

Adaptor class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.Protocol.Interface.Addressing".

## Member Function Documentation

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`.

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`.

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.

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.