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

Classes | Public Types | Signals | Public Member Functions | Protected Member Functions

# Tp::Contact Class Reference

`#include </home/andrunko/work/telepathy/telepathy-qt4/TelepathyQt4/contact.h>`

List of all members.

## Classes

- class InfoFields

## Public Types

- enum Feature {
  FeatureAlias, FeatureAvatarToken, FeatureSimplePresence, FeatureCapabilities,
  FeatureLocation, FeatureInfo, FeatureAvatarData, _Padding
  }
- enum PresenceState { PresenceStateNo, PresenceStateAsk, PresenceStateYes }

## Signals

- void aliasChanged (const QString &alias)
- void avatarTokenChanged (const QString &avatarToken)
- void avatarDataChanged (const Tp::AvatarData &avatarData)
- void simplePresenceChanged (const QString &status, uint type, const QString &presenceMessage)
- void presenceChanged (const Tp::Presence &presence)
- void capabilitiesChanged (Tp::ContactCapabilities *caps)
- void locationUpdated (Tp::ContactLocation *location)
- void infoChanged (const Tp::ContactInfoFieldList &info)
- void infoFieldsChanged (const Tp::Contact::InfoFields &infoFields)
- void subscriptionStateChanged (Tp::Contact::PresenceState state)
- void publishStateChanged (Tp::Contact::PresenceState state)
- void blockStatusChanged (bool blocked)
- void addedToGroup (const QString &group)
- void removedFromGroup (const QString &group)

## Public Member Functions

- ContactManager * manager () const
- ReferencedHandles handle () const
- QString id () const
- QSet< Feature > requestedFeatures () const
- QSet< Feature > actualFeatures () const
- QString alias () const
- bool isAvatarTokenKnown () const
- QString avatarToken () const
- AvatarData avatarData () const
- TELEPATHY_QT4_DEPRECATED QString presenceStatus () const
- TELEPATHY_QT4_DEPRECATED uint presenceType () const
- TELEPATHY_QT4_DEPRECATED QString presenceMessage () const
- Presence presence () const
- ContactCapabilities * capabilities () const
- ContactLocation * location () const
- TELEPATHY_QT4_DEPRECATED
  ContactInfoFieldList info () const
- InfoFields infoFields () const
- PendingOperation * refreshInfo ()
- PendingContactInfo * requestInfo ()
- PresenceState subscriptionState () const
- PresenceState publishState () const
- PendingOperation * requestPresenceSubscription (const QString &message=QString())
- PendingOperation * removePresenceSubscription (const QString &message=QString())
- PendingOperation * authorizePresencePublication (const QString &message=QString())
- PendingOperation * removePresencePublication (const QString &message=QString())
- bool isBlocked () const
- PendingOperation * block (bool value=true)
- QStringList groups () const
- PendingOperation * addToGroup (const QString &group)
- PendingOperation * removeFromGroup (const QString &group)
- ~Contact ()

## Protected Member Functions

- void connectNotify (const char *)

## Member Enumeration Documentation

enum Tp::Contact::Feature

Enumerator:

  FeatureAlias |
  FeatureAvatarToken |
  FeatureSimplePresence |
  FeatureCapabilities |
  FeatureLocation |
  FeatureInfo |
  FeatureAvatarData |
  _Padding |

enum Tp::Contact::PresenceState

Enumerator:

  PresenceStateNo |
  PresenceStateAsk |
  PresenceStateYes |

## Constructor & Destructor Documentation

Tp::Contact::~Contact | ( |  | ) |

## Member Function Documentation

ContactManager * Tp::Contact::manager | ( |  | ) | const

ReferencedHandles Tp::Contact::handle | ( |  | ) | const

QString Tp::Contact::id | ( |  | ) | const

QSet< Contact::Feature > Tp::Contact::requestedFeatures | ( |  | ) | const

QSet< Contact::Feature > Tp::Contact::actualFeatures | ( |  | ) | const

QString Tp::Contact::alias | ( |  | ) | const

bool Tp::Contact::isAvatarTokenKnown | ( |  | ) | const

QString Tp::Contact::avatarToken | ( |  | ) | const

AvatarData Tp::Contact::avatarData | ( |  | ) | const

QString Tp::Contact::presenceStatus | ( |  | ) | const

uint Tp::Contact::presenceType | ( |  | ) | const

QString Tp::Contact::presenceMessage | ( |  | ) | const

Presence Tp::Contact::presence | ( |  | ) | const

ContactCapabilities * Tp::Contact::capabilities | ( |  | ) | const

Return the capabilities for this contact. User interfaces can use this information to show or hide UI components.

Change notification is advertised through capabilitiesChanged().

If ContactManager::supportedFeatures contains Contact::FeatureCapabilities, the returned object will be a ContactCapabilities object, where CapabilitiesBase::isSpecificToContact() will be true; if that feature isn't present, this returned object is the subset of Contact::manager()connection()->capabilities() and CapabilitiesBase::>isSpecificToContact() will be false.

This method requires Contact::FeatureCapabilities to be enabled.

Returns:
  An object representing the contact capabilities or 0 if FeatureCapabilities is not ready.

ContactLocation * Tp::Contact::location | ( |  | ) | const

Return the location for this contact.

Change notification is advertised through locationUpdated().

Note that the returned ContactLocation object should not be deleted. Its lifetime is the same as this contact lifetime.

