KPeople 5.109.0
Properties | Signals | Public Member Functions | List of all members
KPeople::PersonData

Allows to query the information about a given person. More...

#include <persondata.h>

Properties

bool isEditable
 
QString name
 
QPixmap photo
 
QString presenceIconName
 

Signals

void dataChanged ()
 One of the contact sources has changed.
 

Public Member Functions

 PersonData (const QString &id, QObject *parent=nullptr)
 Creates a Person object from a given ID.
 
QStringList allEmails () const
 Returns all e-mail addresses from the person.
 
QVariant contactCustomProperty (const QString &key) const
 
QStringList contactUris () const
 Returns a list of contact ids that identify the PersonData instance.
 
QString email () const
 Returns the contact's preferred email address.
 
QStringList groups () const
 Returns all groups the person is in.
 
bool isEditable () const
 
bool isValid () const
 Returns true if this PersonData is mapped to some existing contact.
 
QString name () const
 
QString personUri () const
 Returns the person's id.
 
QPixmap photo () const
 
QUrl pictureUrl () const
 Returns a the url of the picture that represents the contact.
 
QString presence () const
 Returns the contact's online presence.
 
QString presenceIconName () const
 
bool setContactCustomProperty (const QString &key, const QVariant &value)
 Sends a desired value for the contact according to the key.
 

Detailed Description

Allows to query the information about a given person.

PersonData exposes the information of a given person (in contrast to everyone available, which is done by PersonsModel). This class will provide comfortable interfaces so it can be easily adopted in any application.

Since
5.8

Property Documentation

◆ isEditable

bool KPeople::PersonData::isEditable
read
Returns
whether setContactCustomProperty can be called on this contact
Since
5.62

Constructor & Destructor Documentation

◆ PersonData()

KPeople::PersonData::PersonData ( const QString &  id,
QObject *  parent = nullptr 
)

Creates a Person object from a given ID.

The ID can be either a local application specific ID (such as akonadi://?item=15) or a kpeople ID in the form kpeople://15

Member Function Documentation

◆ allEmails()

QStringList KPeople::PersonData::allEmails ( ) const

Returns all e-mail addresses from the person.

◆ contactCustomProperty()

QVariant KPeople::PersonData::contactCustomProperty ( const QString &  key) const
Returns
the property for a said key.

◆ contactUris()

QStringList KPeople::PersonData::contactUris ( ) const

Returns a list of contact ids that identify the PersonData instance.

◆ dataChanged

void KPeople::PersonData::dataChanged ( )
signal

One of the contact sources has changed.

◆ email()

QString KPeople::PersonData::email ( ) const

Returns the contact's preferred email address.

◆ groups()

QStringList KPeople::PersonData::groups ( ) const

Returns all groups the person is in.

◆ isEditable()

bool KPeople::PersonData::isEditable ( ) const
Returns
whether the contact can be edited.
Since
5.62

◆ isValid()

bool KPeople::PersonData::isValid ( ) const

Returns true if this PersonData is mapped to some existing contact.

Since
5.22

◆ name()

QString KPeople::PersonData::name ( ) const
Returns
the name of the person

◆ personUri()

QString KPeople::PersonData::personUri ( ) const

Returns the person's id.

◆ photo()

QPixmap KPeople::PersonData::photo ( ) const
Returns
a pixmap with the photo of the person, or a default one if not available

◆ pictureUrl()

QUrl KPeople::PersonData::pictureUrl ( ) const

Returns a the url of the picture that represents the contact.

◆ presence()

QString KPeople::PersonData::presence ( ) const

Returns the contact's online presence.

◆ presenceIconName()

QString KPeople::PersonData::presenceIconName ( ) const
Returns
an icon name that represents the IM status of the person

◆ setContactCustomProperty()

bool KPeople::PersonData::setContactCustomProperty ( const QString &  key,
const QVariant &  value 
)

Sends a desired value for the contact according to the key.

It's not necessarily implemented. The back-end gets to decide whether a property can be set or not.

Returns
whether the property value was changed
Since
5.62