KContacts

vcard.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2003 Tobias Koenig <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef VCARDPARSER_VCARD_H
9 #define VCARDPARSER_VCARD_H
10 
11 #include "vcardline.h"
12 #include <QMap>
13 #include <QStringList>
14 #include <QVector>
15 
16 namespace KContacts
17 {
18 class VCard
19 {
20 public:
21  typedef QVector<VCard> List;
22  typedef QMap<QString, VCardLine::List> LineMap;
23 
24  enum Version {
25  v2_1,
26  v3_0,
27  v4_0,
28  };
29 
30  VCard();
31  VCard(const VCard &card);
32 
33  ~VCard();
34 
35  VCard &operator=(const VCard &card);
36 
37  /**
38  * Removes all lines from the vCard.
39  */
40  void clear();
41 
42  /**
43  * Returns a list of all identifiers that exists in the vCard.
44  */
45  Q_REQUIRED_RESULT QStringList identifiers() const;
46 
47  /**
48  * Adds a VCardLine to the VCard
49  */
50  void addLine(const VCardLine &line);
51 
52  /**
53  * Returns all lines of the vcard with a special identifier.
54  */
55  Q_REQUIRED_RESULT VCardLine::List lines(const QString &identifier) const;
56 
57  /**
58  * Returns only the first line of the vcard with a special identifier.
59  */
60  Q_REQUIRED_RESULT VCardLine line(const QString &identifier) const;
61 
62  /**
63  * Set the version of the vCard.
64  */
65  void setVersion(Version version);
66 
67  /**
68  * Returns the version of this vCard.
69  */
70  Q_REQUIRED_RESULT Version version() const;
71 
72 private:
73  LineMap mLineMap;
74 };
75 }
76 
77 #endif
KDB_EXPORT KDbVersionInfo version()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Jun 18 2021 22:54:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.