This method requires Contact::FeatureLocation to be enabled.

Returns:
  An object representing the contact location or 0 if FeatureLocation is not ready.

ContactInfoFieldList Tp::Contact::info | ( |  | ) | const

Return the information for this contact.

Change notification is advertised through infoChanged().

Note that this method only return cached information. In order to refresh the information use refreshInfo().

This method requires Contact::FeatureInfo to be enabled.

Deprecated:
  Use infoFields() instead.

Returns:
  An object representing the contact information.

Contact::InfoFields Tp::Contact::infoFields | ( |  | ) | const

Return the information for this contact.

Change notification is advertised through infoFieldsChanged().

Note that this method only return cached information. In order to refresh the information use refreshInfo().

This method requires Contact::FeatureInfo to be enabled.

Returns:
  An object representing the contact information.

PendingOperation * Tp::Contact::refreshInfo | ( |  | ) |

Refresh information for the given contact.

Once the information is retrieved infoFieldsChanged() will be emitted.

This method requires Contact::FeatureInfo to be enabled.

Returns:
  A PendingOperation, which will emit PendingOperation::finished when the call has finished.

See also:
  infoFieldsChanged()

PendingContactInfo * Tp::Contact::requestInfo | ( |  | ) |

Request information for the given contact.

This method is useful for UIs that don't care about notification of changes in the contact information but want to show the contact information (e.g. right-click on a contact and show the contact info).

Returns:
  A PendingContactInfo, which will emit PendingContactInfo::finished when the information has been retrieved or an error occurred.

Contact::PresenceState Tp::Contact::subscriptionState | ( |  | ) | const

Contact::PresenceState Tp::Contact::publishState | ( |  | ) | const

PendingOperation * Tp::Contact::requestPresenceSubscription | ( | const QString & | message = `QString()` | ) |

PendingOperation * Tp::Contact::removePresenceSubscription | ( | const QString & | message = `QString()` | ) |

PendingOperation * Tp::Contact::authorizePresencePublication | ( | const QString & | message = `QString()` | ) |

PendingOperation * Tp::Contact::removePresencePublication | ( | const QString & | message = `QString()` | ) |

bool Tp::Contact::isBlocked | ( |  | ) | const

PendingOperation * Tp::Contact::block | ( | bool | value = `true` | ) |

QStringList Tp::Contact::groups | ( |  | ) | const

Return the names of the user-defined contact list groups to which the contact belongs.

This method requires Connection::FeatureRosterGroups to be enabled.

Returns:
  List of user-defined contact list groups names for a given contact.

See also:
  addToGroup(), removedFromGroup()

PendingOperation * Tp::Contact::addToGroup | ( | const QString & | group | ) |

Attempt to add the contact to the user-defined contact list group named group.

This method requires Connection::FeatureRosterGroups to be enabled.

Parameters:

  | group | Group name.

Returns:
  A pending operation which will return when an attempt has been made to add the contact to the user-defined contact list group.

PendingOperation * Tp::Contact::removeFromGroup | ( | const QString & | group | ) |

Attempt to remove the contact from the user-defined contact list group named group.

This method requires Connection::FeatureRosterGroups to be enabled.

Parameters:

  | group | Group name.

Returns:
  A pending operation which will return when an attempt has been made to remove the contact from the user-defined contact list group.

void Tp::Contact::aliasChanged | ( | const QString & | alias | ) | `[signal]`

void Tp::Contact::avatarTokenChanged | ( | const QString & | avatarToken | ) | `[signal]`

void Tp::Contact::avatarDataChanged | ( | const Tp::AvatarData & | avatarData | ) | `[signal]`

void Tp::Contact::simplePresenceChanged | ( | const QString & | status,
|  | uint | type,
|  | const QString & | presenceMessage |
| ) |  |  | `[signal]`

Deprecated:
  Use presenceChanged instead.

void Tp::Contact::presenceChanged | ( | const Tp::Presence & | presence | ) | `[signal]`

This signal is emitted when the value of presence() of this contact changes.

Parameters:

  | presence | The new presence.

See also:
  presence()

void Tp::Contact::capabilitiesChanged | ( | Tp::ContactCapabilities * | caps | ) | `[signal]`

void Tp::Contact::locationUpdated | ( | Tp::ContactLocation * | location | ) | `[signal]`

void Tp::Contact::infoChanged | ( | const Tp::ContactInfoFieldList & | info | ) | `[signal]`

Deprecated:
  Use infoFieldsChanged() instead.

void Tp::Contact::infoFieldsChanged | ( | const Tp::Contact::InfoFields & | infoFields | ) | `[signal]`

This signal is emitted when the value of infoFields() of this contact changes.

Parameters:

  | InfoFields | The new info.

See also:
  infoFields()

void Tp::Contact::subscriptionStateChanged | ( | Tp::Contact::PresenceState | state | ) | `[signal]`

void Tp::Contact::publishStateChanged | ( | Tp::Contact::PresenceState | state | ) | `[signal]`

void Tp::Contact::blockStatusChanged | ( | bool | blocked | ) | `[signal]`

void Tp::Contact::addedToGroup | ( | const QString & | group | ) | `[signal]`

void Tp::Contact::removedFromGroup | ( | const QString & | group | ) | `[signal]`

void Tp::Contact::connectNotify | ( | const char * | signalName | ) | `[protected]`