• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

kabc

  • kabc
contactgroup.h
1 /*
2  This file is part of libkabc.
3  Copyright (c) 2008 Tobias Koenig <tokoe@kde.org>
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 KABC_CONTACTGROUP_H
22 #define KABC_CONTACTGROUP_H
23 
24 #include <QtCore/QList>
25 #include <QtCore/QSharedDataPointer>
26 #include <QtCore/QMetaType>
27 
28 #include "kabc_export.h"
29 
30 class QString;
31 
32 namespace KABC {
33 
46 class KABC_EXPORT ContactGroup
47 {
48  public:
49 
53  class KABC_EXPORT ContactReference
54  {
55  public:
59  typedef QList<ContactReference> List;
60 
64  ContactReference();
65 
69  ContactReference( const ContactReference &other );
70 
74  ContactReference( const QString &uid );
75 
79  ~ContactReference();
80 
87  void setUid( const QString &uid );
88 
95  QString uid() const;
96 
100  void setPreferredEmail( const QString &email );
101 
106  QString preferredEmail() const;
107 
116  void insertCustom( const QString &key, const QString &value );
117 
121  void removeCustom( const QString &key );
122 
127  QString custom( const QString &key ) const;
128 
132  ContactReference &operator=( const ContactReference & );
133 
137  bool operator==( const ContactReference & ) const;
138 
139  private:
140  class ContactReferencePrivate;
141  QSharedDataPointer<ContactReferencePrivate> d;
142  };
143 
147  class KABC_EXPORT ContactGroupReference
148  {
149  public:
153  typedef QList<ContactGroupReference> List;
154 
158  ContactGroupReference();
159 
163  ContactGroupReference( const ContactGroupReference &other );
164 
168  ContactGroupReference( const QString &uid );
169 
173  ~ContactGroupReference();
174 
178  void setUid( const QString &uid );
179 
183  QString uid() const;
184 
193  void insertCustom( const QString &key, const QString &value );
194 
198  void removeCustom( const QString &key );
199 
204  QString custom( const QString &key ) const;
205 
209  ContactGroupReference &operator=( const ContactGroupReference & );
210 
214  bool operator==( const ContactGroupReference & ) const;
215 
216  private:
217  class ContactGroupReferencePrivate;
218  QSharedDataPointer<ContactGroupReferencePrivate> d;
219  };
220 
224  class KABC_EXPORT Data
225  {
226  public:
230  typedef QList<Data> List;
231 
235  Data();
236 
240  Data( const Data &other );
241 
245  Data( const QString &name, const QString &email );
246 
250  ~Data();
251 
255  void setName( const QString &name );
256 
260  QString name() const;
261 
265  void setEmail( const QString &email );
266 
270  QString email() const;
271 
280  void insertCustom( const QString &key, const QString &value );
281 
285  void removeCustom( const QString &key );
286 
291  QString custom( const QString &key ) const;
292 
296  Data &operator=( const Data & );
297 
301  bool operator==( const Data & ) const;
302 
303  private:
304  class DataPrivate;
305  QSharedDataPointer<DataPrivate> d;
306  };
307 
311  typedef QList<ContactGroup> List;
312 
316  ContactGroup();
317 
321  ContactGroup( const ContactGroup &other );
322 
326  ContactGroup( const QString &name );
327 
331  ~ContactGroup();
332 
336  void setId( const QString &id );
337 
341  QString id() const;
342 
346  void setName( const QString &name );
347 
351  QString name() const;
352 
357  unsigned int count() const;
358 
362  unsigned int contactReferenceCount() const;
363 
367  unsigned int contactGroupReferenceCount() const;
368 
372  unsigned int dataCount() const;
373 
377  ContactReference &contactReference( unsigned int index );
378 
382  const ContactReference &contactReference( unsigned int index ) const;
383 
387  ContactGroupReference &contactGroupReference( unsigned int index );
388 
392  const ContactGroupReference &contactGroupReference( unsigned int index ) const;
393 
397  Data &data( unsigned int index );
398 
402  const Data &data( unsigned int index ) const;
403 
407  void append( const ContactReference &reference );
408 
412  void append( const ContactGroupReference &reference );
413 
417  void append( const Data &data );
418 
422  void remove( const ContactReference &reference );
423 
427  void remove( const ContactGroupReference &reference );
428 
432  void remove( const Data &data );
433 
437  void removeAllContactReferences();
438 
442  void removeAllContactGroupReferences();
443 
447  void removeAllContactData();
448 
452  ContactGroup &operator=( const ContactGroup & );
453 
457  bool operator==( const ContactGroup & ) const;
458 
462  static QString mimeType();
463 
464  private:
465  class Private;
466  QSharedDataPointer<Private> d;
467 };
468 
469 }
470 
471 #define KABC_CONTACTGROUP_METATYPE_DEFINED
472 Q_DECLARE_METATYPE( KABC::ContactGroup )
473 
474 #endif
KABC::ContactGroup::Data::List
QList< Data > List
A list of contact data.
Definition: contactgroup.h:230
KABC::ContactGroup::ContactReference
This class represents a contact reference.
Definition: contactgroup.h:53
KABC::ContactGroup::List
QList< ContactGroup > List
A list of contact groups.
Definition: contactgroup.h:311
KABC::ContactGroup
This class represents a group of contacts.
Definition: contactgroup.h:46
KABC::ContactGroup::ContactReference::List
QList< ContactReference > List
A list of contact references.
Definition: contactgroup.h:59
KABC::ContactGroup::ContactGroupReference::List
QList< ContactGroupReference > List
A list of contact group references.
Definition: contactgroup.h:153
KABC::ContactGroup::ContactGroupReference
This class represents a contact group reference.
Definition: contactgroup.h:147
KABC::ContactGroup::Data
This class represents a contact data object.
Definition: contactgroup.h:224
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:04:12 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

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

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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