15#include "agerangetype.h"
18#include "braggingrights.h"
19#include "calendarurl.h"
20#include "clientdata.h"
21#include "coverphoto.h"
22#include "emailaddress.h"
24#include "externalid.h"
30#include "membership.h"
31#include "misckeyword.h"
34#include "occupation.h"
35#include "organization.h"
36#include "personlocale.h"
37#include "personmetadata.h"
38#include "phonenumber.h"
41#include "relationshipinterest.h"
42#include "relationshipstatus.h"
44#include "sipaddress.h"
48#include "userdefined.h"
54#include <KContacts/Addressee>
56namespace KGAPI2::People
61 explicit Private() =
default;
62 Private(
const Private &) =
default;
63 Private(Private &&) noexcept = delete;
64 Private &operator=(const Private &) = delete;
65 Private &operator=(Private &&) noexcept = delete;
68 bool operator==(const Private &other)
const
70 return nicknames == other.nicknames &&
71 emailAddresses == other.emailAddresses &&
72 clientData == other.clientData &&
73 braggingRights == other.braggingRights &&
74 relationshipStatuses == other.relationshipStatuses &&
75 birthdays == other.birthdays &&
76 relations == other.relations &&
77 locales == other.locales &&
78 locations == other.locations &&
79 externalIds == other.externalIds &&
80 ageRanges == other.ageRanges &&
81 taglines == other.taglines &&
82 userDefined == other.userDefined &&
83 biographies == other.biographies &&
84 sipAddresses == other.sipAddresses &&
85 memberships == other.memberships &&
86 skills == other.skills &&
87 residences == other.residences &&
88 names == other.names &&
89 calendarUrls == other.calendarUrls &&
90 coverPhotos == other.coverPhotos &&
91 addresses == other.addresses &&
93 phoneNumbers == other.phoneNumbers &&
94 imClients == other.imClients &&
95 events == other.events &&
96 photos == other.photos &&
97 occupations == other.occupations &&
98 miscKeywords == other.miscKeywords &&
99 relationshipInterests == other.relationshipInterests &&
100 resourceName == other.resourceName &&
101 interests == other.interests &&
102 organizations == other.organizations &&
103 urls == other.urls &&
104 genders == other.genders &&
105 fileAses == other.fileAses &&
106 ageRange == other.ageRange &&
107 metadata == other.metadata;
110 bool operator!=(
const Private &other)
const
112 return !(*
this == other);
115 KContacts::Addressee toKContactsAddressee()
117 KContacts::Addressee addressee;
119 setKContactAddresseeNameFields(addressee);
120 setKContactAddresseeNicknameFields(addressee);
121 setKContactAddresseeBirthdayFields(addressee);
122 setKContactAddresseeEmailFields(addressee);
123 setKContactAddresseePhoneFields(addressee);
124 setKContactAddresseeUrlFields(addressee);
125 setKContactAddresseeOrganizationFields(addressee);
126 setKContactAddresseeProfessionFields(addressee);
127 setKContactAddresseePhoto(addressee);
132 void setFromKContactsAddressee(
const KContacts::Addressee &addressee)
139 names = {Name::fromKContactsAddressee(addressee)};
142 const auto addresseeNickName = addressee.
nickName();
143 if (!addresseeNickName.isEmpty()) {
145 nickname.setValue(addresseeNickName);
146 nicknames = {nickname};
149 const auto addresseeBirthday = addressee.
birthday();
150 if (addresseeBirthday.isValid()) {
152 birthday.setDate(addresseeBirthday.date());
153 birthdays = {birthday};
156 const auto addresseeEmailList = addressee.emailList();
157 if (!addresseeEmailList.isEmpty()) {
158 emailAddresses = EmailAddress::fromKContactsEmailList(addresseeEmailList);
161 const auto addresseePhoneNumbers = addressee.
phoneNumbers();
162 if (!addresseePhoneNumbers.isEmpty()) {
163 phoneNumbers = PhoneNumber::fromKContactsPhoneNumberList(addressee.
phoneNumbers());
166 const auto addresseeProfession = addressee.
profession();
167 if (!addresseeProfession.isEmpty()) {
168 Occupation occupation;
169 occupation.setValue(addresseeProfession);
170 occupations = {occupation};
173 const auto addresseeOrganization = addressee.
organization();
174 const auto addresseeDepartment = addressee.
department();
175 if (!addresseeOrganization.isEmpty() || !addresseeDepartment.isEmpty()) {
177 organization.setName(addresseeOrganization);
178 organization.setDepartment(addresseeDepartment);
179 organizations = {organization};
182 const auto addresseePhoto = addressee.
photo();
183 if (!addresseePhoto.isEmpty()) {
185 photo.setUrl(addressee.
photo().
url());
189 const auto blogFeed = addressee.
blogFeed();
190 if (!blogFeed.isEmpty()) {
192 url.setValue(blogFeed.toString());
193 url.setType(QStringLiteral(
"blog"));
197 const auto addresseeUrls = addressee.extraUrlList();
198 for (
const auto &addresseeUrl : addresseeUrls) {
200 url.setValue(addresseeUrl.toString());
202 switch (addresseeUrl.type()) {
204 url.setType(QStringLiteral(
"home"));
207 url.setType(QStringLiteral(
"profile"));
210 url.setType(QStringLiteral(
"work"));
213 url.setType(QStringLiteral(
"ftp"));
216 url.setType(QStringLiteral(
"appInstallPage"));
219 url.setType(QStringLiteral(
"reservations"));
222 url.setType(QStringLiteral(
"other"));
228 const auto addressessCalendarUrls = addressee.calendarUrlList();
229 for (
const auto &calendarUrl : addressessCalendarUrls) {
230 CalendarUrl gCalendarUrl;
232 gCalendarUrl.setType(QStringLiteral(
"freeBusy"));
234 gCalendarUrl.setType(QStringLiteral(
"CALUri"));
236 gCalendarUrl.setType(QStringLiteral(
"CALADRUri"));
238 gCalendarUrl.setType(QStringLiteral(
"other"));
240 gCalendarUrl.setUrl(calendarUrl.url().toString());
241 calendarUrls.append(gCalendarUrl);
245 QList<Nickname> nicknames{};
246 QList<EmailAddress> emailAddresses{};
247 QList<ClientData> clientData{};
248 QList<BraggingRights> braggingRights{};
249 QList<RelationshipStatus> relationshipStatuses{};
250 QList<Birthday> birthdays{};
251 QList<Relation> relations{};
252 QList<PersonLocale> locales{};
253 QList<Location> locations{};
254 QList<ExternalId> externalIds{};
255 QList<AgeRangeType> ageRanges{};
256 QList<Tagline> taglines{};
257 QList<UserDefined> userDefined{};
258 QList<Biography> biographies{};
259 QList<SipAddress> sipAddresses{};
260 QList<Membership> memberships{};
261 QList<Skill> skills{};
262 QList<Residence> residences{};
264 QList<CalendarUrl> calendarUrls{};
265 QList<CoverPhoto> coverPhotos{};
266 QList<Address> addresses{};
268 QList<PhoneNumber> phoneNumbers{};
269 QList<ImClient> imClients{};
270 QList<Event> events{};
271 QList<Photo> photos{};
272 QList<Occupation> occupations{};
273 QList<MiscKeyword> miscKeywords{};
274 QList<RelationshipInterest> relationshipInterests{};
275 QString resourceName{};
276 QList<Interest> interests{};
277 QList<Organization> organizations{};
279 QList<Gender> genders{};
280 QList<FileAs> fileAses{};
282 PersonMetadata metadata{};
285 void setKContactAddresseeNameFields(KContacts::Addressee &addressee)
287 if (names.isEmpty()) {
291 const auto nameToUse = names.first();
292 nameToUse.applyToKContactsAddressee(addressee);
295 void setKContactAddresseeNicknameFields(KContacts::Addressee &addressee)
297 if(nicknames.isEmpty()) {
302 const auto nicknameToUse = nicknames.first();
306 void setKContactAddresseeBirthdayFields(KContacts::Addressee &addressee)
308 if(birthdays.isEmpty()) {
313 const auto birthdayToUse = birthdays.first();
317 void setKContactAddresseeEmailFields(KContacts::Addressee &addressee)
319 KContacts::Email::List convertedEmails;
321 std::transform(emailAddresses.cbegin(),
322 emailAddresses.cend(),
323 std::back_inserter(convertedEmails),
324 [](
const EmailAddress &emailAddress) {
325 return emailAddress.toKContactsEmail();
328 addressee.setEmailList(convertedEmails);
331 void setKContactAddresseePhoneFields(KContacts::Addressee &addressee)
335 std::transform(phoneNumbers.cbegin(),
337 std::back_inserter(convertedPhoneNumbers),
338 [](
const People::PhoneNumber &phoneNumber) {
339 return phoneNumber.toKContactsPhoneNumber();
342 addressee.setPhoneNumbers(convertedPhoneNumbers);
345 void setKContactAddresseeOrganizationFields(KContacts::Addressee &addressee)
347 if (organizations.isEmpty()) {
353 const auto organizationToUse = organizations.first();
358 void setKContactAddresseeProfessionFields(KContacts::Addressee &addressee)
360 if (occupations.isEmpty()) {
365 const auto occupationToUse = occupations.first();
369 void setKContactAddresseePhoto(KContacts::Addressee &addressee)
371 if (photos.isEmpty()) {
376 const auto photoToUse = photos.first();
377 KContacts::Picture picture(photoToUse.url());
381 void setKContactAddresseeUrlFields(KContacts::Addressee &addressee)
383 if (urls.isEmpty()) {
386 addressee.setExtraUrlList({});
388 for (
const auto &url : std::as_const(urls)) {
389 if (url.type() == QLatin1StringView(
"blog")) {
394 if (url.type() == QLatin1StringView(
"home") || url.type() == QLatin1StringView(
"homePage")) {
396 }
else if (url.type() == QLatin1StringView(
"profile")) {
398 }
else if (url.type() == QLatin1StringView(
"work")) {
400 }
else if (url.type() == QLatin1StringView(
"ftp")) {
402 }
else if (url.type() == QLatin1StringView(
"appInstallPage")) {
404 }
else if (url.type() == QLatin1StringView(
"reservations")) {
410 KContacts::ResourceLocatorUrl resourceUrl;
411 resourceUrl.setUrl(QUrl(url.value()));
413 addressee.insertExtraUrl(resourceUrl);
419 for (
const auto &calendarUrl : std::as_const(calendarUrls)) {
420 KContacts::CalendarUrl kCalendarUrl;
421 if (calendarUrl.type() == QLatin1StringView(
"freeBusy")) {
423 }
else if (calendarUrl.type() == QLatin1StringView(
"CALUri")) {
425 }
else if (calendarUrl.type() == QLatin1StringView(
"CALADRUri")) {
430 kCalendarUrl.setUrl(QUrl(calendarUrl.url()));
431 addressee.insertCalendarUrl(kCalendarUrl);
451 d->nicknames = value;
461 d->nicknames.removeOne(value);
466 d->nicknames.clear();
471 return d->emailAddresses;
476 d->emailAddresses = value;
486 d->emailAddresses.removeOne(value);
491 d->emailAddresses.clear();
496 return d->clientData;
501 d->clientData = value;
511 d->clientData.removeOne(value);
516 d->clientData.clear();
521 return d->braggingRights;
526 d->braggingRights = value;
536 d->braggingRights.removeOne(value);
541 d->braggingRights.clear();
546 return d->relationshipStatuses;
555 d->birthdays = value;
565 d->birthdays.removeOne(value);
570 d->birthdays.clear();
580 d->relations = value;
590 d->relations.removeOne(value);
595 d->relations.clear();
615 d->locales.removeOne(value);
630 d->locations = value;
640 d->locations.removeOne(value);
645 d->locations.clear();
650 return d->externalIds;
655 d->externalIds = value;
665 d->externalIds.removeOne(value);
670 d->externalIds.clear();
683 return d->userDefined;
688 d->userDefined = value;
698 d->userDefined.removeOne(value);
703 d->userDefined.clear();
708 return d->biographies;
713 d->biographies = value;
723 d->biographies.removeOne(value);
728 d->biographies.clear();
733 return d->sipAddresses;
738 d->sipAddresses = value;
748 d->sipAddresses.removeOne(value);
753 d->sipAddresses.clear();
758 return d->memberships;
763 d->memberships = value;
773 d->memberships.removeOne(value);
778 d->memberships.clear();
798 d->skills.removeOne(value);
808 return d->residences;
813 d->residences = value;
823 d->residences.removeOne(value);
828 d->residences.clear();
848 d->names.removeOne(value);
858 return d->calendarUrls;
863 d->calendarUrls = value;
873 d->calendarUrls.removeOne(value);
878 d->calendarUrls.clear();
883 return d->coverPhotos;
892 d->addresses = value;
902 d->addresses.removeOne(value);
907 d->addresses.clear();
921 return d->phoneNumbers;
926 d->phoneNumbers = value;
936 d->phoneNumbers.removeOne(value);
941 d->phoneNumbers.clear();
951 d->imClients = value;
961 d->imClients.removeOne(value);
966 d->imClients.clear();
986 d->events.removeOne(value);
1000 return d->occupations;
1005 d->occupations = value;
1015 d->occupations.removeOne(value);
1020 d->occupations.clear();
1025 return d->miscKeywords;
1030 d->miscKeywords = value;
1040 d->miscKeywords.removeOne(value);
1045 d->miscKeywords.clear();
1050 return d->relationshipInterests;
1054 return d->resourceName;
1059 d->resourceName = value;
1063 return d->interests;
1068 d->interests = value;
1078 d->interests.removeOne(value);
1083 d->interests.clear();
1088 return d->organizations;
1093 d->organizations = value;
1103 d->organizations.removeOne(value);
1108 d->organizations.clear();
1128 d->urls.removeOne(value);
1153 d->genders.removeOne(value);
1168 d->fileAses = value;
1178 d->fileAses.removeOne(value);
1183 d->fileAses.clear();
1197 auto person =
new Person;
1200 person->d->resourceName = obj.
value(QStringLiteral(
"resourceName")).
toString();
1201 person->d->etag = obj.
value(QStringLiteral(
"etag")).
toString();
1204 person->d->metadata = PersonMetadata::fromJSON(
metadata);
1207 person->d->addresses = Address::fromJSONArray(
addresses);
1210 person->d->ageRanges = AgeRangeType::fromJSONArray(
ageRanges);
1213 person->d->biographies = Biography::fromJSONArray(
biographies);
1216 person->d->birthdays = Birthday::fromJSONArray(
birthdays);
1221 person->d->calendarUrls = CalendarUrl::fromJSONArray(
calendarUrls);
1224 person->d->clientData = ClientData::fromJSONArray(
clientData);
1227 person->d->coverPhotos = CoverPhoto::fromJSONArray(
coverPhotos);
1230 person->d->emailAddresses = EmailAddress::fromJSONArray(
emailAddresses);
1233 person->d->events = Event::fromJSONArray(
events);
1236 person->d->externalIds = ExternalId::fromJSONArray(
externalIds);
1239 person->d->fileAses = FileAs::fromJSONArray(
fileAses);
1242 person->d->genders = Gender::fromJSONArray(
genders);
1245 person->d->imClients = ImClient::fromJSONArray(
imClients);
1248 person->d->interests = Interest::fromJSONArray(
interests);
1251 person->d->locales = PersonLocale::fromJSONArray(
locales);
1254 person->d->locations = Location::fromJSONArray(
locations);
1257 person->d->memberships = Membership::fromJSONArray(
memberships);
1260 person->d->miscKeywords = MiscKeyword::fromJSONArray(
miscKeywords);
1263 person->d->names = Name::fromJSONArray(
names);
1266 person->d->nicknames = Nickname::fromJSONArray(
nicknames);
1269 person->d->occupations = Occupation::fromJSONArray(
occupations);
1272 person->d->organizations = Organization::fromJSONArray(
organizations);
1275 person->d->phoneNumbers = PhoneNumber::fromJSONArray(
phoneNumbers);
1278 person->d->photos = Photo::fromJSONArray(
photos);
1281 person->d->relations = Relation::fromJSONArray(
relations);
1288 person->d->sipAddresses = SipAddress::fromJSONArray(
sipAddresses);
1291 person->d->skills = Skill::fromJSONArray(
skills);
1296 person->d->urls = Url::fromJSONArray(
urls);
1299 person->d->userDefined = UserDefined::fromJSONArray(
userDefined);
1302 return People::PersonPtr(person);
1308 returnObject.
insert(QStringLiteral(
"resourceName"), d->resourceName);
1309 returnObject.
insert(QStringLiteral(
"etag"), d->etag);
1311 returnObject.
insert(QStringLiteral(
"metadata"), d->metadata.toJSON());
1314 for (
const auto &address : std::as_const(d->addresses)) {
1315 addressesArray.
append(address.toJSON());
1317 if (!addressesArray.
isEmpty()) {
1318 returnObject.
insert(QStringLiteral(
"addresses"), addressesArray);
1331 QJsonArray biographiesArray;
1332 for (
const auto &biography : std::as_const(d->biographies)) {
1333 biographiesArray.
append(biography.toJSON());
1335 if (!biographiesArray.
isEmpty()) {
1336 returnObject.
insert(QStringLiteral(
"biographies"), biographiesArray);
1339 QJsonArray birthdaysArray;
1340 for (
const auto &birthday : std::as_const(d->birthdays)) {
1341 birthdaysArray.
append(birthday.toJSON());
1343 if (!birthdaysArray.
isEmpty()) {
1344 returnObject.
insert(QStringLiteral(
"birthdays"), birthdaysArray);
1347 QJsonArray calendarUrlsArray;
1348 for (
const auto &calendarUrl : std::as_const(d->calendarUrls)) {
1349 calendarUrlsArray.
append(calendarUrl.toJSON());
1351 if (!calendarUrlsArray.
isEmpty()) {
1352 returnObject.
insert(QStringLiteral(
"calendarUrls"), calendarUrlsArray);
1355 QJsonArray clientDataArray;
1356 for (
const auto &
clientData : std::as_const(d->clientData)) {
1359 if (!clientDataArray.
isEmpty()) {
1360 returnObject.
insert(QStringLiteral(
"clientData"), clientDataArray);
1373 QJsonArray emailAddressesArray;
1374 for (
const auto &emailAddress : std::as_const(d->emailAddresses)) {
1375 emailAddressesArray.
append(emailAddress.toJSON());
1377 if (!emailAddressesArray.
isEmpty()) {
1378 returnObject.
insert(QStringLiteral(
"emailAddresses"), emailAddressesArray);
1381 QJsonArray eventsArray;
1382 for (
const auto &event : std::as_const(d->events)) {
1386 returnObject.
insert(QStringLiteral(
"events"), eventsArray);
1389 QJsonArray externalIdsArray;
1390 for (
const auto &externalId : std::as_const(d->externalIds)) {
1391 externalIdsArray.
append(externalId.toJSON());
1393 if (!externalIdsArray.
isEmpty()) {
1394 returnObject.
insert(QStringLiteral(
"externalIds"), externalIdsArray);
1397 QJsonArray fileAsesArray;
1398 for (
const auto &fileAs : std::as_const(d->fileAses)) {
1399 fileAsesArray.
append(fileAs.toJSON());
1401 if (!fileAsesArray.
isEmpty()) {
1402 returnObject.
insert(QStringLiteral(
"fileAses"), fileAsesArray);
1405 QJsonArray gendersArray;
1406 for (
const auto &gender : std::as_const(d->genders)) {
1407 gendersArray.
append(gender.toJSON());
1409 if (!gendersArray.
isEmpty()) {
1410 returnObject.
insert(QStringLiteral(
"genders"), gendersArray);
1413 QJsonArray imClientsArray;
1414 for (
const auto &imClient : std::as_const(d->imClients)) {
1415 imClientsArray.
append(imClient.toJSON());
1417 if (!imClientsArray.
isEmpty()) {
1418 returnObject.
insert(QStringLiteral(
"imClients"), imClientsArray);
1421 QJsonArray interestsArray;
1422 for (
const auto &interest : std::as_const(d->interests)) {
1423 interestsArray.
append(interest.toJSON());
1425 if (!interestsArray.
isEmpty()) {
1426 returnObject.
insert(QStringLiteral(
"interests"), interestsArray);
1429 QJsonArray localesArray;
1430 for (
const auto &locale : std::as_const(d->locales)) {
1431 localesArray.
append(locale.toJSON());
1433 if (!localesArray.
isEmpty()) {
1434 returnObject.
insert(QStringLiteral(
"locales"), localesArray);
1437 QJsonArray locationsArray;
1438 for (
const auto &location : std::as_const(d->locations)) {
1441 if (!locationsArray.
isEmpty()) {
1442 returnObject.
insert(QStringLiteral(
"locations"), locationsArray);
1445 QJsonArray membershipsArray;
1446 for (
const auto &membership : std::as_const(d->memberships)) {
1447 membershipsArray.
append(membership.toJSON());
1449 if (!membershipsArray.
isEmpty()) {
1450 returnObject.
insert(QStringLiteral(
"memberships"), membershipsArray);
1453 QJsonArray miscKeywordsArray;
1454 for (
const auto &miscKeyword : std::as_const(d->miscKeywords)) {
1455 miscKeywordsArray.
append(miscKeyword.toJSON());
1457 if (!miscKeywordsArray.
isEmpty()) {
1458 returnObject.
insert(QStringLiteral(
"miscKeywords"), miscKeywordsArray);
1461 QJsonArray namesArray;
1462 for (
const auto &name : std::as_const(d->names)) {
1466 returnObject.
insert(QStringLiteral(
"names"), namesArray);
1469 QJsonArray nicknamesArray;
1470 for (
const auto &nickname : std::as_const(d->nicknames)) {
1471 nicknamesArray.
append(nickname.toJSON());
1473 if (!nicknamesArray.
isEmpty()) {
1474 returnObject.
insert(QStringLiteral(
"nicknames"), nicknamesArray);
1477 QJsonArray occupationsArray;
1478 for (
const auto &occupation : std::as_const(d->occupations)) {
1479 occupationsArray.
append(occupation.toJSON());
1481 if (!occupationsArray.
isEmpty()) {
1482 returnObject.
insert(QStringLiteral(
"occupations"), occupationsArray);
1485 QJsonArray organizationsArray;
1486 for (
const auto &organization : std::as_const(d->organizations)) {
1487 organizationsArray.
append(organization.toJSON());
1489 if (!organizationsArray.
isEmpty()) {
1490 returnObject.
insert(QStringLiteral(
"organizations"), organizationsArray);
1493 QJsonArray phoneNumbersArray;
1494 for (
const auto &phoneNumber : std::as_const(d->phoneNumbers)) {
1495 phoneNumbersArray.
append(phoneNumber.toJSON());
1497 if (!phoneNumbersArray.
isEmpty()) {
1498 returnObject.
insert(QStringLiteral(
"phoneNumbers"), phoneNumbersArray);
1511 QJsonArray relationsArray;
1512 for (
const auto &relation : std::as_const(d->relations)) {
1513 relationsArray.
append(relation.toJSON());
1515 if (!relationsArray.
isEmpty()) {
1516 returnObject.
insert(QStringLiteral(
"relations"), relationsArray);
1523 QJsonArray sipAddressesArray;
1524 for (
const auto &sipAddress : std::as_const(d->sipAddresses)) {
1525 sipAddressesArray.
append(sipAddress.toJSON());
1527 if (!sipAddressesArray.
isEmpty()) {
1528 returnObject.
insert(QStringLiteral(
"sipAddresses"), sipAddressesArray);
1531 QJsonArray skillsArray;
1532 for (
const auto &skill : std::as_const(d->skills)) {
1533 skillsArray.
append(skill.toJSON());
1536 returnObject.
insert(QStringLiteral(
"skills"), skillsArray);
1539 QJsonArray urlsArray;
1540 for (
const auto &url : std::as_const(d->urls)) {
1541 urlsArray.
append(url.toJSON());
1544 returnObject.
insert(QStringLiteral(
"urls"), urlsArray);
1547 QJsonArray userDefinedArray;
1548 for (
const auto &
userDefined : std::as_const(d->userDefined)) {
1551 if (!userDefinedArray.
isEmpty()) {
1552 returnObject.
insert(QStringLiteral(
"userDefined"), userDefinedArray);
1555 return returnObject;
1558KContacts::Addressee Person::toKContactsAddressee()
const
1560 return d->toKContactsAddressee();
1563PersonPtr Person::fromKContactsAddressee(
const KContacts::Addressee &addressee)
1565 auto person =
new Person;
1566 person->d->setFromKContactsAddressee(addressee);
1567 return PersonPtr(person);
1570bool Person::operator==(
const Person &other)
const
1572 if (!Object::operator==(other)) {
1576 if (d->resourceName != other.d->resourceName) {
1577 qCDebug(KGAPIDebug) <<
"Resource name does not match"
1579 << other.d->resourceName;
1582 if (d->etag != other.d->etag) {
1583 qCDebug(KGAPIDebug) <<
"Etag does not match"
1588 if (d->metadata != other.d->metadata) {
1589 qCDebug(KGAPIDebug) <<
"Metadata does not match"
1590 << d->metadata.deleted() << other.d->metadata.deleted()
1591 << d->metadata.linkedPeopleResourceNames() << other.d->metadata.linkedPeopleResourceNames()
1592 << d->metadata.previousResourceNames() << other.d->metadata.previousResourceNames();
1596 return *d.get() == *d.get();
A person's physical address.
A person's short biography.
DEPRECATED: No data will be returned A person's bragging rights.
Arbitrary client data that is populated by clients.
A person's email address.
An event related to the person.
An identifier from an external entity related to the person.
The name that should be used to sort the person in a list.
A person's instant messaging client.
One of the person's interests.
A person's membership in a group.
A person's miscellaneous keyword.
A person's past or current organization.
A person's locale preference.
Information about a person merged from various data sources such as the authenticated user's contacts...
QList< Relation > relations() const
The person's relations.
Person()
Construcuts a new Person.
QList< Location > locations() const
The person's locations.
void removeBirthday(const Birthday &value)
Removes the given value from the list of birthdays if it exists.
void addExternalId(const ExternalId &value)
Appends the given value to the list of externalIds.
void addEvent(const Event &value)
Appends the given value to the list of events.
QList< Occupation > occupations() const
The person's occupations.
void addFileAs(const FileAs &value)
Appends the given value to the list of fileAses.
void clearEvents()
Clears the list of events.
void addUrl(const Url &value)
Appends the given value to the list of urls.
void addMembership(const Membership &value)
Appends the given value to the list of memberships.
void clearMemberships()
Clears the list of memberships.
void addLocation(const Location &value)
Appends the given value to the list of locations.
QList< Gender > genders() const
The person's genders.
void addClientData(const ClientData &value)
Appends the given value to the list of clientData.
void setEtag(const QString &value)
Sets value of the etag property.
QList< SipAddress > sipAddresses() const
The person's SIP addresses.
QString etag() const
The HTTP entity tag of the resource.
QList< PhoneNumber > phoneNumbers() const
The person's phone numbers.
void clearNames()
Clears the list of names.
void setBirthdays(const QList< Birthday > &value)
Sets value of the birthdays property.
void clearOccupations()
Clears the list of occupations.
void clearResidences()
Clears the list of residences.
void removeMembership(const Membership &value)
Removes the given value from the list of memberships if it exists.
void setLocales(const QList< PersonLocale > &value)
Sets value of the locales property.
void addEmailAddress(const EmailAddress &value)
Appends the given value to the list of emailAddresses.
void removeOrganization(const Organization &value)
Removes the given value from the list of organizations if it exists.
Person::AgeRange ageRange() const
Output only.
void clearRelations()
Clears the list of relations.
void removeNickname(const Nickname &value)
Removes the given value from the list of nicknames if it exists.
void setImClients(const QList< ImClient > &value)
Sets value of the imClients property.
void setMemberships(const QList< Membership > &value)
Sets value of the memberships property.
void setOrganizations(const QList< Organization > &value)
Sets value of the organizations property.
QList< Name > names() const
The person's names.
void setBraggingRights(const QList< BraggingRights > &value)
Sets value of the braggingRights property.
QList< CalendarUrl > calendarUrls() const
The person's calendar URLs.
void setEvents(const QList< Event > &value)
Sets value of the events property.
PersonMetadata metadata() const
Output only.
void setClientData(const QList< ClientData > &value)
Sets value of the clientData property.
void removeMiscKeyword(const MiscKeyword &value)
Removes the given value from the list of miscKeywords if it exists.
void setGenders(const QList< Gender > &value)
Sets value of the genders property.
void clearFileAses()
Clears the list of fileAses.
void clearImClients()
Clears the list of imClients.
void removeLocation(const Location &value)
Removes the given value from the list of locations if it exists.
void addBirthday(const Birthday &value)
Appends the given value to the list of birthdays.
void removeEmailAddress(const EmailAddress &value)
Removes the given value from the list of emailAddresses if it exists.
QList< Membership > memberships() const
The person's group memberships.
void addPersonLocale(const PersonLocale &value)
Appends the given value to the list of locales.
void removeResidence(const Residence &value)
Removes the given value from the list of residences if it exists.
void removeEvent(const Event &value)
Removes the given value from the list of events if it exists.
void setSipAddresses(const QList< SipAddress > &value)
Sets value of the sipAddresses property.
QList< Skill > skills() const
The person's skills.
QList< Biography > biographies() const
The person's biographies.
void clearUserDefined()
Clears the list of userDefined.
void setRelations(const QList< Relation > &value)
Sets value of the relations property.
void removeBraggingRights(const BraggingRights &value)
Removes the given value from the list of braggingRights if it exists.
void removeSkill(const Skill &value)
Removes the given value from the list of skills if it exists.
void removeImClient(const ImClient &value)
Removes the given value from the list of imClients if it exists.
void setMiscKeywords(const QList< MiscKeyword > &value)
Sets value of the miscKeywords property.
QList< Nickname > nicknames() const
The person's nicknames.
void removeInterest(const Interest &value)
Removes the given value from the list of interests if it exists.
void clearNicknames()
Clears the list of nicknames.
void setEmailAddresses(const QList< EmailAddress > &value)
Sets value of the emailAddresses property.
QList< ImClient > imClients() const
The person's instant messaging clients.
void addCalendarUrl(const CalendarUrl &value)
Appends the given value to the list of calendarUrls.
void setNames(const QList< Name > &value)
Sets value of the names property.
void setExternalIds(const QList< ExternalId > &value)
Sets value of the externalIds property.
void setOccupations(const QList< Occupation > &value)
Sets value of the occupations property.
QList< Photo > photos() const
Output only.
QList< RelationshipInterest > relationshipInterests() const
Output only.
void setResidences(const QList< Residence > &value)
Sets value of the residences property.
void removeOccupation(const Occupation &value)
Removes the given value from the list of occupations if it exists.
void removeName(const Name &value)
Removes the given value from the list of names if it exists.
void setResourceName(const QString &value)
Sets value of the resourceName property.
void addGender(const Gender &value)
Appends the given value to the list of genders.
void addBiography(const Biography &value)
Appends the given value to the list of biographies.
void clearOrganizations()
Clears the list of organizations.
void clearBiographies()
Clears the list of biographies.
void clearSipAddresses()
Clears the list of sipAddresses.
void setUrls(const QList< Url > &value)
Sets value of the urls property.
void clearLocations()
Clears the list of locations.
void removePhoneNumber(const PhoneNumber &value)
Removes the given value from the list of phoneNumbers if it exists.
QList< UserDefined > userDefined() const
The person's user defined data.
void setUserDefined(const QList< UserDefined > &value)
Sets value of the userDefined property.
void removeUrl(const Url &value)
Removes the given value from the list of urls if it exists.
void addImClient(const ImClient &value)
Appends the given value to the list of imClients.
void clearInterests()
Clears the list of interests.
void clearMiscKeywords()
Clears the list of miscKeywords.
void setAddresses(const QList< Address > &value)
Sets value of the addresses property.
QList< BraggingRights > braggingRights() const
DEPRECATED: No data will be returned The person's bragging rights.
void setFileAses(const QList< FileAs > &value)
Sets value of the fileAses property.
void addRelation(const Relation &value)
Appends the given value to the list of relations.
QList< PersonLocale > locales() const
The person's locale preferences.
void addMiscKeyword(const MiscKeyword &value)
Appends the given value to the list of miscKeywords.
void clearCalendarUrls()
Clears the list of calendarUrls.
void removeGender(const Gender &value)
Removes the given value from the list of genders if it exists.
void setNicknames(const QList< Nickname > &value)
Sets value of the nicknames property.
QList< Residence > residences() const
DEPRECATED: (Please use person.locations instead) The person's residences.
QList< ExternalId > externalIds() const
The person's external IDs.
QList< AgeRangeType > ageRanges() const
Output only.
void clearExternalIds()
Clears the list of externalIds.
void setLocations(const QList< Location > &value)
Sets value of the locations property.
QString resourceName() const
The resource name for the person, assigned by the server.
QList< Url > urls() const
The person's associated URLs.
QList< Organization > organizations() const
The person's past or current organizations.
void clearBirthdays()
Clears the list of birthdays.
void setBiographies(const QList< Biography > &value)
Sets value of the biographies property.
void removePersonLocale(const PersonLocale &value)
Removes the given value from the list of locales if it exists.
void addAddress(const Address &value)
Appends the given value to the list of addresses.
void setSkills(const QList< Skill > &value)
Sets value of the skills property.
void clearEmailAddresses()
Clears the list of emailAddresses.
void clearUrls()
Clears the list of urls.
void addBraggingRights(const BraggingRights &value)
Appends the given value to the list of braggingRights.
void setPhoneNumbers(const QList< PhoneNumber > &value)
Sets value of the phoneNumbers property.
void addResidence(const Residence &value)
Appends the given value to the list of residences.
void setCalendarUrls(const QList< CalendarUrl > &value)
Sets value of the calendarUrls property.
void removeClientData(const ClientData &value)
Removes the given value from the list of clientData if it exists.
void addSipAddress(const SipAddress &value)
Appends the given value to the list of sipAddresses.
void clearLocales()
Clears the list of locales.
QList< Address > addresses() const
The person's street addresses.
void clearPhoneNumbers()
Clears the list of phoneNumbers.
void clearGenders()
Clears the list of genders.
QList< Birthday > birthdays() const
The person's birthdays.
void addOrganization(const Organization &value)
Appends the given value to the list of organizations.
void removeCalendarUrl(const CalendarUrl &value)
Removes the given value from the list of calendarUrls if it exists.
void clearBraggingRights()
Clears the list of braggingRights.
QList< CoverPhoto > coverPhotos() const
Output only.
void clearSkills()
Clears the list of skills.
void removeAddress(const Address &value)
Removes the given value from the list of addresses if it exists.
void clearAddresses()
Clears the list of addresses.
QList< Event > events() const
The person's events.
QList< FileAs > fileAses() const
The person's file-ases.
QList< EmailAddress > emailAddresses() const
The person's email addresses.
void removeRelation(const Relation &value)
Removes the given value from the list of relations if it exists.
void addUserDefined(const UserDefined &value)
Appends the given value to the list of userDefined.
void clearClientData()
Clears the list of clientData.
void removeExternalId(const ExternalId &value)
Removes the given value from the list of externalIds if it exists.
QList< ClientData > clientData() const
The person's client data.
QList< RelationshipStatus > relationshipStatuses() const
Output only.
void removeBiography(const Biography &value)
Removes the given value from the list of biographies if it exists.
void setInterests(const QList< Interest > &value)
Sets value of the interests property.
void addOccupation(const Occupation &value)
Appends the given value to the list of occupations.
void removeFileAs(const FileAs &value)
Removes the given value from the list of fileAses if it exists.
QList< Tagline > taglines() const
Output only.
QList< Interest > interests() const
The person's interests.
QList< MiscKeyword > miscKeywords() const
The person's miscellaneous keywords.
void removeSipAddress(const SipAddress &value)
Removes the given value from the list of sipAddresses if it exists.
void addNickname(const Nickname &value)
Appends the given value to the list of nicknames.
void addInterest(const Interest &value)
Appends the given value to the list of interests.
void removeUserDefined(const UserDefined &value)
Removes the given value from the list of userDefined if it exists.
void addName(const Name &value)
Appends the given value to the list of names.
void addPhoneNumber(const PhoneNumber &value)
Appends the given value to the list of phoneNumbers.
void addSkill(const Skill &value)
Appends the given value to the list of skills.
A person's relation to another person.
DEPRECATED: Please use person.locations instead.
A skill that the person has.
A person's associated URLs.
Arbitrary user data that is populated by the end users.
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
Type type(const QSqlDatabase &db)
A job to fetch a single map tile described by a StaticMapUrl.
QVariant location(const QVariant &res)
QString name(StandardAction id)
void append(const QJsonValue &value)
bool isEmpty() const const
iterator insert(QLatin1StringView key, const QJsonValue &value)
bool isEmpty() const const
QJsonValue value(QLatin1StringView key) const const
QJsonArray toArray() const const
QJsonObject toObject() const const
QString toString() const const
void push_back(parameter_type value)
bool isEmpty() const const