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 <KLocalizedString>
9 #include <KConfig>
10 
11 #include <KConfigGroup>
12 #include <KSharedConfig>
13 #include "field.h"
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:
276  {
278 
279  {
280  // check for preferred number
281  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Home | PhoneNumber::Pref);
283  for (it = list.begin(); it != end; ++it) {
284  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home) {
285  return (*it).number();
286  }
287  }
288  }
289 
290  {
291  // check for normal home number
292  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Home);
294  for (it = list.begin(); it != end; ++it) {
295  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home) {
296  return (*it).number();
297  }
298  }
299  }
300 
301  return QString();
302  }
303  case Private::BusinessPhone:
304  {
306 
307  {
308  // check for preferred number
309  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Work | PhoneNumber::Pref);
311  for (it = list.begin(); it != end; ++it) {
312  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work) {
313  return (*it).number();
314  }
315  }
316  }
317 
318  {
319  // check for normal work number
320  const PhoneNumber::List list = a.phoneNumbers(PhoneNumber::Work);
321  for (it = list.begin(); it != list.end(); ++it) {
322  if (((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work) {
323  return (*it).number();
324  }
325  }
326  }
327 
328  return QString();
329  }
330  case Private::MobilePhone:
331  return a.phoneNumber(PhoneNumber::Cell).number();
332  case Private::HomeFax:
333  return a.phoneNumber(PhoneNumber::Home | PhoneNumber::Fax).number();
334  case Private::BusinessFax:
335  return a.phoneNumber(PhoneNumber::Work | PhoneNumber::Fax).number();
336  case Private::CarPhone:
337  return a.phoneNumber(PhoneNumber::Car).number();
338  case Private::Isdn:
339  return a.phoneNumber(PhoneNumber::Isdn).number();
340  case Private::Pager:
341  return a.phoneNumber(PhoneNumber::Pager).number();
342  case Private::HomeAddressStreet:
343  return a.address(Address::Home).street();
344  case Private::HomeAddressPostOfficeBox:
345  return a.address(Address::Home).postOfficeBox();
346  case Private::HomeAddressLocality:
347  return a.address(Address::Home).locality();
348  case Private::HomeAddressRegion:
349  return a.address(Address::Home).region();
350  case Private::HomeAddressPostalCode:
351  return a.address(Address::Home).postalCode();
352  case Private::HomeAddressCountry:
353  return a.address(Address::Home).country();
354  case Private::BusinessAddressStreet:
355  return a.address(Address::Work).street();
356  case Private::BusinessAddressPostOfficeBox:
357  return a.address(Address::Work).postOfficeBox();
358  case Private::BusinessAddressLocality:
359  return a.address(Address::Work).locality();
360  case Private::BusinessAddressRegion:
361  return a.address(Address::Work).region();
362  case Private::BusinessAddressPostalCode:
363  return a.address(Address::Work).postalCode();
364  case Private::BusinessAddressCountry:
365  return a.address(Address::Work).country();
366  case Private::CustomField:
367  return a.custom(d->app(), d->key());
368  default:
369  return QString();
370  }
371 }
372 
374 {
375  switch (d->fieldId()) {
376  case Private::FormattedName:
377  a.setFormattedName(value);
378  return true;
379  case Private::FamilyName:
380  a.setFamilyName(value);
381  return true;
382  case Private::GivenName:
383  a.setGivenName(value);
384  return true;
385  case Private::AdditionalName:
386  a.setAdditionalName(value);
387  return true;
388  case Private::Prefix:
389  a.setPrefix(value);
390  return true;
391  case Private::Suffix:
392  a.setSuffix(value);
393  return true;
394  case Private::NickName:
395  a.setNickName(value);
396  return true;
397  case Private::Mailer:
398  a.setMailer(value);
399  return true;
400  case Private::Title:
401  a.setTitle(value);
402  return true;
403  case Private::Role:
404  a.setRole(value);
405  return true;
406  case Private::Organization:
407  a.setOrganization(value);
408  return true;
409  case Private::Department:
410  a.setDepartment(value);
411  return true;
412  case Private::Note:
413  a.setNote(value);
414  return true;
415  case Private::Birthday:
417  return true;
418  case Private::CustomField:
419  a.insertCustom(d->app(), d->key(), value);
420  return true;
421  default:
422  return false;
423  }
424 }
425 
427 {
428  switch (d->fieldId()) {
429  case Private::FormattedName:
430  return a.formattedName();
431  case Private::FamilyName:
432  return a.familyName();
433  case Private::GivenName:
434  return a.givenName();
435  case Private::AdditionalName:
436  return a.additionalName();
437  case Private::Prefix:
438  return a.prefix();
439  case Private::Suffix:
440  return a.suffix();
441  case Private::NickName:
442  return a.nickName();
443  case Private::Mailer:
444  return a.mailer();
445  case Private::Title:
446  return a.title();
447  case Private::Role:
448  return a.role();
449  case Private::Organization:
450  return a.organization();
451  case Private::Department:
452  return a.department();
453  case Private::Note:
454  return a.note();
455  case Private::Birthday:
456  if (a.birthday().isValid()) {
457  QDate date = a.birthday().date();
458  return QString::asprintf("%02d-%02d", date.month(), date.day());
459  } else {
460  return QStringLiteral("00-00");
461  }
462  default:
463  return value(a).toLower();
464  }
465 }
466 
468 {
469  return d->fieldId() == Private::CustomField;
470 }
471 
473 {
474  if (Private::mAllFields.isEmpty()) {
475  createField(Private::FormattedName, Frequent);
476  createField(Private::FamilyName, Frequent);
477  createField(Private::GivenName, Frequent);
478  createField(Private::AdditionalName);
479  createField(Private::Prefix);
480  createField(Private::Suffix);
481  createField(Private::NickName, Personal);
482  createField(Private::Birthday, Personal);
483  createField(Private::HomeAddressStreet, Address | Personal);
484  createField(Private::HomeAddressPostOfficeBox, Address | Personal);
485  createField(Private::HomeAddressLocality, Address | Personal);
486  createField(Private::HomeAddressRegion, Address | Personal);
487  createField(Private::HomeAddressPostalCode, Address | Personal);
488  createField(Private::HomeAddressCountry, Address | Personal);
489  createField(Private::HomeAddressLabel, Address | Personal);
490  createField(Private::BusinessAddressStreet, Address | Organization);
491  createField(Private::BusinessAddressPostOfficeBox, Address | Organization);
492  createField(Private::BusinessAddressLocality, Address | Organization);
493  createField(Private::BusinessAddressRegion, Address | Organization);
494  createField(Private::BusinessAddressPostalCode, Address | Organization);
495  createField(Private::BusinessAddressCountry, Address | Organization);
496  createField(Private::BusinessAddressLabel, Address | Organization);
497  createField(Private::HomePhone, Personal | Frequent);
498  createField(Private::BusinessPhone, Organization | Frequent);
499  createField(Private::MobilePhone, Frequent);
500  createField(Private::HomeFax);
501  createField(Private::BusinessFax);
502  createField(Private::CarPhone);
503  createField(Private::Isdn);
504  createField(Private::Pager);
505  createField(Private::Email, Email | Frequent);
506  createField(Private::Mailer, Email);
507  createField(Private::Title, Organization);
508  createField(Private::Role, Organization);
509  createField(Private::Organization, Organization);
510  createField(Private::Department, Organization);
511  createField(Private::Note);
512  createField(Private::Url);
513  }
514 
515  return Private::mAllFields;
516 }
517 
519 {
520  if (Private::mDefaultFields.isEmpty()) {
521  createDefaultField(Private::FormattedName);
522  createDefaultField(Private::Email);
523  }
524 
525  return Private::mDefaultFields;
526 }
527 
528 void Field::createField(int id, int category)
529 {
530  Private::mAllFields.append(new Field(new Private(id, category)));
531 }
532 
533 void Field::createDefaultField(int id, int category)
534 {
535  Private::mDefaultFields.append(new Field(new Private(id, category)));
536 }
537 
539 {
541 
542  for (it = Private::mAllFields.constBegin(); it != Private::mAllFields.constEnd(); ++it) {
543  delete(*it);
544  }
545  Private::mAllFields.clear();
546 
547  for (it = Private::mDefaultFields.constBegin(); it != Private::mDefaultFields.constEnd(); ++it) {
548  delete(*it);
549  }
550  Private::mDefaultFields.clear();
551 
552  for (it = Private::mCustomFields.constBegin(); it != Private::mCustomFields.constEnd(); ++it) {
553  delete(*it);
554  }
555  Private::mCustomFields.clear();
556 }
557 
558 void Field::saveFields(const QString &identifier, const Field::List &fields)
559 {
560  KConfigGroup cg(KSharedConfig::openConfig(), "KABCFields");
561 
562  saveFields(cg, identifier, fields);
563 }
564 
565 void Field::saveFields(KConfigGroup &cfg, const QString &identifier, const Field::List &fields)
566 {
567  QList<int> fieldIds;
568 
569  int custom = 0;
571  fieldIds.reserve(fields.count());
572  for (it = fields.begin(); it != fields.end(); ++it) {
573  fieldIds.append((*it)->d->fieldId());
574  if ((*it)->isCustom()) {
575  QStringList customEntry;
576  customEntry << (*it)->d->label();
577  customEntry << (*it)->d->key();
578  customEntry << (*it)->d->app();
579  cfg.writeEntry(QLatin1String("KCONTACTS_CustomEntry_") + identifier + QLatin1Char('_')
580  +QString::number(custom++), customEntry);
581  }
582  }
583 
584  cfg.writeEntry(identifier, fieldIds);
585 }
586 
588 {
589  KConfigGroup cg(KSharedConfig::openConfig(), "KABCFields");
590 
591  return restoreFields(cg, identifier);
592 }
593 
594 Field::List Field::restoreFields(const KConfigGroup &cfg, const QString &identifier)
595 {
596  const QList<int> fieldIds = cfg.readEntry(identifier, QList<int>());
597 
598  Field::List fields;
599 
600  int custom = 0;
602  fields.reserve(fieldIds.count());
603  for (it = fieldIds.begin(); it != fieldIds.end(); ++it) {
604  Private *f = nullptr;
605  if ((*it) == Private::CustomField) {
606  QStringList customEntry = cfg.readEntry(QLatin1String("KCONTACTS_CustomEntry_")
607  +identifier + QLatin1Char('_')
608  +QString::number(custom++), QStringList());
609  f = new Private(*it, CustomCategory, customEntry[ 0 ],
610  customEntry[ 1 ], customEntry[ 2 ]);
611  } else {
612  f = new Private(*it);
613  }
614  fields.append(new Field(f));
615  }
616 
617  return fields;
618 }
619 
620 bool Field::equals(Field *field)
621 {
622  bool sameId = (d->fieldId() == field->d->fieldId());
623 
624  if (!sameId) {
625  return false;
626  }
627 
628  if (d->fieldId() != Private::CustomField) {
629  return true;
630  }
631 
632  return d->key() == field->d->key();
633 }
634 
635 Field *Field::createCustomField(const QString &label, int category, const QString &key, const QString &app)
636 {
637  Field *field = new Field(new Private(Private::CustomField,
638  category | CustomCategory,
639  label, key, app));
640  Private::mCustomFields.append(field);
641 
642  return field;
643 }
QString custom(const QString &app, const QString &name) const
Return value of custom entry, identified by app and entry name.
Definition: addressee.cpp:2264
void setFormattedName(const QString &formattedName)
Set formatted name.
Definition: addressee.cpp:619
static void saveFields(KConfigGroup &cfg, const QString &identifier, const Field::List &fields)
Save the field settings to a config file.
Definition: field.cpp:565
void setMailer(const QString &mailer)
Set mail client.
Definition: addressee.cpp:945
Class that holds a Note for a contact.
Definition: note.h:20
static QString carPhoneLabel()
Return translated label for carPhone field.
Definition: addressee.cpp:925
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:594
static QString businessAddressRegionLabel()
Return translated label for businessAddressRegion field.
Definition: addressee.cpp:880
QString toDisplayString(QUrl::FormattingOptions options) const const
QString asprintf(const char *cformat,...)
static void deleteFields()
Delete all fields from list.
Definition: field.cpp:538
static QString givenNameLabel()
Return translated label for givenName field.
Definition: addressee.cpp:674
QString toString(Qt::DateFormat format) const const
QVector::iterator begin()
Class that holds a Role for a contact.
Definition: role.h:20
static QString mobilePhoneLabel()
Return translated label for mobilePhone field.
Definition: addressee.cpp:910
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:719
void reserve(int alloc)
static QString isdnLabel()
Return translated label for isdn field.
Definition: addressee.cpp:930
Organization
static QString prefixLabel()
Return translated label for prefix field.
Definition: addressee.cpp:714
static QString pagerLabel()
Return translated label for pager field.
Definition: addressee.cpp:935
static QString suffixLabel()
Return translated label for suffix field.
Definition: addressee.cpp:734
static QString nickNameLabel()
Return translated label for nickName field.
Definition: addressee.cpp:785
void setPrefix(const QString &prefix)
Set honorific prefixes.
Definition: addressee.cpp:699
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:900
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:518
int day() const const
static QString homeAddressStreetLabel()
Return translated label for homeAddressStreet field.
Definition: addressee.cpp:830
void setGivenName(const QString &givenName)
Set given name.
Definition: addressee.cpp:659
typedef ConstIterator
static QString homeAddressLocalityLabel()
Return translated label for homeAddressLocality field.
Definition: addressee.cpp:840
void setDepartment(const QString &department)
Set department.
Definition: addressee.cpp:1158
void setAdditionalName(const QString &additionalName)
Set additional names.
Definition: addressee.cpp:679
static QString homeFaxLabel()
Return translated label for homeFax field.
Definition: addressee.cpp:915
Address address(Address::Type type) const
Return address, which matches the given type.
Definition: addressee.cpp:2008
static QString businessAddressStreetLabel()
Return translated label for businessAddressStreet field.
Definition: addressee.cpp:865
void setOrganization(const QString &organization)
Set organization.
Definition: addressee.cpp:1107
Preferred number.
Definition: phonenumber.h:51
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:1005
static Field::List allFields()
Returns a list of all fields.
Definition: field.cpp:472
static QString businessAddressCountryLabel()
Return translated label for businessAddressCountry field.
Definition: addressee.cpp:890
QString i18nc(const char *context, const char *text, const TYPE &arg...)
static QString homeAddressLabelLabel()
Return translated label for homeAddressLabel field.
Definition: addressee.cpp:860
QString label(StandardShortcut id)
void setFamilyName(const QString &familyName)
Set family name.
Definition: addressee.cpp:639
virtual bool isCustom()
Returns, if the field is a user-defined field.
Definition: field.cpp:467
static QString noteLabel()
Return translated label for note field.
Definition: addressee.cpp:1193
static QString businessAddressLabelLabel()
Return translated label for businessAddressLabel field.
Definition: addressee.cpp:895
home address
Definition: address.h:69
static QString businessAddressPostalCodeLabel()
Return translated label for businessAddressPostalCode field.
Definition: addressee.cpp:885
virtual bool setValue(KContacts::Addressee &addressee, const QString &value)
Sets the value of the field in the given Addressee.
Definition: field.cpp:373
static QString additionalNameLabel()
Return translated label for additionalName field.
Definition: addressee.cpp:694
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:620
QList::iterator end()
static QString formattedNameLabel()
Return translated label for formattedName field.
Definition: addressee.cpp:634
void setNickName(const QString &nickName)
Set nick name.
Definition: addressee.cpp:739
PhoneNumber phoneNumber(PhoneNumber::Type type) const
Return phone number, which matches the given type.
Definition: addressee.cpp:1744
static QString mailerLabel()
Return translated label for mailer field.
Definition: addressee.cpp:960
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:875
static QString titleLabel()
Return translated label for title field.
Definition: addressee.cpp:1051
static QString emailLabel()
Return translated label for email field.
Definition: addressee.cpp:940
static QString familyNameLabel()
Return translated label for familyName field.
Definition: addressee.cpp:654
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:2244
QDate date() const const
void setNote(const QString &note)
Set note.
Definition: addressee.cpp:1178
Postal address information.
Definition: address.h:27
Class that holds a NickName for a contact.
Definition: nickname.h:20
static QString urlLabel()
Return translated label for url field.
Definition: addressee.cpp:1279
static QString businessPhoneLabel()
Return translated label for businessPhone field.
Definition: addressee.cpp:905
static QString homeAddressPostalCodeLabel()
Return translated label for homeAddressPostalCode field.
Definition: addressee.cpp:850
static QString homeAddressPostOfficeBoxLabel()
Return translated label for homeAddressPostOfficeBox field.
Definition: addressee.cpp:835
typedef ConstIterator
void setBirthday(const QDateTime &birthday, bool withTime=true)
Set birthday (date and time).
Definition: addressee.cpp:790
Class that holds a Title for a contact.
Definition: title.h:20
static QString businessAddressPostOfficeBoxLabel()
Return translated label for businessAddressPostOfficeBox field.
Definition: addressee.cpp:870
static QString homeAddressRegionLabel()
Return translated label for homeAddressRegion field.
Definition: addressee.cpp:845
static QString roleLabel()
Return translated label for role field.
Definition: addressee.cpp:1102
static Field * createCustomField(const QString &label, int category, const QString &key, const QString &app)
Creates a custom field.
Definition: field.cpp:635
static QString businessFaxLabel()
Return translated label for businessFax field.
Definition: addressee.cpp:920
static QString birthdayLabel()
Return translated label for birthday field.
Definition: addressee.cpp:825
address book entry
Definition: addressee.h:68
Represents a field in the Addressbook.
Definition: field.h:32
address at work
Definition: address.h:70
QString sortKey(const KContacts::Addressee &addressee)
Returns a string, that can be used for sorting.
Definition: field.cpp:426
static void createDefaultField(int id, int category=0)
Definition: field.cpp:533
static QString organizationLabel()
Return translated label for organization field.
Definition: addressee.cpp:1153
QVector::iterator end()
T readEntry(const QString &key, const T &aDefault) const
static QString departmentLabel()
Return translated label for department field.
Definition: addressee.cpp:1173
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:855
QList::iterator begin()
void setRole(const QString &role)
Set role.
Definition: addressee.cpp:1056
static void createField(int id, int category=0)
Definition: field.cpp:528
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 22:53:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.