KContacts

field.cpp
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2002 Cornelius Schumacher <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #include <KConfig>
9 #include <KLocalizedString>
10 
11 #include "field.h"
12 #include <KConfigGroup>
13 #include <KSharedConfig>
14 
15 using namespace KContacts;
16 
17 class Q_DECL_HIDDEN Field::Private
18 {
19 public:
20  Private(int fieldId, int category = 0, const QString &label = QString(), const QString &key = QString(), const QString &app = QString())
21  : mFieldId(fieldId)
22  , mCategory(category)
23  , mLabel(label)
24  , mKey(key)
25  , mApp(app)
26  {
27  }
28 
29  enum FieldId {
30  CustomField,
31  FormattedName,
32  FamilyName,
33  GivenName,
34  AdditionalName,
35  Prefix,
36  Suffix,
37  NickName,
38  Birthday,
39  HomeAddressStreet,
40  HomeAddressPostOfficeBox,
41  HomeAddressLocality,
42  HomeAddressRegion,
43  HomeAddressPostalCode,
44  HomeAddressCountry,
45  HomeAddressLabel,
46  BusinessAddressStreet,
47  BusinessAddressPostOfficeBox,
48  BusinessAddressLocality,
49  BusinessAddressRegion,
50  BusinessAddressPostalCode,
51  BusinessAddressCountry,
52  BusinessAddressLabel,
53  HomePhone,
54  BusinessPhone,
55  MobilePhone,
56  HomeFax,
57  BusinessFax,
58  CarPhone,
59  Isdn,
60  Pager,
61  Email,
62  Mailer,
63  Title,
64  Role,
66  Department,
67  Note,
68  Url,
69  };
70 
71  int fieldId() const
72  {
73  return mFieldId;
74  }
75 
76  int category() const
77  {
78  return mCategory;
79  }
80 
81  QString label() const
82  {
83  return mLabel;
84  }
85 
86  QString key() const
87  {
88  return mKey;
89  }
90 
91  QString app() const
92  {
93  return mApp;
94  }
95 
96  static Field::List mAllFields;
97  static Field::List mDefaultFields;
98  static Field::List mCustomFields;
99 
100 private:
101  int mFieldId;
102  int mCategory;
103 
104  QString mLabel;
105  QString mKey;
106  QString mApp;
107 };
108 
109 Field::List Field::Private::mAllFields;
110 Field::List Field::Private::mDefaultFields;
111 Field::List Field::Private::mCustomFields;
112 
113 Field::Field(Private *p)
114  : d(p)
115 {
116 }
117 
118 Field::~Field()
119 {
120  delete d;
121 }
122 
124 {
125  switch (d->fieldId()) {
126  case Private::FormattedName:
128  case Private::FamilyName:
130  case Private::GivenName:
131  return Addressee::givenNameLabel();
132  case Private::AdditionalName:
134  case Private::Prefix:
135  return Addressee::prefixLabel();
136  case Private::Suffix:
137  return Addressee::suffixLabel();
138  case Private::NickName:
139  return Addressee::nickNameLabel();
140  case Private::Birthday:
141  return Addressee::birthdayLabel();
142  case Private::HomeAddressStreet:
144  case Private::HomeAddressPostOfficeBox:
146  case Private::HomeAddressLocality:
148  case Private::HomeAddressRegion:
150  case Private::HomeAddressPostalCode:
152  case Private::HomeAddressCountry:
154  case Private::HomeAddressLabel:
156  case Private::BusinessAddressStreet:
158  case Private::BusinessAddressPostOfficeBox:
160  case Private::BusinessAddressLocality:
162  case Private::BusinessAddressRegion:
164  case Private::BusinessAddressPostalCode:
166  case Private::BusinessAddressCountry:
168  case Private::BusinessAddressLabel:
170  case Private::HomePhone:
171  return Addressee::homePhoneLabel();
172  case Private::BusinessPhone:
174  case Private::MobilePhone:
176  case Private::HomeFax:
177  return Addressee::homeFaxLabel();
178  case Private::BusinessFax:
180  case Private::CarPhone:
181  return Addressee::carPhoneLabel();
182  case Private::Isdn:
183  return Addressee::isdnLabel();
184  case Private::Pager:
185  return Addressee::pagerLabel();
186  case Private::Email:
187  return Addressee::emailLabel();
188  case Private::Mailer:
189  return Addressee::mailerLabel();
190  case Private::Title:
191  return Addressee::titleLabel();
192  case Private::Role:
193  return Addressee::roleLabel();
194  case Private::Organization:
196  case Private::Department:
198  case Private::Note:
199  return Addressee::noteLabel();
200  case Private::Url:
201  return Addressee::urlLabel();
202  case Private::CustomField:
203  return d->label();
204  default:
205  return i18n("Unknown Field");
206  }
207 }
208 
210 {
211  return d->category();
212 }
213 
215 {
216  switch (category) {
217  case All:
218  return i18n("All");
219  case Frequent:
220  return i18n("Frequent");
221  case Address:
222  return i18nc("street/postal", "Address");
223  case Email:
224  return i18n("Email");
225  case Personal:
226  return i18n("Personal");
227  case Organization:
228  return i18n("Organization");
229  case CustomCategory:
230  return i18n("Custom");
231  default:
232  return i18n("Undefined");
233  }
234 }
235 
237 {
238  switch (d->fieldId()) {
239  case Private::FormattedName:
240  return a.formattedName();
241  case Private::FamilyName:
242  return a.familyName();
243  case Private::GivenName:
244  return a.givenName();
245  case Private::AdditionalName:
246  return a.additionalName();
247  case Private::Prefix:
248  return a.prefix();
249  case Private::Suffix:
250  return a.suffix();
251  case Private::NickName:
252  return a.nickName();
253  case Private::Mailer:
254  return a.mailer();
255  case Private::Title:
256  return a.title();
257  case Private::Role:
258  return a.role();
259  case Private::Organization:
260  return a.organization();
261  case Private::Department:
262  return a.department();
263  case Private::Note:
264  return a.note();
265  case Private::Email:
266  return a.preferredEmail();
267  case Private::Birthday:
268  if (a.birthday().isValid()) {
269  return a.birthday().date().toString(Qt::ISODate);
270  } else {
271  return QString();
272  }
273  case Private::Url:
274  return a.url().url().toDisplayString();
275  case Private::HomePhone: {
277 
278  {
279  // check for preferred number
280  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Home | PhoneNumber::Pref);
282  for (it = list.begin(); it != end; ++it) {
283  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home) {
284  return (*it).number();
285  }
286  }
287  }
288 
289  {
290  // check for normal home number
291  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Home);
293  for (it = list.begin(); it != end; ++it) {
294  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home) {
295  return (*it).number();
296  }
297  }
298  }
299 
300  return QString();
301  }
302  case Private::BusinessPhone: {
304 
305  {
306  // check for preferred number
307  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Work | PhoneNumber::Pref);
309  for (it = list.begin(); it != end; ++it) {
310  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work) {
311  return (*it).number();
312  }
313  }
314  }
315 
316  {
317  // check for normal work number
318  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Work);
319  for (it = list.begin(); it != list.end(); ++it) {
320  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work) {
321  return (*it).number();
322  }
323  }
324  }
325 
326  return QString();
327  }
328  case Private::MobilePhone:
329  return a.phoneNumber(PhoneNumber::Cell).number();
330  case Private::HomeFax:
331  return a.phoneNumber(PhoneNumber::Home | PhoneNumber::Fax).number();
332  case Private::BusinessFax:
333  return a.phoneNumber(PhoneNumber::Work | PhoneNumber::Fax).number();
334  case Private::CarPhone:
335  return a.phoneNumber(PhoneNumber::Car).number();
336  case Private::Isdn:
337  return a.phoneNumber(PhoneNumber::Isdn).number();
338  case Private::Pager:
339  return a.phoneNumber(PhoneNumber::Pager).number();
340  case Private::HomeAddressStreet:
341  return a.address(Address::Home).street();
342  case Private::HomeAddressPostOfficeBox:
343  return a.address(Address::Home).postOfficeBox();
344  case Private::HomeAddressLocality:
345  return a.address(Address::Home).locality();
346  case Private::HomeAddressRegion:
347  return a.address(Address::Home).region();
348  case Private::HomeAddressPostalCode:
349  return a.address(Address::Home).postalCode();
350  case Private::HomeAddressCountry:
351  return a.address(Address::Home).country();
352  case Private::BusinessAddressStreet:
353  return a.address(Address::Work).street();
354  case Private::BusinessAddressPostOfficeBox:
355  return a.address(Address::Work).postOfficeBox();
356  case Private::BusinessAddressLocality:
357  return a.address(Address::Work).locality();
358  case Private::BusinessAddressRegion:
359  return a.address(Address::Work).region();
360  case Private::BusinessAddressPostalCode:
361  return a.address(Address::Work).postalCode();
362  case Private::BusinessAddressCountry:
363  return a.address(Address::Work).country();
364  case Private::CustomField:
365  return a.custom(d->app(), d->key());
366  default:
367  return QString();
368  }
369 }
370 
372 {
373  switch (d->fieldId()) {
374  case Private::FormattedName:
375  a.setFormattedName(value);
376  return true;
377  case Private::FamilyName:
378  a.setFamilyName(value);
379  return true;
380  case Private::GivenName:
381  a.setGivenName(value);
382  return true;
383  case Private::AdditionalName:
384  a.setAdditionalName(value);
385  return true;
386  case Private::Prefix:
387  a.setPrefix(value);
388  return true;
389  case Private::Suffix:
390  a.setSuffix(value);
391  return true;
392  case Private::NickName:
393  a.setNickName(value);
394  return true;
395  case Private::Mailer:
396  a.setMailer(value);
397  return true;
398  case Private::Title:
399  a.setTitle(value);
400  return true;
401  case Private::Role:
402  a.setRole(value);
403  return true;
404  case Private::Organization:
405  a.setOrganization(value);
406  return true;
407  case Private::Department:
408  a.setDepartment(value);
409  return true;
410  case Private::Note:
411  a.setNote(value);
412  return true;
413  case Private::Birthday:
415  return true;
416  case Private::CustomField:
417  a.insertCustom(d->app(), d->key(), value);
418  return true;
419  default:
420  return false;
421  }
422 }
423 
425 {
426  switch (d->fieldId()) {
427  case Private::FormattedName:
428  return a.formattedName();
429  case Private::FamilyName:
430  return a.familyName();
431  case Private::GivenName:
432  return a.givenName();
433  case Private::AdditionalName:
434  return a.additionalName();
435  case Private::Prefix:
436  return a.prefix();
437  case Private::Suffix:
438  return a.suffix();
439  case Private::NickName:
440  return a.nickName();
441  case Private::Mailer:
442  return a.mailer();
443  case Private::Title:
444  return a.title();
445  case Private::Role:
446  return a.role();
447  case Private::Organization:
448  return a.organization();
449  case Private::Department:
450  return a.department();
451  case Private::Note:
452  return a.note();
453  case Private::Birthday:
454  if (a.birthday().isValid()) {
455  QDate date = a.birthday().date();
456  return QString::asprintf("%02d-%02d", date.month(), date.day());
457  } else {
458  return QStringLiteral("00-00");
459  }
460  default:
461  return value(a).toLower();
462  }
463 }
464 
466 {
467  return d->fieldId() == Private::CustomField;
468 }
469 
471 {
472  if (Private::mAllFields.isEmpty()) {
473  createField(Private::FormattedName, Frequent);
474  createField(Private::FamilyName, Frequent);
475  createField(Private::GivenName, Frequent);
476  createField(Private::AdditionalName);
477  createField(Private::Prefix);
478  createField(Private::Suffix);
479  createField(Private::NickName, Personal);
480  createField(Private::Birthday, Personal);
481  createField(Private::HomeAddressStreet, Address | Personal);
482  createField(Private::HomeAddressPostOfficeBox, Address | Personal);
483  createField(Private::HomeAddressLocality, Address | Personal);
484  createField(Private::HomeAddressRegion, Address | Personal);
485  createField(Private::HomeAddressPostalCode, Address | Personal);
486  createField(Private::HomeAddressCountry, Address | Personal);
487  createField(Private::HomeAddressLabel, Address | Personal);
488  createField(Private::BusinessAddressStreet, Address | Organization);
489  createField(Private::BusinessAddressPostOfficeBox, Address | Organization);
490  createField(Private::BusinessAddressLocality, Address | Organization);
491  createField(Private::BusinessAddressRegion, Address | Organization);
492  createField(Private::BusinessAddressPostalCode, Address | Organization);
493  createField(Private::BusinessAddressCountry, Address | Organization);
494  createField(Private::BusinessAddressLabel, Address | Organization);
495  createField(Private::HomePhone, Personal | Frequent);
496  createField(Private::BusinessPhone, Organization | Frequent);
497  createField(Private::MobilePhone, Frequent);
498  createField(Private::HomeFax);
499  createField(Private::BusinessFax);
500  createField(Private::CarPhone);
501  createField(Private::Isdn);
502  createField(Private::Pager);
503  createField(Private::Email, Email | Frequent);
504  createField(Private::Mailer, Email);
505  createField(Private::Title, Organization);
506  createField(Private::Role, Organization);
507  createField(Private::Organization, Organization);
508  createField(Private::Department, Organization);
509  createField(Private::Note);
510  createField(Private::Url);
511  }
512 
513  return Private::mAllFields;
514 }
515 
517 {
518  if (Private::mDefaultFields.isEmpty()) {
519  createDefaultField(Private::FormattedName);
520  createDefaultField(Private::Email);
521  }
522 
523  return Private::mDefaultFields;
524 }
525 
526 void Field::createField(int id, int category)
527 {
528  Private::mAllFields.append(new Field(new Private(id, category)));
529 }
530 
531 void Field::createDefaultField(int id, int category)
532 {
533  Private::mDefaultFields.append(new Field(new Private(id, category)));
534 }
535 
537 {
539 
540  for (it = Private::mAllFields.constBegin(); it != Private::mAllFields.constEnd(); ++it) {
541  delete (*it);
542  }
543  Private::mAllFields.clear();
544 
545  for (it = Private::mDefaultFields.constBegin(); it != Private::mDefaultFields.constEnd(); ++it) {
546  delete (*it);
547  }
548  Private::mDefaultFields.clear();
549 
550  for (it = Private::mCustomFields.constBegin(); it != Private::mCustomFields.constEnd(); ++it) {
551  delete (*it);
552  }
553  Private::mCustomFields.clear();
554 }
555 
556 void Field::saveFields(const QString &identifier, const Field::List &fields)
557 {
558  KConfigGroup cg(KSharedConfig::openConfig(), "KABCFields");
559 
560  saveFields(cg, identifier, fields);
561 }
562 
563 void Field::saveFields(KConfigGroup &cfg, const QString &identifier, const Field::List &fields)
564 {
565  QList<int> fieldIds;
566 
567  int custom = 0;
569  fieldIds.reserve(fields.count());
570  for (it = fields.begin(); it != fields.end(); ++it) {
571  fieldIds.append((*it)->d->fieldId());
572  if ((*it)->isCustom()) {
573  QStringList customEntry;
574  customEntry << (*it)->d->label();
575  customEntry << (*it)->d->key();
576  customEntry << (*it)->d->app();
577  cfg.writeEntry(QLatin1String("KCONTACTS_CustomEntry_") + identifier + QLatin1Char('_') + QString::number(custom++), customEntry);
578  }
579  }
580 
581  cfg.writeEntry(identifier, fieldIds);
582 }
583 
585 {
586  KConfigGroup cg(KSharedConfig::openConfig(), "KABCFields");
587 
588  return restoreFields(cg, identifier);
589 }
590 
591 Field::List Field::restoreFields(const KConfigGroup &cfg, const QString &identifier)
592 {
593  const QList<int> fieldIds = cfg.readEntry(identifier, QList<int>());
594 
595  Field::List fields;
596 
597  int custom = 0;
599  fields.reserve(fieldIds.count());
600  for (it = fieldIds.begin(); it != fieldIds.end(); ++it) {
601  Private *f = nullptr;
602  if ((*it) == Private::CustomField) {
603  QStringList customEntry =
604  cfg.readEntry(QLatin1String("KCONTACTS_CustomEntry_") + identifier + QLatin1Char('_') + QString::number(custom++), QStringList());
605  f = new Private(*it, CustomCategory, customEntry[0], customEntry[1], customEntry[2]);
606  } else {
607  f = new Private(*it);
608  }
609  fields.append(new Field(f));
610  }
611 
612  return fields;
613 }
614 
615 bool Field::equals(Field *field)
616 {
617  bool sameId = (d->fieldId() == field->d->fieldId());
618 
619  if (!sameId) {
620  return false;
621  }
622 
623  if (d->fieldId() != Private::CustomField) {
624  return true;
625  }
626 
627  return d->key() == field->d->key();
628 }
629 
630 Field *Field::createCustomField(const QString &label, int category, const QString &key, const QString &app)
631 {
632  Field *field = new Field(new Private(Private::CustomField, category | CustomCategory, label, key, app));
633  Private::mCustomFields.append(field);
634 
635  return field;
636 }
QString custom(const QString &app, const QString &name) const
Return value of custom entry, identified by app and entry name.
Definition: addressee.cpp:2265
void setFormattedName(const QString &formattedName)
Set formatted name.
Definition: addressee.cpp:620
static void saveFields(KConfigGroup &cfg, const QString &identifier, const Field::List &fields)
Save the field settings to a config file.
Definition: field.cpp:563
void setMailer(const QString &mailer)
Set mail client.
Definition: addressee.cpp:946
Class that holds a Note for a contact.
Definition: note.h:21
static QString carPhoneLabel()
Return translated label for carPhone field.
Definition: addressee.cpp:926
Class that holds a Email for a contact.
Definition: email.h:23
static Field::List restoreFields(const KConfigGroup &cfg, const QString &identifier)
Load the field settings from a config file.
Definition: field.cpp:591
static QString businessAddressRegionLabel()
Return translated label for businessAddressRegion field.
Definition: addressee.cpp:881
QString toDisplayString(QUrl::FormattingOptions options) const const
QString asprintf(const char *cformat,...)
static void deleteFields()
Delete all fields from list.
Definition: field.cpp:536
static QString givenNameLabel()
Return translated label for givenName field.
Definition: addressee.cpp:675
QString toString(Qt::DateFormat format) const const
QVector::iterator begin()
Class that holds a Role for a contact.
Definition: role.h:21
static QString mobilePhoneLabel()
Return translated label for mobilePhone field.
Definition: addressee.cpp:911
virtual QString label()
Returns the translated label for this field.
Definition: field.cpp:123
void setSuffix(const QString &suffix)
Set honorific suffixes.
Definition: addressee.cpp:720
void reserve(int alloc)
static QString isdnLabel()
Return translated label for isdn field.
Definition: addressee.cpp:931
Organization
static QString prefixLabel()
Return translated label for prefix field.
Definition: addressee.cpp:715
static QString pagerLabel()
Return translated label for pager field.
Definition: addressee.cpp:936
static QString suffixLabel()
Return translated label for suffix field.
Definition: addressee.cpp:735
static QString nickNameLabel()
Return translated label for nickName field.
Definition: addressee.cpp:786
void setPrefix(const QString &prefix)
Set honorific prefixes.
Definition: addressee.cpp:700
static QString categoryLabel(int category)
Returns the translated label for category.
Definition: field.cpp:214
static QString homePhoneLabel()
Return translated label for homePhone field.
Definition: addressee.cpp:901
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
static Field::List defaultFields()
Returns a list of the default fields.
Definition: field.cpp:516
int day() const const
static QString homeAddressStreetLabel()
Return translated label for homeAddressStreet field.
Definition: addressee.cpp:831
void setGivenName(const QString &givenName)
Set given name.
Definition: addressee.cpp:660
typedef ConstIterator
static QString homeAddressLocalityLabel()
Return translated label for homeAddressLocality field.
Definition: addressee.cpp:841
void setDepartment(const QString &department)
Set department.
Definition: addressee.cpp:1159
void setAdditionalName(const QString &additionalName)
Set additional names.
Definition: addressee.cpp:680
static QString homeFaxLabel()
Return translated label for homeFax field.
Definition: addressee.cpp:916
Address address(Address::Type type) const
Return address, which matches the given type.
Definition: addressee.cpp:2009
static QString businessAddressStreetLabel()
Return translated label for businessAddressStreet field.
Definition: addressee.cpp:866
void setOrganization(const QString &organization)
Set organization.
Definition: addressee.cpp:1108
Preferred number.
Definition: phonenumber.h:52
QDate fromString(const QString &string, Qt::DateFormat format)
QString number(int n, int base)
int count(const T &value) const const
void append(const T &value)
void setTitle(const QString &title)
Set title.
Definition: addressee.cpp:1006
static Field::List allFields()
Returns a list of all fields.
Definition: field.cpp:470
static QString businessAddressCountryLabel()
Return translated label for businessAddressCountry field.
Definition: addressee.cpp:891
QString i18nc(const char *context, const char *text, const TYPE &arg...)
static QString homeAddressLabelLabel()
Return translated label for homeAddressLabel field.
Definition: addressee.cpp:861
QString label(StandardShortcut id)
void setFamilyName(const QString &familyName)
Set family name.
Definition: addressee.cpp:640
virtual bool isCustom()
Returns, if the field is a user-defined field.
Definition: field.cpp:465
static QString noteLabel()
Return translated label for note field.
Definition: addressee.cpp:1194
static QString businessAddressLabelLabel()
Return translated label for businessAddressLabel field.
Definition: addressee.cpp:896
home address
Definition: address.h:70
static QString businessAddressPostalCodeLabel()
Return translated label for businessAddressPostalCode field.
Definition: addressee.cpp:886
virtual bool setValue(KContacts::Addressee &addressee, const QString &value)
Sets the value of the field in the given Addressee.
Definition: field.cpp:371
static QString additionalNameLabel()
Return translated label for additionalName field.
Definition: addressee.cpp:695
virtual QString value(const KContacts::Addressee &addressee)
Returns a string representation of the value the field has in the given Addressee.
Definition: field.cpp:236
virtual bool equals(Field *field)
Returns, if the field is equal with field.
Definition: field.cpp:615
QList::iterator end()
static QString formattedNameLabel()
Return translated label for formattedName field.
Definition: addressee.cpp:635
void setNickName(const QString &nickName)
Set nick name.
Definition: addressee.cpp:740
PhoneNumber phoneNumber(PhoneNumber::Type type) const
Return phone number, which matches the given type.
Definition: addressee.cpp:1745
static QString mailerLabel()
Return translated label for mailer field.
Definition: addressee.cpp:961
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
static QString businessAddressLocalityLabel()
Return translated label for businessAddressLocality field.
Definition: addressee.cpp:876
static QString titleLabel()
Return translated label for title field.
Definition: addressee.cpp:1052
static QString emailLabel()
Return translated label for email field.
Definition: addressee.cpp:941
static QString familyNameLabel()
Return translated label for familyName field.
Definition: addressee.cpp:655
bool isValid() const const
QString i18n(const char *text, const TYPE &arg...)
void insertCustom(const QString &app, const QString &name, const QString &value)
Insert custom entry.
Definition: addressee.cpp:2245
Category category(StandardShortcut id)
QDate date() const const
void setNote(const QString &note)
Set note.
Definition: addressee.cpp:1179
Postal address information.
Definition: address.h:28
Class that holds a NickName for a contact.
Definition: nickname.h:21
static QString urlLabel()
Return translated label for url field.
Definition: addressee.cpp:1280
static QString businessPhoneLabel()
Return translated label for businessPhone field.
Definition: addressee.cpp:906
static QString homeAddressPostalCodeLabel()
Return translated label for homeAddressPostalCode field.
Definition: addressee.cpp:851
static QString homeAddressPostOfficeBoxLabel()
Return translated label for homeAddressPostOfficeBox field.
Definition: addressee.cpp:836
typedef ConstIterator
void setBirthday(const QDateTime &birthday, bool withTime=true)
Set birthday (date and time).
Definition: addressee.cpp:791
Class that holds a Title for a contact.
Definition: title.h:21
static QString businessAddressPostOfficeBoxLabel()
Return translated label for businessAddressPostOfficeBox field.
Definition: addressee.cpp:871
static QString homeAddressRegionLabel()
Return translated label for homeAddressRegion field.
Definition: addressee.cpp:846
static QString roleLabel()
Return translated label for role field.
Definition: addressee.cpp:1103
static Field * createCustomField(const QString &label, int category, const QString &key, const QString &app)
Creates a custom field.
Definition: field.cpp:630
static QString businessFaxLabel()
Return translated label for businessFax field.
Definition: addressee.cpp:921
static QString birthdayLabel()
Return translated label for birthday field.
Definition: addressee.cpp:826
address book entry
Definition: addressee.h:69
Represents a field in the Addressbook.
Definition: field.h:33
address at work
Definition: address.h:71
QString sortKey(const KContacts::Addressee &addressee)
Returns a string, that can be used for sorting.
Definition: field.cpp:424
static void createDefaultField(int id, int category=0)
Definition: field.cpp:531
static QString organizationLabel()
Return translated label for organization field.
Definition: addressee.cpp:1154
QVector::iterator end()
T readEntry(const QString &key, const T &aDefault) const
static QString departmentLabel()
Return translated label for department field.
Definition: addressee.cpp:1174
int month() const const
virtual int category()
Returns the ored categories the field belongs to.
Definition: field.cpp:209
static QString homeAddressCountryLabel()
Return translated label for homeAddressCountry field.
Definition: addressee.cpp:856
QList::iterator begin()
void setRole(const QString &role)
Set role.
Definition: addressee.cpp:1057
static void createField(int id, int category=0)
Definition: field.cpp:526
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Jun 18 2021 22:54:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.