Changeset View
Changeset View
Standalone View
Standalone View
src/persondata.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
45 | */ | 45 | */ | ||
46 | class KPEOPLE_EXPORT PersonData : public QObject | 46 | class KPEOPLE_EXPORT PersonData : public QObject | ||
47 | { | 47 | { | ||
48 | Q_OBJECT | 48 | Q_OBJECT | ||
49 | Q_PROPERTY(QString name READ name NOTIFY dataChanged) | 49 | Q_PROPERTY(QString name READ name NOTIFY dataChanged) | ||
50 | Q_PROPERTY(QPixmap photo READ photo NOTIFY dataChanged) | 50 | Q_PROPERTY(QPixmap photo READ photo NOTIFY dataChanged) | ||
51 | Q_PROPERTY(QString presenceIconName READ presenceIconName NOTIFY dataChanged) | 51 | Q_PROPERTY(QString presenceIconName READ presenceIconName NOTIFY dataChanged) | ||
52 | 52 | | |||
53 | /** | ||||
54 | * @returns whether setContactCustomProperty can be called on this contact | ||||
55 | * | ||||
56 | * @since 5.62 | ||||
57 | */ | ||||
58 | Q_PROPERTY(bool isEditable READ isEditable CONSTANT) | ||||
59 | | ||||
53 | public: | 60 | public: | ||
54 | /** Creates a Person object from a given ID. | 61 | /** Creates a Person object from a given ID. | ||
55 | * The ID can be either a local application specific ID (such as akonadi://?item=15) | 62 | * The ID can be either a local application specific ID (such as akonadi://?item=15) | ||
56 | * or a kpeople ID in the form kpeople://15 | 63 | * or a kpeople ID in the form kpeople://15 | ||
57 | */ | 64 | */ | ||
58 | PersonData(const QString &id, QObject *parent = nullptr); | 65 | PersonData(const QString &id, QObject *parent = nullptr); | ||
59 | 66 | | |||
60 | virtual ~PersonData(); | 67 | virtual ~PersonData(); | ||
Show All 27 Lines | |||||
88 | */ | 95 | */ | ||
89 | QPixmap photo() const; | 96 | QPixmap photo() const; | ||
90 | 97 | | |||
91 | /** | 98 | /** | ||
92 | * @returns the property for a said @p key. | 99 | * @returns the property for a said @p key. | ||
93 | */ | 100 | */ | ||
94 | Q_SCRIPTABLE QVariant contactCustomProperty(const QString &key) const; | 101 | Q_SCRIPTABLE QVariant contactCustomProperty(const QString &key) const; | ||
95 | 102 | | |||
96 | /** | 103 | /** | ||
bshah: Missing API docs | |||||
104 | * Sends a desired @p value for the contact according to the @p key. | ||||
105 | * It's not necessarily implemented. The back-end gets to decide whether a property | ||||
106 | * can be set or not. | ||||
107 | * | ||||
108 | * @returns whether the property value was changed | ||||
109 | * | ||||
110 | * @since 5.62 | ||||
111 | */ | ||||
112 | Q_SCRIPTABLE bool setContactCustomProperty(const QString &key, const QVariant &value); | ||||
113 | | ||||
114 | /** | ||||
97 | * Returns the contact's online presence. | 115 | * Returns the contact's online presence. | ||
98 | */ | 116 | */ | ||
99 | QString presence() const; | 117 | QString presence() const; | ||
100 | 118 | | |||
101 | /** | 119 | /** | ||
102 | * Returns the contact's preferred email address. | 120 | * Returns the contact's preferred email address. | ||
103 | */ | 121 | */ | ||
104 | QString email() const; | 122 | QString email() const; | ||
105 | 123 | | |||
106 | /** | 124 | /** | ||
107 | * Returns a the url of the picture that represents the contact. | 125 | * Returns a the url of the picture that represents the contact. | ||
108 | */ | 126 | */ | ||
109 | QUrl pictureUrl() const; | 127 | QUrl pictureUrl() const; | ||
110 | 128 | | |||
111 | /** Returns all groups the person is in. */ | 129 | /** Returns all groups the person is in. */ | ||
112 | QStringList groups() const; | 130 | QStringList groups() const; | ||
113 | 131 | | |||
114 | /** Returns all e-mail addresses from the person. */ | 132 | /** Returns all e-mail addresses from the person. */ | ||
115 | QStringList allEmails() const; | 133 | QStringList allEmails() const; | ||
116 | 134 | | |||
135 | /** | ||||
bshah: Missing API doc | |||||
136 | * @returns whether the contact can be edited. | ||||
137 | * | ||||
138 | * @since 5.62 | ||||
139 | */ | ||||
140 | bool isEditable() const; | ||||
141 | | ||||
117 | // struct PhoneNumber { | 142 | // struct PhoneNumber { | ||
118 | // QString name; | 143 | // QString name; | ||
119 | // QString number; | 144 | // QString number; | ||
120 | // }; | 145 | // }; | ||
121 | // QVector<PhoneNumber> phoneNumbers() const { createPhoneNumbers(customProperty("phoneNumbers")); }; | 146 | // QVector<PhoneNumber> phoneNumbers() const { createPhoneNumbers(customProperty("phoneNumbers")); }; | ||
122 | 147 | | |||
123 | Q_SIGNALS: | 148 | Q_SIGNALS: | ||
124 | /** | 149 | /** | ||
Show All 15 Lines |
Missing API docs