KContacts

addressee.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2001 Cornelius Schumacher <[email protected]>
4  SPDX-FileCopyrightText: 2013 Tobias Koenig <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KCONTACTS_ADDRESSEE_H
10 #define KCONTACTS_ADDRESSEE_H
11 
12 #include <QDateTime>
13 #include <QStringList>
14 #include <QSharedDataPointer>
15 #include <QUrl>
16 #include <QMap>
17 
18 #include "address.h"
19 #include "geo.h"
20 #include "key.h"
21 #include "email.h"
22 #include "lang.h"
23 #include "gender.h"
24 #include "phonenumber.h"
25 #include "picture.h"
26 #include "secrecy.h"
27 #include "sound.h"
28 #include "impp.h"
29 #include "timezone.h"
30 #include "calendarurl.h"
31 #include "related.h"
32 #include "addresseelist.h"
33 #include "resourcelocatorurl.h"
34 #include "fieldgroup.h"
35 #include "title.h"
36 #include "nickname.h"
37 #include "role.h"
38 #include "org.h"
39 #include "clientpidmap.h"
40 
41 namespace KContacts {
42 /**
43  @short address book entry
44 
45  This class represents an entry in the address book.
46 
47  The data of this class is implicitly shared. You can pass this class by value.
48 
49  If you need the name of a field for presenting it to the user you should use
50  the functions ending in Label(). They return a translated string which can be
51  used as label for the corresponding field.
52 
53  About the name fields:
54 
55  givenName() is the first name and familyName() the last name. In some
56  countries the family name comes first, that's the reason for the
57  naming. formattedName() is the full name with the correct formatting.
58  It is used as an override, when the correct formatting can't be generated
59  from the other name fields automatically.
60 
61  realName() returns a fully formatted name(). It uses formattedName, if set,
62  otherwise it constucts the name from the name fields. As fallback, if
63  nothing else is set it uses name().
64 
65  name() is the NAME type of RFC2426. It can be used as internal name for the
66  data enty, but shouldn't be used for displaying the data to the user.
67  */
68 class KCONTACTS_EXPORT Addressee
69 {
70  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Addressee &);
71  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Addressee &);
72 
73  Q_GADGET
74  Q_PROPERTY(bool isEmpty READ isEmpty)
75  Q_PROPERTY(QString uid READ uid WRITE setUid)
76  Q_PROPERTY(QString name READ name WRITE setName)
77  Q_PROPERTY(QString formattedName READ formattedName WRITE setFormattedName)
78  Q_PROPERTY(QString familyName READ familyName WRITE setFamilyName)
79  Q_PROPERTY(QString givenName READ givenName WRITE setGivenName)
80  Q_PROPERTY(QString additionalName READ additionalName WRITE setAdditionalName)
81  Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
82  Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
83  Q_PROPERTY(QString nickName READ nickName)
84  Q_PROPERTY(QDateTime birthday READ birthday) // ### can't set this due to withTime argument
85  Q_PROPERTY(bool birthdayHasTime READ birthdayHasTime)
86  Q_PROPERTY(QString mailer READ mailer WRITE setMailer)
87  Q_PROPERTY(KContacts::Geo geo READ geo WRITE setGeo)
88  Q_PROPERTY(QString title READ title)
89  Q_PROPERTY(QString role READ role)
90  Q_PROPERTY(QString organization READ organization)
91  Q_PROPERTY(QString department READ department WRITE setDepartment)
92  Q_PROPERTY(QString note READ note WRITE setNote)
93  Q_PROPERTY(QString productId READ productId WRITE setProductId)
94  Q_PROPERTY(QDateTime revision READ revision)
95  Q_PROPERTY(QString sortString READ sortString WRITE setSortString)
96  Q_PROPERTY(KContacts::ResourceLocatorUrl url READ url WRITE setUrl)
97  Q_PROPERTY(QString realName READ realName)
98  Q_PROPERTY(QString assembledName READ assembledName)
99  Q_PROPERTY(QString preferredEmail READ preferredEmail)
100  Q_PROPERTY(QStringList categories READ categories WRITE setCategories)
101  Q_PROPERTY(QStringList customs READ customs)
102  Q_PROPERTY(bool changed READ changed WRITE setChanged)
103  Q_PROPERTY(QDate anniversary READ anniversary WRITE setAnniversary)
104  Q_PROPERTY(QString assistantsName READ assistantsName WRITE setAssistantsName)
105  Q_PROPERTY(QUrl blogFeed READ blogFeed WRITE setBlogFeed)
106  Q_PROPERTY(QString managersName READ managersName WRITE setManagersName)
107  Q_PROPERTY(QString office READ office WRITE setOffice)
108  Q_PROPERTY(QString profession READ profession WRITE setProfession)
109  Q_PROPERTY(QString spousesName READ spousesName WRITE setSpousesName)
110 
111  // using variants for QML compatibility, can be changed to proper types once QML supports that
112  Q_PROPERTY(QVariantList emails READ emailsVariant)
113  Q_PROPERTY(QVariantList phoneNumbers READ phoneNumbersVariant)
114  Q_PROPERTY(QVariantList addresses READ addressesVariant)
115  Q_PROPERTY(QVariantList urls READ urlsVariant)
116  Q_PROPERTY(QVariantList impps READ imppsVariant)
117 
118  // ### the following properties are still missing:
119  // - logos, photos, sounds
120  // - keys
121  // - the list variants for nicks, titles, roles, orgs
122  // - timezone, secrecy, gender, kind, members, relationships, language
123  // - field groups, sourceUrls, calendarUrls
124 
125 public:
126  /**
127  A list of addressee objects
128  */
130  /**
131  A map from unique identifier to addressee.
132 
133  @see uid()
134  */
136 
137  /**
138  Construct an empty address book entry.
139  */
140  Addressee();
141 
142  /**
143  Destroys the address book entry.
144  */
145  ~Addressee();
146 
147  /**
148  Copy constructor.
149  */
150  Addressee(const Addressee &other);
151 
152  /**
153  Assignment operator.
154 
155  @return a reference to @c this
156  */
157  Addressee &operator=(const Addressee &other);
158 
159  /**
160  Equality operator.
161 
162  @return @c true if @c this and the given addressee are equal,
163  otherwise @c false
164  */
165  bool operator==(const Addressee &other) const;
166 
167  /**
168  Not-equal operator.
169 
170  @return @c true if @c this and the given addressee are not equal,
171  otherwise @c false
172  */
173  bool operator!=(const Addressee &other) const;
174 
175  /**
176  Return if the address book entry is empty.
177  */
178  bool isEmpty() const;
179 
180  /**
181  Set unique identifier.
182 
183  @param uid the KABC unique identifier
184  */
185  void setUid(const QString &uid);
186 
187  /**
188  Return unique identifier.
189  */
190  QString uid() const;
191 
192  /**
193  Return translated label for uid field.
194  */
195  static QString uidLabel();
196 
197  /**
198  Set name.
199  */
200  void setName(const QString &name);
201 
202  /**
203  Return name.
204  */
205  QString name() const;
206 
207  /**
208  Return translated label for name field.
209  */
210  static QString nameLabel();
211 
212  /**
213  Set formatted name.
214  */
215  void setFormattedName(const QString &formattedName);
216 
217  /**
218  Return formatted name.
219  */
220  QString formattedName() const;
221 
222  /**
223  Return translated label for formattedName field.
224  */
225  static QString formattedNameLabel();
226 
227  /**
228  Set family name.
229  */
230  void setFamilyName(const QString &familyName);
231 
232  /**
233  Return family name.
234  */
235  QString familyName() const;
236 
237  /**
238  Return translated label for familyName field.
239  */
240  static QString familyNameLabel();
241 
242  /**
243  Set given name.
244  */
245  void setGivenName(const QString &givenName);
246 
247  /**
248  Return given name.
249  */
250  QString givenName() const;
251 
252  /**
253  Return translated label for givenName field.
254  */
255  static QString givenNameLabel();
256 
257  /**
258  Set additional names.
259  */
260  void setAdditionalName(const QString &additionalName);
261 
262  /**
263  Return additional names.
264  */
265  QString additionalName() const;
266 
267  /**
268  Return translated label for additionalName field.
269  */
270  static QString additionalNameLabel();
271 
272  /**
273  Set honorific prefixes.
274  */
275  void setPrefix(const QString &prefix);
276 
277  /**
278  Return honorific prefixes.
279  */
280  QString prefix() const;
281 
282  /**
283  Return translated label for prefix field.
284  */
285  static QString prefixLabel();
286 
287  /**
288  Set honorific suffixes.
289  */
290  void setSuffix(const QString &suffix);
291 
292  /**
293  Return honorific suffixes.
294  */
295  QString suffix() const;
296 
297  /**
298  Return translated label for suffix field.
299  */
300  static QString suffixLabel();
301 
302  /**
303  Set nick name.
304  */
305  void setNickName(const QString &nickName);
306  void setNickName(const NickName &nickName);
307  void insertExtraNickName(const NickName &nickName);
308  void setExtraNickNameList(const NickName::List &nickNameList);
309  NickName::List extraNickNameList() const;
310 
311  /**
312  Return nick name.
313  */
314  QString nickName() const;
315 
316  /**
317  Return translated label for nickName field.
318  */
319  static QString nickNameLabel();
320 
321  /**
322  Set birthday (date and time). If withTime is false the time will be set
323  to midnight and birthdayHasTime() will return false afterwards.
324  @since 5.4
325  */
326  void setBirthday(const QDateTime &birthday, bool withTime = true);
327 
328  /**
329  Set birthday (date only). birthdayHasTime() will return false afterwards.
330  */
331  void setBirthday(const QDate &birthday);
332 
333  /**
334  Return birthday. (If a valid date has been set, birthday().time() will
335  always return a valid QTime!)
336  */
337  QDateTime birthday() const;
338 
339  /**
340  Returns true if birthday has been set with a time. Returns false otherwise.
341  */
342  bool birthdayHasTime() const;
343 
344  /**
345  Return translated label for birthday field.
346  */
347  static QString birthdayLabel();
348 
349  /**
350  Return translated label for homeAddressStreet field.
351  */
352  static QString homeAddressStreetLabel();
353 
354  /**
355  Return translated label for homeAddressPostOfficeBox field.
356  */
357  static QString homeAddressPostOfficeBoxLabel();
358 
359  /**
360  Return translated label for homeAddressLocality field.
361  */
362  static QString homeAddressLocalityLabel();
363 
364  /**
365  Return translated label for homeAddressRegion field.
366  */
367  static QString homeAddressRegionLabel();
368 
369  /**
370  Return translated label for homeAddressPostalCode field.
371  */
372  static QString homeAddressPostalCodeLabel();
373 
374  /**
375  Return translated label for homeAddressCountry field.
376  */
377  static QString homeAddressCountryLabel();
378 
379  /**
380  Return translated label for homeAddressLabel field.
381  */
382  static QString homeAddressLabelLabel();
383 
384  /**
385  Return translated label for businessAddressStreet field.
386  */
387  static QString businessAddressStreetLabel();
388 
389  /**
390  Return translated label for businessAddressPostOfficeBox field.
391  */
392  static QString businessAddressPostOfficeBoxLabel();
393 
394  /**
395  Return translated label for businessAddressLocality field.
396  */
397  static QString businessAddressLocalityLabel();
398 
399  /**
400  Return translated label for businessAddressRegion field.
401  */
402  static QString businessAddressRegionLabel();
403 
404  /**
405  Return translated label for businessAddressPostalCode field.
406  */
407  static QString businessAddressPostalCodeLabel();
408 
409  /**
410  Return translated label for businessAddressCountry field.
411  */
412  static QString businessAddressCountryLabel();
413 
414  /**
415  Return translated label for businessAddressLabel field.
416  */
417  static QString businessAddressLabelLabel();
418 
419  /**
420  Return translated label for homePhone field.
421  */
422  static QString homePhoneLabel();
423 
424  /**
425  Return translated label for businessPhone field.
426  */
427  static QString businessPhoneLabel();
428 
429  /**
430  Return translated label for mobilePhone field.
431  */
432  static QString mobilePhoneLabel();
433 
434  /**
435  Return translated label for homeFax field.
436  */
437  static QString homeFaxLabel();
438 
439  /**
440  Return translated label for businessFax field.
441  */
442  static QString businessFaxLabel();
443 
444  /**
445  Return translated label for carPhone field.
446  */
447  static QString carPhoneLabel();
448 
449  /**
450  Return translated label for isdn field.
451  */
452  static QString isdnLabel();
453 
454  /**
455  Return translated label for pager field.
456  */
457  static QString pagerLabel();
458 
459  /**
460  Return translated label for email field.
461  */
462  static QString emailLabel();
463 
464  /**
465  Set mail client.
466  */
467  void setMailer(const QString &mailer);
468 
469  /**
470  Return mail client.
471  */
472  QString mailer() const;
473 
474  /**
475  Return translated label for mailer field.
476  */
477  static QString mailerLabel();
478 
479  /**
480  Set time zone.
481  */
482  void setTimeZone(const TimeZone &timeZone);
483 
484  /**
485  Return time zone.
486  */
487  TimeZone timeZone() const;
488 
489  /**
490  Return translated label for timeZone field.
491  */
492  static QString timeZoneLabel();
493 
494  /**
495  Set geographic position.
496  */
497  void setGeo(const Geo &geo);
498 
499  /**
500  Return geographic position.
501  */
502  Geo geo() const;
503 
504  /**
505  Return translated label for geo field.
506  */
507  static QString geoLabel();
508 
509  /**
510  Set title.
511  */
512  //Remove in kf6
513  void setTitle(const QString &title);
514  void setTitle(const Title &title);
515  void insertExtraTitle(const Title &title);
516  void setExtraTitleList(const Title::List &urltitle);
517  Title::List extraTitleList() const;
518  /**
519  Return title.
520  */
521  QString title() const;
522 
523  /**
524  Return translated label for title field.
525  */
526  static QString titleLabel();
527 
528  /**
529  Set role.
530  */
531  void setRole(const QString &role);
532  void setRole(const Role &role);
533  void insertExtraRole(const Role &role);
534  void setExtraRoleList(const Role::List &roleList);
535  Role::List extraRoleList() const;
536 
537  /**
538  Return role.
539  */
540  QString role() const;
541 
542  /**
543  Return translated label for role field.
544  */
545  static QString roleLabel();
546 
547  /**
548  Set organization.
549  */
550  //Remove in kf6
551  void setOrganization(const QString &organization);
552  void setOrganization(const Org &organization);
553  void insertExtraOrganization(const Org &organization);
554  void setExtraOrganizationList(const Org::List &orgList);
555  Org::List extraOrganizationList() const;
556 
557  /**
558  Return organization.
559  */
560  QString organization() const;
561 
562  /**
563  Return translated label for organization field.
564  */
565  static QString organizationLabel();
566 
567  /**
568  Set department.
569  */
570  void setDepartment(const QString &department);
571 
572  /**
573  Return department.
574  */
575  QString department() const;
576 
577  /**
578  Return translated label for department field.
579  */
580  static QString departmentLabel();
581 
582  /**
583  Set note.
584  */
585  void setNote(const QString &note);
586 
587  /**
588  Return note.
589  */
590  QString note() const;
591 
592  /**
593  Return translated label for note field.
594  */
595  static QString noteLabel();
596 
597  /**
598  Set product identifier.
599  */
600  void setProductId(const QString &productId);
601 
602  /**
603  Return product identifier.
604  */
605  QString productId() const;
606 
607  /**
608  Return translated label for productId field.
609  */
610  static QString productIdLabel();
611 
612  /**
613  Set revision date.
614  */
615  void setRevision(const QDateTime &revision);
616 
617  /**
618  Return revision date.
619  */
620  QDateTime revision() const;
621 
622  /**
623  Return translated label for revision field.
624  */
625  static QString revisionLabel();
626 
627  /**
628  Set sort string.
629  */
630  void setSortString(const QString &sortString);
631 
632  /**
633  Return sort string.
634  */
635  QString sortString() const;
636 
637  /**
638  Return translated label for sortString field.
639  */
640  static QString sortStringLabel();
641 
642  /**
643  Set homepage.
644  */
645  void setUrl(const ResourceLocatorUrl &url);
646  //kf6: remove it
647  void setUrl(const QUrl &url);
648 
649  /**
650  Return homepage.
651  */
652  ResourceLocatorUrl url() const;
653 
654  /**
655  Return translated label for url field.
656  */
657  static QString urlLabel();
658 
659  /**
660  Set security class.
661  */
662  void setSecrecy(const Secrecy &secrecy);
663 
664  /**
665  Return security class.
666  */
667  Secrecy secrecy() const;
668 
669  /**
670  Return translated label for secrecy field.
671  */
672  static QString secrecyLabel();
673 
674  /**
675  Set logo.
676  */
677  void setLogo(const Picture &logo);
678 
679  /**
680  Return logo.
681  */
682  Picture logo() const;
683 
684  /**
685  Return translated label for logo field.
686  */
687  static QString logoLabel();
688 
689  /**
690  Set photo.
691  */
692  void setPhoto(const Picture &photo);
693 
694  /**
695  Return photo.
696  */
697  Picture photo() const;
698 
699  /**
700  Return translated label for photo field.
701  */
702  static QString photoLabel();
703 
704  /**
705  Set sound.
706  */
707  void setSound(const Sound &sound);
708 
709  /**
710  Return sound.
711  */
712  Sound sound() const;
713 
714  /**
715  Return translated label for sound field.
716  */
717  static QString soundLabel();
718 
719  /**
720  Set name fields by parsing the given string and trying to associate the
721  parts of the string with according fields. This function should probably
722  be a bit more clever.
723  */
724  void setNameFromString(const QString &s);
725 
726  /**
727  Return the name of the addressee. This is calculated from all the name
728  fields.
729  */
730  QString realName() const;
731 
732  /**
733  Return the name that consists of all name parts.
734  */
735  QString assembledName() const;
736 
737  /**
738  Return email address including real name.
739 
740  @param email Email address to be used to construct the full email string.
741  If this is QString() the preferred email address is used.
742  */
743  QString fullEmail(const QString &email = QString()) const;
744 
745  /**
746  Insert an email address. If the email address already exists in this
747  addressee it is not duplicated.
748 
749  @param email Email address
750  @param preferred Set to true, if this is the preferred email address of
751  the addressee.
752  */
753  void insertEmail(const QString &email, bool preferred = false, const QMap<QString, QStringList> &param = QMap<QString, QStringList>());
754 
755  /**
756  Remove email address. If the email address doesn't exist, nothing happens.
757 
758  @param email Email address to remove
759  */
760  void removeEmail(const QString &email);
761 
762  /**
763  Return preferred email address. This is the first email address or the
764  last one added with insertEmail() with a set preferred parameter.
765  */
766  QString preferredEmail() const;
767 
768  /**
769  Return list of all email addresses.
770  */
771  QStringList emails() const;
772 
773  /**
774  Set the emails to @p list.
775  The first email address gets the preferred one!
776  @param list The list of email addresses.
777  */
778  void setEmails(const QStringList &list);
779 
780  /**
781  Insert a phone number. If a phone number with the same id already exists
782  in this addressee it is not duplicated.
783 
784  @param phoneNumber The telephone number to insert to the addressee
785  */
786  void insertPhoneNumber(const PhoneNumber &phoneNumber);
787 
788  /**
789  Remove phone number. If no phone number with the given id exists for this
790  addresse nothing happens.
791 
792  @param phoneNumber The telephone number to remove from the addressee
793  */
794  void removePhoneNumber(const PhoneNumber &phoneNumber);
795 
796  /**
797  Return phone number, which matches the given type.
798 
799  @param type The type of phone number to get
800  */
801  PhoneNumber phoneNumber(PhoneNumber::Type type) const;
802 
803  /**
804  Return list of all phone numbers.
805  */
806  PhoneNumber::List phoneNumbers() const;
807 
808  void setPhoneNumbers(const PhoneNumber::List &phoneNumbers);
809 
810  /**
811  Return list of phone numbers with a special type.
812 
813  @param type The type of phone number to get
814  */
815  PhoneNumber::List phoneNumbers(PhoneNumber::Type type) const;
816 
817  /**
818  Return phone number with the given id.
819 
820  @param id The identifier of the phone number to look for.
821  See PhoneNumber::id()
822  */
823  PhoneNumber findPhoneNumber(const QString &id) const;
824 
825  /**
826  Insert a key. If a key with the same id already exists
827  in this addressee it is not duplicated.
828 
829  @param key The key to insert
830  */
831  void insertKey(const Key &key);
832 
833  /**
834  Remove a key. If no key with the given id exists for this
835  addresse nothing happens.
836 
837  @param key The key to remove
838  */
839  void removeKey(const Key &key);
840 
841  /**
842  Return key, which matches the given type.
843  If @p type == Key::Custom you can specify a string
844  that should match. If you leave the string empty, the first
845  key with a custom value is returned.
846 
847  @param type The type of key to look for
848  @param customTypeString A string to match custom keys against when
849  @p type is @c Key::Custom
850  */
851  Key key(Key::Type type, const QString &customTypeString = QString()) const;
852 
853  /**
854  Return list of all keys.
855  */
856  Key::List keys() const;
857 
858  /**
859  Set the list of keys
860  @param keys The keys to be set.
861  */
862  void setKeys(const Key::List &keys);
863 
864  /**
865  Return list of keys with a special type.
866  If @p type == Key::Custom you can specify a string
867  that should match. If you leave the string empty, all custom
868  keys will be returned.
869 
870  @param type The type of key to look for
871  @param customTypeString A string to match custom keys against when
872  @p type is @c Key::Custom
873  */
874  Key::List keys(Key::Type type, const QString &customTypeString = QString()) const;
875 
876  /**
877  Return key with the given id.
878 
879  @param id The identifier of the key to look for. See Key::id()
880  */
881  Key findKey(const QString &id) const;
882 
883  /**
884  Insert an address. If an address with the same id already exists
885  in this addressee it is not duplicated.
886 
887  @param address The address to insert
888  */
889  void insertAddress(const Address &address);
890 
891  /**
892  Remove address. If no address with the given id exists for this
893  addresse nothing happens.
894 
895  @param address The address to remove
896  */
897  void removeAddress(const Address &address);
898 
899  /**
900  Return address, which matches the given type.
901 
902  @param type The type of address to look for
903  */
904  Address address(Address::Type type) const;
905 
906  /**
907  Return list of all addresses.
908  */
909  Address::List addresses() const;
910 
911  /**
912  Return list of addresses with a special type.
913 
914  @param type The type of addresses to look for
915  */
916  Address::List addresses(Address::Type type) const;
917 
918  /**
919  Return address with the given id.
920 
921  @param id The identifier of the address to look for. See Address::id()
922  */
923  Address findAddress(const QString &id) const;
924 
925  /**
926  Insert category. If the category already exists it is not duplicated.
927  */
928  void insertCategory(const QString &category);
929 
930  /**
931  Remove category.
932  */
933  void removeCategory(const QString &category);
934 
935  /**
936  Return, if addressee has the given category.
937  */
938  bool hasCategory(const QString &category) const;
939 
940  /**
941  Set categories to given value.
942  */
943  void setCategories(const QStringList &category);
944 
945  /**
946  Return list of all set categories.
947  */
948  QStringList categories() const;
949 
950  /**
951  Insert custom entry. The entry is identified by the name of the inserting
952  application and a unique name. If an entry with the given app and name
953  already exists its value is replaced with the new given value.
954 
955  An empty value isn't allowed (nothing happens if this is called with
956  any of the three arguments being empty)
957 
958  @param app Name of the application inserting this custom entry
959  @param name Name of this application specific custom entry
960  @param value Value of this application specific custom entry
961  */
962  void insertCustom(const QString &app, const QString &name, const QString &value);
963 
964  /**
965  Remove custom entry.
966 
967  @param app Name of the application which has inserted this custom entry
968  @param name Name of this application specific custom entry
969  */
970  void removeCustom(const QString &app, const QString &name);
971 
972  /**
973  Return value of custom entry, identified by app and entry name.
974 
975  @param app Name of the application which has inserted this custom entry
976  @param name Name of this application specific custom entry
977  */
978  QString custom(const QString &app, const QString &name) const;
979 
980  /**
981  Set all custom entries.
982  */
983  void setCustoms(const QStringList &customs);
984 
985  /**
986  Return list of all custom entries.
987 
988  The format of the custom entries is 'app-key:value' and the list is sorted
989  alphabetically by 'app-key'.
990  */
991  QStringList customs() const;
992 
993  /**
994  Parse full email address. The result is given back in fullName and email.
995 
996  @param rawEmail The input string to parse for name and email
997  @param fullName The name part of the @p rawEmail input, if it contained one
998  @param email The email part of the @p rawEmail input, if it contained one
999  */
1000  static void parseEmailAddress(const QString &rawEmail, QString &fullName, QString &email);
1001 
1002  /**
1003  Returns string representation of the addressee.
1004  */
1005  QString toString() const;
1006 
1007  /**
1008  Mark addressee as changed.
1009 
1010  @param value Sets the status indicating changed data
1011  */
1012  void setChanged(bool value);
1013 
1014  /**
1015  Return whether the addressee is changed.
1016  */
1017  bool changed() const;
1018 
1019  /**
1020  Returns the MIME type used for Addressees
1021  */
1022  static QString mimeType();
1023 
1024  KContacts::Email::List emailList() const;
1025  void setEmailList(const Email::List &list);
1026 
1027  /**
1028  * Remove Language
1029  * @brief removeLang
1030  * @param language
1031  */
1032  void removeLang(const QString &language);
1033  /**
1034  * Insert Language
1035  * @brief insertLang
1036  * @param language
1037  */
1038  void insertLang(const Lang &language);
1039  /**
1040  * @brief langs
1041  * @return List of lang
1042  */
1043  Lang::List langs() const;
1044  void setLangs(const Lang::List &langs);
1045 
1046  void setGender(const Gender &gender);
1047  Gender gender() const;
1048 
1049  QString kind() const;
1050  void setKind(const QString &kind);
1051 
1052  void insertCalendarUrl(const CalendarUrl &calendarUrl);
1053  CalendarUrl::List calendarUrlList() const;
1054 
1055  void insertExtraSound(const Sound &sound);
1056  void setExtraSoundList(const Sound::List &soundList);
1057  Sound::List extraSoundList() const;
1058 
1059  void insertExtraPhoto(const Picture &picture);
1060  void setExtraPhotoList(const Picture::List &pictureList);
1061  Picture::List extraPhotoList() const;
1062 
1063  void insertExtraLogo(const Picture &logo);
1064  void setExtraLogoList(const Picture::List &logoList);
1065  Picture::List extraLogoList() const;
1066 
1067  ResourceLocatorUrl::List extraUrlList() const;
1068  void setExtraUrlList(const ResourceLocatorUrl::List &urlList);
1069  void insertExtraUrl(const ResourceLocatorUrl &url);
1070 
1071  //Member
1072  void insertMember(const QString &member);
1073  void setMembers(const QStringList &c);
1074  QStringList members() const;
1075 
1076  //Relation
1077  void insertRelationship(const Related &related);
1078  void setRelationships(const Related::List &c);
1079  Related::List relationships() const;
1080 
1081  //Source
1082  void insertSourceUrl(const QUrl &url);
1083  void setSourcesUrlList(const QVector<QUrl> &urlList);
1084  QVector<QUrl> sourcesUrlList() const;
1085 
1086  //Impp
1087  Impp::List imppList() const;
1088  void setImppList(const Impp::List &imppList);
1089  void insertImpp(const Impp &impp);
1090 
1091  //FieldGroup
1092  FieldGroup::List fieldGroupList() const;
1093  void setFieldGroupList(const FieldGroup::List &fieldGroupList);
1094  void insertFieldGroup(const FieldGroup &fieldGroup);
1095 
1096  //ClientPidMap
1097  ClientPidMap::List clientPidMapList() const;
1098  void setClientPidMapList(const ClientPidMap::List &clientpidmaplist);
1099  void insertClientPidMap(const ClientPidMap &clientpidmap);
1100 
1101  /**
1102  * Returns the contact's anniversary date.
1103  * @note This is a non-standard extension using the @c X-Anniversary field.
1104  * @since 5.12
1105  */
1106  QDate anniversary() const;
1107  /**
1108  * Sets the contact's anniversary date.
1109  * @note This is a non-standard extension using the @c X-Anniversary field.
1110  * @since 5.12
1111  */
1112  void setAnniversary(const QDate &anniversary);
1113 
1114  /**
1115  * Returns the contact's assistant's name.
1116  * @note This is a non-standard extension using the @c X-AssistantsName field.
1117  * @since 5.12
1118  */
1119  QString assistantsName() const;
1120  /**
1121  * Set the contact's assistant's name.
1122  * @note This is a non-standard extension using the @c X-AssistantsName field.
1123  * @since 5.12
1124  */
1125  void setAssistantsName(const QString &assistantsName);
1126 
1127  /**
1128  * Returns the contact's blog feed.
1129  * @note This is a non-standard extension using the @c BlogFeed field.
1130  * @since 5.12
1131  */
1132  QUrl blogFeed() const;
1133  /**
1134  * Set the contact's blog feed.
1135  * @note This is a non-standard extension using the @c BlogFeed field.
1136  * @since 5.12
1137  */
1138  void setBlogFeed(const QUrl &blogFeed);
1139 
1140  /**
1141  * Returns the contact's manager's name.
1142  * @note This is a non-standard extension using the @c X-ManagersName field.
1143  * @since 5.12
1144  */
1145  QString managersName() const;
1146  /**
1147  * Set the contact's manager's name.
1148  * @note This is a non-standard extension using the @c X-ManagersName field.
1149  * @since 5.12
1150  */
1151  void setManagersName(const QString &managersName);
1152 
1153  /**
1154  * Returns the contact's office.
1155  * @note This is a non-standard extension using the @c X-Office field.
1156  * @since 5.12
1157  */
1158  QString office() const;
1159  /**
1160  * Set the contact's office.
1161  * @note This is a non-standard extension using the @c X-Office field.
1162  * @since 5.12
1163  */
1164  void setOffice(const QString &office);
1165 
1166  /**
1167  * Returns the contact's profession.
1168  * @note This is a non-standard extension using the @c X-Profession field.
1169  * @since 5.12
1170  */
1171  QString profession() const;
1172  /**
1173  * Set the contact's profession.
1174  * @note This is a non-standard extension using the @c X-Profession field.
1175  * @since 5.12
1176  */
1177  void setProfession(const QString &profession);
1178 
1179  /**
1180  * Returns the contact's spouse's name.
1181  * @note This is a non-standard extension using the @c X-SpousesName field.
1182  * @since 5.12
1183  */
1184  QString spousesName() const;
1185  /**
1186  * Set the contact's spouse's name.
1187  * @note This is a non-standard extension using the @c X-SpousesName field.
1188  * @since 5.12
1189  */
1190  void setSpousesName(const QString &spousesName);
1191 
1192 private:
1193  QVariantList emailsVariant() const;
1194  QVariantList phoneNumbersVariant() const;
1195  QVariantList addressesVariant() const;
1196  QVariantList urlsVariant() const;
1197  QVariantList imppsVariant() const;
1198 
1199  class Private;
1201 };
1202 
1203 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Addressee &);
1204 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Addressee &);
1205 }
1206 
1207 #define KCONTACTS_ADDRESSEE_METATYPE_DEFINED 1
1208 Q_DECLARE_METATYPE(KContacts::Addressee)
1209 
1210 #endif
Class that holds a FieldGroup for a contact.
Definition: fieldgroup.h:21
Descripes a relationship of an Addressee.
Definition: related.h:18
Class that holds a Role for a contact.
Definition: role.h:20
Class that holds a Resource Locator.
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
Geographic position.
Definition: geo.h:23
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition: calendarurl.h:21
Class that holds a ClientPidMap for a contact.
Definition: clientpidmap.h:20
A class to store an encryption key.
Definition: key.h:20
Class that holds a IMPP for a contact.
Definition: impp.h:26
A class to store a picture of an addressee.
Definition: picture.h:26
Type
Key types.
Definition: key.h:34
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Class that holds a Sound clip for a contact.
Definition: sound.h:44
QHash< QString, Addressee > Map
A map from unique identifier to addressee.
Definition: addressee.h:135
AddresseeList List
A list of addressee objects.
Definition: addressee.h:129
Postal address information.
Definition: address.h:27
Class that holds a NickName for a contact.
Definition: nickname.h:20
Class that holds a Language for a contact.
Definition: lang.h:20
Descripes the confidentiality of an addressee.
Definition: secrecy.h:17
Class that holds a Gender for a contact.
Definition: gender.h:19
Class that holds a Title for a contact.
Definition: title.h:20
address book entry
Definition: addressee.h:68
Class that holds a Organization for a contact.
Definition: org.h:20
Time zone information.
Definition: timezone.h:21
Phonenumber information.
Definition: phonenumber.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Mar 7 2021 22:54:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.