KPeople

abstractcontact.h
1/*
2 SPDX-FileCopyrightText: 2014 Aleix Pol i Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KPEOPLE_ABSTRACT_CONTACT_H
8#define KPEOPLE_ABSTRACT_CONTACT_H
9
10#include <QSharedData>
11#include <QVariant>
12#include <kpeoplebackend/kpeoplebackend_export.h>
13
14namespace KPeople
15{
16/**
17 * @brief KPeople::AbstractContact is the class to provide the data from a given
18 * contact by the backends.
19 *
20 * To obtain it from a front-end application PersonData and PersonsModel
21 * should be used.
22 *
23 * @since 5.8
24 * @internal
25 */
26
27class KPEOPLEBACKEND_EXPORT AbstractContact : public QSharedData
28{
29public:
33 virtual ~AbstractContact();
34
35 // well-known properties
36 /** String property representing the display name of the contact */
37 static const QString NameProperty;
38
39 /** String property representing the preferred name of the contact */
40 static const QString EmailProperty;
41
42 /** String property representing the preferred phone number of the contact */
44
45 /** QVariantList property that lists all phone numbers the contact has */
47
48 /**
49 * String property representing the IM presence of the contact.
50 * @sa KPeople::iconNameForPresenceString()
51 */
53
54 /**
55 * QUrl or QPixmap property representing the contacts' avatar
56 */
58
59 /** QVariantList property that lists the groups the contacts belongs to */
60 static const QString GroupsProperty;
61
62 /** QVariantList property that lists the emails the contact has */
64
65 /** QByteArray with the raw vcard information */
66 static const QString VCardProperty;
67
68 /**
69 * Generic method to access a random contact property
70 *
71 * @returns the value for the @p key property.
72 */
73 virtual QVariant customProperty(const QString &key) const = 0;
74
75private:
76 Q_DISABLE_COPY(AbstractContact)
77};
78
79}
80
81Q_DECLARE_METATYPE(KPeople::AbstractContact::List)
82Q_DECLARE_METATYPE(KPeople::AbstractContact::Ptr)
83
84#endif
KPeople::AbstractContact is the class to provide the data from a given contact by the backends.
static const QString PhoneNumberProperty
String property representing the preferred phone number of the contact.
static const QString AllPhoneNumbersProperty
QVariantList property that lists all phone numbers the contact has.
static const QString NameProperty
String property representing the display name of the contact.
static const QString EmailProperty
String property representing the preferred name of the contact.
static const QString AllEmailsProperty
QVariantList property that lists the emails the contact has.
static const QString PresenceProperty
String property representing the IM presence of the contact.
static const QString GroupsProperty
QVariantList property that lists the groups the contacts belongs to.
static const QString VCardProperty
QByteArray with the raw vcard information.
static const QString PictureProperty
QUrl or QPixmap property representing the contacts' avatar.
virtual QVariant customProperty(const QString &key) const =0
Generic method to access a random contact property.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:45 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.