• 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
contactgroup.h
1 /*
2  This file is part of the KContacts framework.
3  Copyright (c) 2008 Tobias Koenig <[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 #ifndef KCONTACTS_CONTACTGROUP_H
22 #define KCONTACTS_CONTACTGROUP_H
23 
24 #include <QVector>
25 #include <QSharedDataPointer>
26 #include <QMetaType>
27 
28 #include "kcontacts_export.h"
29 
30 class QString;
31 
32 namespace KContacts {
45 class KCONTACTS_EXPORT ContactGroup
46 {
47 public:
48 
52  class KCONTACTS_EXPORT ContactReference
53  {
54  public:
58  typedef QVector<ContactReference> List;
59 
63  ContactReference();
64 
68  ContactReference(const ContactReference &other);
69 
73  ContactReference(const QString &uid);
74 
78  ~ContactReference();
79 
86  void setUid(const QString &uid);
87 
94  Q_REQUIRED_RESULT QString uid() const;
95 
101  void setGid(const QString &gid);
102 
107  Q_REQUIRED_RESULT QString gid() const;
108 
112  void setPreferredEmail(const QString &email);
113 
118  Q_REQUIRED_RESULT QString preferredEmail() const;
119 
128  void insertCustom(const QString &key, const QString &value);
129 
133  void removeCustom(const QString &key);
134 
139  Q_REQUIRED_RESULT QString custom(const QString &key) const;
140 
144  ContactReference &operator=(const ContactReference &other);
145 
149  Q_REQUIRED_RESULT bool operator==(const ContactReference &other) const;
150 
151  private:
152  class ContactReferencePrivate;
153  QSharedDataPointer<ContactReferencePrivate> d;
154  };
155 
159  class KCONTACTS_EXPORT ContactGroupReference
160  {
161  public:
165  typedef QVector<ContactGroupReference> List;
166 
170  ContactGroupReference();
171 
175  ContactGroupReference(const ContactGroupReference &other);
176 
180  ContactGroupReference(const QString &uid);
181 
185  ~ContactGroupReference();
186 
190  void setUid(const QString &uid);
191 
195  QString uid() const;
196 
205  void insertCustom(const QString &key, const QString &value);
206 
210  void removeCustom(const QString &key);
211 
216  QString custom(const QString &key) const;
217 
221  ContactGroupReference &operator=(const ContactGroupReference &other);
222 
226  bool operator==(const ContactGroupReference &other) const;
227 
228  private:
229  class ContactGroupReferencePrivate;
230  QSharedDataPointer<ContactGroupReferencePrivate> d;
231  };
232 
236  class KCONTACTS_EXPORT Data
237  {
238  public:
242  typedef QVector<Data> List;
243 
247  Data();
248 
252  Data(const Data &other);
253 
257  Data(const QString &name, const QString &email);
258 
262  ~Data();
263 
267  void setName(const QString &name);
268 
272  Q_REQUIRED_RESULT QString name() const;
273 
277  void setEmail(const QString &email);
278 
282  Q_REQUIRED_RESULT QString email() const;
283 
292  void insertCustom(const QString &key, const QString &value);
293 
297  void removeCustom(const QString &key);
298 
303  Q_REQUIRED_RESULT QString custom(const QString &key) const;
304 
308  Data &operator=(const Data &other);
309 
313  Q_REQUIRED_RESULT bool operator==(const Data &other) const;
314 
315  private:
316  class DataPrivate;
317  QSharedDataPointer<DataPrivate> d;
318  };
319 
323  typedef QVector<ContactGroup> List;
324 
328  ContactGroup();
329 
333  ContactGroup(const ContactGroup &other);
334 
338  ContactGroup(const QString &name);
339 
343  ~ContactGroup();
344 
348  void setId(const QString &id);
349 
353  Q_REQUIRED_RESULT QString id() const;
354 
358  void setName(const QString &name);
359 
363  Q_REQUIRED_RESULT QString name() const;
364 
369  Q_REQUIRED_RESULT int count() const;
370 
374  Q_REQUIRED_RESULT int contactReferenceCount() const;
375 
379  Q_REQUIRED_RESULT int contactGroupReferenceCount() const;
380 
384  Q_REQUIRED_RESULT int dataCount() const;
385 
389  Q_REQUIRED_RESULT ContactReference &contactReference(int index);
390 
394  const ContactReference &contactReference(int index) const;
395 
399  ContactGroupReference &contactGroupReference(int index);
400 
404  const ContactGroupReference &contactGroupReference(int index) const;
405 
409  Data &data(int index);
410 
414  const Data &data(int index) const;
415 
419  void append(const ContactReference &reference);
420 
424  void append(const ContactGroupReference &reference);
425 
429  void append(const Data &data);
430 
434  void remove(const ContactReference &reference);
435 
439  void remove(const ContactGroupReference &reference);
440 
444  void remove(const Data &data);
445 
449  void removeAllContactReferences();
450 
454  void removeAllContactGroupReferences();
455 
459  void removeAllContactData();
460 
464  ContactGroup &operator=(const ContactGroup &other);
465 
469  Q_REQUIRED_RESULT bool operator==(const ContactGroup &other) const;
470 
474  static QString mimeType();
475 
476 private:
477  class Private;
478  QSharedDataPointer<Private> d;
479 };
480 }
481 Q_DECLARE_TYPEINFO(KContacts::ContactGroup::ContactGroupReference, Q_MOVABLE_TYPE);
482 Q_DECLARE_TYPEINFO(KContacts::ContactGroup::ContactReference, Q_MOVABLE_TYPE);
483 
484 #define KCONTACTS_CONTACTGROUP_METATYPE_DEFINED
485 Q_DECLARE_METATYPE(KContacts::ContactGroup)
486 
487 #endif
KContacts::ContactGroup
This class represents a group of contacts.
Definition: contactgroup.h:45
KContacts::ContactGroup::ContactGroupReference
This class represents a contact group reference.
Definition: contactgroup.h:159
QString
KContacts::ContactGroup::Data::List
QVector< Data > List
A list of contact data.
Definition: contactgroup.h:242
KContacts::ContactGroup::List
QVector< ContactGroup > List
A list of contact groups.
Definition: contactgroup.h:323
KContacts::ContactGroup::ContactReference
This class represents a contact reference.
Definition: contactgroup.h:52
KContacts::ContactGroup::ContactGroupReference::List
QVector< ContactGroupReference > List
A list of contact group references.
Definition: contactgroup.h:165
KContacts
Definition: address.h:32
QVector< ContactReference >
KContacts::ContactGroup::Data
This class represents a contact data object.
Definition: contactgroup.h:236
KContacts::ContactGroup::ContactReference::List
QVector< ContactReference > List
A list of contact references.
Definition: contactgroup.h:58
QSharedDataPointer< ContactReferencePrivate >
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Wed Dec 11 2019 06:55:20 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