KPeople

abstractcontact.h
1 /*
2  SPDX-FileCopyrightText: 2014 Aleix Pol i Gonzalez <[email protected]>
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 
14 namespace 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 
27 class KPEOPLEBACKEND_EXPORT AbstractContact : public QSharedData
28 {
29 public:
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  */
52  static const QString PresenceProperty;
53 
54  /**
55  * QUrl or QPixmap property representing the contacts' avatar
56  */
57  static const QString PictureProperty;
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 */
63  static const QString AllEmailsProperty;
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 
75 private:
76  Q_DISABLE_COPY(AbstractContact)
77 };
78 
79 }
80 
81 Q_DECLARE_METATYPE(KPeople::AbstractContact::List)
82 Q_DECLARE_METATYPE(KPeople::AbstractContact::Ptr)
83 
84 #endif
static const QString PictureProperty
QUrl or QPixmap property representing the contacts&#39; avatar.
static const QString AllPhoneNumbersProperty
QVariantList property that lists all phone numbers the contact has.
static const QString AllEmailsProperty
QVariantList property that lists the emails the contact has.
KPeople::AbstractContact is the class to provide the data from a given contact by the backends...
static const QString NameProperty
String property representing the display name of the contact.
static const QString PhoneNumberProperty
String property representing the preferred phone number of the contact.
static const QString PresenceProperty
String property representing the IM presence of the contact.
static const QString VCardProperty
QByteArray with the raw vcard information.
static const QString EmailProperty
String property representing the preferred name of the contact.
static const QString GroupsProperty
QVariantList property that lists the groups the contacts belongs to.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jan 27 2022 22:42:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.