TelepathyQt4: Tp::Contact Class Reference

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

# Tp::Contact Class Reference

`#include <TelepathyQt4/contact.h>`

List of all members.

## Public Types

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

## Signals

- void aliasChanged (const QString &alias)
- void avatarTokenChanged (const QString &avatarToken)
- void simplePresenceChanged (const QString &status, uint type, const QString &presenceMessage)
- void capabilitiesChanged (Tp::ContactCapabilities *caps)
- void locationUpdated (Tp::ContactLocation *location)
- void infoChanged (const Tp::ContactInfoFieldList &info)
- 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
- QString presenceStatus () const
- uint presenceType () const
- QString presenceMessage () const
- ContactCapabilities * capabilities () const
- ContactLocation * location () const
- ContactInfoFieldList info () 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 ()

## Member Enumeration Documentation

enum Tp::Contact::Feature

Enumerator:

  FeatureAlias |
  FeatureAvatarToken |
  FeatureSimplePresence |
  FeatureCapabilities |
  FeatureLocation |
  FeatureInfo |
  _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

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

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

QString Tp::Contact::presenceMessage | ( |  | ) | 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.

Returns:
  An object representing the contact information.

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

Refresh information for the given contact.

Once the information is retrieved infoChanged() 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:
  infoChanged()

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::simplePresenceChanged | ( | const QString & | status,
|  | uint | type,
|  | const QString & | presenceMessage |
| ) |  |  | `[signal]`

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

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