• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. The KDE Frameworks
  3. KContacts
  • KDE Home
  • Contact Us

Quick Links

Skip menu "KContacts"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Dependencies
  • Related Pages

Class Picker

About

Address book API for KDE

Maintainer
Laurent Montel
Supported platforms
Android, FreeBSD, iOS, Linux, MacOSX, Windows
Community
IRC: #kde-devel on Freenode
Mailing list: kde-frameworks-devel
Use with CMake
find_package(KF5Contacts)
target_link_libraries(yourapp KF5::Contacts)
Use with QMake
QT += KContacts 
Clone
git clone git://anongit.kde.org/kcontacts.git
Browse source
KContacts on cgit.kde.org

KContacts

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

KDE's Doxygen guidelines are available online.

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal