• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 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
30class QString;
31
32namespace KABC {
33
46class 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
102 void setGid( const QString &gid );
103
108 QString gid() const;
109
113 void setPreferredEmail( const QString &email );
114
119 QString preferredEmail() const;
120
129 void insertCustom( const QString &key, const QString &value );
130
134 void removeCustom( const QString &key );
135
140 QString custom( const QString &key ) const;
141
145 ContactReference &operator=( const ContactReference & );
146
150 bool operator==( const ContactReference & ) const;
151
152 private:
153 class ContactReferencePrivate;
154 QSharedDataPointer<ContactReferencePrivate> d;
155 };
156
160 class KABC_EXPORT ContactGroupReference
161 {
162 public:
166 typedef QList<ContactGroupReference> List;
167
171 ContactGroupReference();
172
176 ContactGroupReference( const ContactGroupReference &other );
177
181 ContactGroupReference( const QString &uid );
182
186 ~ContactGroupReference();
187
191 void setUid( const QString &uid );
192
196 QString uid() const;
197
206 void insertCustom( const QString &key, const QString &value );
207
211 void removeCustom( const QString &key );
212
217 QString custom( const QString &key ) const;
218
222 ContactGroupReference &operator=( const ContactGroupReference & );
223
227 bool operator==( const ContactGroupReference & ) const;
228
229 private:
230 class ContactGroupReferencePrivate;
231 QSharedDataPointer<ContactGroupReferencePrivate> d;
232 };
233
237 class KABC_EXPORT Data
238 {
239 public:
243 typedef QList<Data> List;
244
248 Data();
249
253 Data( const Data &other );
254
258 Data( const QString &name, const QString &email );
259
263 ~Data();
264
268 void setName( const QString &name );
269
273 QString name() const;
274
278 void setEmail( const QString &email );
279
283 QString email() const;
284
293 void insertCustom( const QString &key, const QString &value );
294
298 void removeCustom( const QString &key );
299
304 QString custom( const QString &key ) const;
305
309 Data &operator=( const Data & );
310
314 bool operator==( const Data & ) const;
315
316 private:
317 class DataPrivate;
318 QSharedDataPointer<DataPrivate> d;
319 };
320
324 typedef QList<ContactGroup> List;
325
329 ContactGroup();
330
334 ContactGroup( const ContactGroup &other );
335
339 ContactGroup( const QString &name );
340
344 ~ContactGroup();
345
349 void setId( const QString &id );
350
354 QString id() const;
355
359 void setName( const QString &name );
360
364 QString name() const;
365
370 unsigned int count() const;
371
375 unsigned int contactReferenceCount() const;
376
380 unsigned int contactGroupReferenceCount() const;
381
385 unsigned int dataCount() const;
386
390 ContactReference &contactReference( unsigned int index );
391
395 const ContactReference &contactReference( unsigned int index ) const;
396
400 ContactGroupReference &contactGroupReference( unsigned int index );
401
405 const ContactGroupReference &contactGroupReference( unsigned int index ) const;
406
410 Data &data( unsigned int index );
411
415 const Data &data( unsigned int index ) const;
416
420 void append( const ContactReference &reference );
421
425 void append( const ContactGroupReference &reference );
426
430 void append( const Data &data );
431
435 void remove( const ContactReference &reference );
436
440 void remove( const ContactGroupReference &reference );
441
445 void remove( const Data &data );
446
450 void removeAllContactReferences();
451
455 void removeAllContactGroupReferences();
456
460 void removeAllContactData();
461
465 ContactGroup &operator=( const ContactGroup & );
466
470 bool operator==( const ContactGroup & ) const;
471
475 static QString mimeType();
476
477 private:
478 class Private;
479 QSharedDataPointer<Private> d;
480};
481
482}
483
484#define KABC_CONTACTGROUP_METATYPE_DEFINED
485Q_DECLARE_METATYPE( KABC::ContactGroup )
486
487#endif
KABC::ContactGroup::ContactGroupReference
This class represents a contact group reference.
Definition contactgroup.h:161
KABC::ContactGroup::ContactGroupReference::List
QList< ContactGroupReference > List
A list of contact group references.
Definition contactgroup.h:166
KABC::ContactGroup::ContactGroupReference::custom
QString custom(const QString &key) const
Returns the value for the given key, or an empty string if the entry for that key does not exists.
Definition contactgroup.cpp:194
KABC::ContactGroup::ContactGroupReference::uid
QString uid() const
Returns the contact group uid of the contact group reference.
Definition contactgroup.cpp:179
KABC::ContactGroup::ContactGroupReference::setUid
void setUid(const QString &uid)
Sets the contact group uid of the contact group reference.
Definition contactgroup.cpp:174
KABC::ContactGroup::ContactGroupReference::insertCustom
void insertCustom(const QString &key, const QString &value)
Inserts a custom entry.
Definition contactgroup.cpp:184
KABC::ContactGroup::ContactGroupReference::operator=
ContactGroupReference & operator=(const ContactGroupReference &)
Definition contactgroup.cpp:199
KABC::ContactGroup::ContactGroupReference::ContactGroupReference
ContactGroupReference()
Creates an empty contact group reference.
Definition contactgroup.cpp:154
KABC::ContactGroup::ContactGroupReference::removeCustom
void removeCustom(const QString &key)
Removes the custom entry with the given key.
Definition contactgroup.cpp:189
KABC::ContactGroup::ContactGroupReference::operator==
bool operator==(const ContactGroupReference &) const
Definition contactgroup.cpp:209
KABC::ContactGroup::ContactReference
This class represents a contact reference.
Definition contactgroup.h:54
KABC::ContactGroup::ContactReference::ContactReference
ContactReference()
Creates an empty contact reference.
Definition contactgroup.cpp:53
KABC::ContactGroup::ContactReference::operator==
bool operator==(const ContactReference &) const
Definition contactgroup.cpp:128
KABC::ContactGroup::ContactReference::List
QList< ContactReference > List
A list of contact references.
Definition contactgroup.h:59
KABC::ContactGroup::ContactReference::uid
QString uid() const
Returns the contact uid of the contact reference.
Definition contactgroup.cpp:78
KABC::ContactGroup::ContactReference::custom
QString custom(const QString &key) const
Returns the value for the given key, or an empty string if the entry for that key does not exists.
Definition contactgroup.cpp:113
KABC::ContactGroup::ContactReference::setPreferredEmail
void setPreferredEmail(const QString &email)
Sets the preferred email address.
Definition contactgroup.cpp:93
KABC::ContactGroup::ContactReference::insertCustom
void insertCustom(const QString &key, const QString &value)
Inserts a custom entry.
Definition contactgroup.cpp:103
KABC::ContactGroup::ContactReference::gid
QString gid() const
Returns the contact GID of the contact reference.
Definition contactgroup.cpp:88
KABC::ContactGroup::ContactReference::operator=
ContactReference & operator=(const ContactReference &)
Definition contactgroup.cpp:118
KABC::ContactGroup::ContactReference::removeCustom
void removeCustom(const QString &key)
Removes the custom entry with the given key.
Definition contactgroup.cpp:108
KABC::ContactGroup::ContactReference::setGid
void setGid(const QString &gid)
Sets the contact gid of the contact reference.
Definition contactgroup.cpp:83
KABC::ContactGroup::ContactReference::setUid
void setUid(const QString &uid)
Sets the contact uid of the contact reference.
Definition contactgroup.cpp:73
KABC::ContactGroup::ContactReference::preferredEmail
QString preferredEmail() const
Returns the preferred email address, or an empty string if no preferred email address is set.
Definition contactgroup.cpp:98
KABC::ContactGroup::Data
This class represents a contact data object.
Definition contactgroup.h:238
KABC::ContactGroup::Data::removeCustom
void removeCustom(const QString &key)
Removes the custom entry with the given key.
Definition contactgroup.cpp:282
KABC::ContactGroup::Data::custom
QString custom(const QString &key) const
Returns the value for the given key, or an empty string if the entry for that key does not exists.
Definition contactgroup.cpp:287
KABC::ContactGroup::Data::name
QString name() const
Returns the name of the contact data object.
Definition contactgroup.cpp:262
KABC::ContactGroup::Data::Data
Data()
Creates an empty contact data object.
Definition contactgroup.cpp:236
KABC::ContactGroup::Data::operator==
bool operator==(const Data &) const
Definition contactgroup.cpp:301
KABC::ContactGroup::Data::setName
void setName(const QString &name)
Sets the name of the contact data object.
Definition contactgroup.cpp:257
KABC::ContactGroup::Data::setEmail
void setEmail(const QString &email)
Sets the email address of the contact data object.
Definition contactgroup.cpp:267
KABC::ContactGroup::Data::insertCustom
void insertCustom(const QString &key, const QString &value)
Inserts a custom entry.
Definition contactgroup.cpp:277
KABC::ContactGroup::Data::operator=
Data & operator=(const Data &)
Definition contactgroup.cpp:292
KABC::ContactGroup::Data::List
QList< Data > List
A list of contact data.
Definition contactgroup.h:243
KABC::ContactGroup::Data::email
QString email() const
Returns the email address of the contact data object.
Definition contactgroup.cpp:272
KABC::ContactGroup
This class represents a group of contacts.
Definition contactgroup.h:47
KABC::ContactGroup::append
void append(const ContactReference &reference)
Appends a new contact reference to the contact group.
Definition contactgroup.cpp:441
KABC::ContactGroup::count
unsigned int count() const
Returns the number of contacts in this group.
Definition contactgroup.cpp:374
KABC::ContactGroup::contactGroupReferenceCount
unsigned int contactGroupReferenceCount() const
Returns the number of group references in this group.
Definition contactgroup.cpp:384
KABC::ContactGroup::setName
void setName(const QString &name)
Sets the i18n'd name of the contact group.
Definition contactgroup.cpp:354
KABC::ContactGroup::List
QList< ContactGroup > List
A list of contact groups.
Definition contactgroup.h:324
KABC::ContactGroup::contactReference
ContactReference & contactReference(unsigned int index)
Returns the contact reference at the given index.
Definition contactgroup.cpp:394
KABC::ContactGroup::mimeType
static QString mimeType()
Returns the MIME type used for Contact Groups.
Definition contactgroup.cpp:504
KABC::ContactGroup::removeAllContactGroupReferences
void removeAllContactGroupReferences()
Removes all contact group references from the contact group.
Definition contactgroup.cpp:476
KABC::ContactGroup::id
QString id() const
Returns the unique id of the contact group.
Definition contactgroup.cpp:369
KABC::ContactGroup::remove
void remove(const ContactReference &reference)
Removes the given contact reference from the contact group.
Definition contactgroup.cpp:456
KABC::ContactGroup::contactReferenceCount
unsigned int contactReferenceCount() const
Returns the number of contact references in this group.
Definition contactgroup.cpp:379
KABC::ContactGroup::removeAllContactReferences
void removeAllContactReferences()
Removes all contact references from the contact group.
Definition contactgroup.cpp:471
KABC::ContactGroup::contactGroupReference
ContactGroupReference & contactGroupReference(unsigned int index)
Returns the contact group reference at the given index.
Definition contactgroup.cpp:410
KABC::ContactGroup::removeAllContactData
void removeAllContactData()
Removes all contact data from the contact group.
Definition contactgroup.cpp:481
KABC::ContactGroup::data
Data & data(unsigned int index)
Returns the contact data object at the given index.
Definition contactgroup.cpp:427
KABC::ContactGroup::setId
void setId(const QString &id)
Sets the unique id of the contact group.
Definition contactgroup.cpp:364
KABC::ContactGroup::ContactGroup
ContactGroup()
Creates an empty contact group.
Definition contactgroup.cpp:334
KABC::ContactGroup::name
QString name() const
Returns the i18n'd name of the contact group.
Definition contactgroup.cpp:359
KABC::ContactGroup::dataCount
unsigned int dataCount() const
Returns the number of contact data objects in this group.
Definition contactgroup.cpp:389
KABC::ContactGroup::operator==
bool operator==(const ContactGroup &) const
Definition contactgroup.cpp:495
KABC::ContactGroup::operator=
ContactGroup & operator=(const ContactGroup &)
Definition contactgroup.cpp:486
KABC
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition address.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 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.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 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