/usr/include/KF5/KPeople/kpeople/persondata.h is in libkf5people-dev 5.28.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | /*
KPeople
Copyright (C) 2013 David Edmundson (davidedmundson@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PERSONDATA_H
#define PERSONDATA_H
#include <kpeople/kpeople_export.h>
#include <QObject>
#include <QPixmap>
#include "global.h"
namespace KPeople
{
class PersonDataPrivate;
class PersonData;
/**
* @brief 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.
*/
class KPEOPLE_EXPORT PersonData : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name NOTIFY dataChanged)
Q_PROPERTY(QPixmap photo READ photo NOTIFY dataChanged)
Q_PROPERTY(QString presenceIconName READ presenceIconName NOTIFY dataChanged)
public:
/** 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
*/
PersonData(const QString &id, QObject *parent = 0);
virtual ~PersonData();
/**
* Returns true if this PersonData is mapped to some existing contact
* @since 5.22
*/
bool isValid() const;
/** Returns the person's id */
QString personUri() const;
/**
* Returns a list of contact ids that identify the PersonData instance.
*/
QStringList contactUris() const;
/**
* @returns the name of the person
*/
QString name() const;
/**
* @returns an icon name that represents the IM status of the person
*/
QString presenceIconName() const;
/**
* @returns a pixmap with the photo of the person, or a default one if not available
*/
QPixmap photo() const;
/**
* @returns the property for a said @p key.
*/
QVariant contactCustomProperty(const QString &key) const;
/**
* Returns the contact's online presence.
*/
QString presence() const;
/**
* Returns the contact's preferred email address.
*/
QString email() const;
/**
* Returns a the url of the picture that represents the contact.
*/
QUrl pictureUrl() const;
/** Returns all groups the person is in. */
QStringList groups() const;
/** Returns all e-mail addresses from the person. */
QStringList allEmails() const;
// struct PhoneNumber {
// QString name;
// QString number;
// };
// QVector<PhoneNumber> phoneNumbers() const { createPhoneNumbers(customProperty("phoneNumbers")); };
Q_SIGNALS:
/**
* One of the contact sources has changed
*/
void dataChanged();
private Q_SLOTS:
void onContactChanged();
private:
Q_DISABLE_COPY(PersonData)
Q_DECLARE_PRIVATE(PersonData)
PersonDataPrivate *d_ptr;
};
}
#endif // PERSONDATA_H
|