-rw-r--r-- | kabc/vcardparser/vcard.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/kabc/vcardparser/vcard.h b/kabc/vcardparser/vcard.h new file mode 100644 index 0000000..ce672b5 --- a/dev/null +++ b/kabc/vcardparser/vcard.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | This file is part of libkabc. | ||
3 | Copyright (c) 2003 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., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef VCARD_H | ||
22 | #define VCARD_H | ||
23 | |||
24 | #include "vcardline.h" | ||
25 | #include <qmap.h> | ||
26 | #include <qstringlist.h> | ||
27 | #include <qvaluelist.h> | ||
28 | |||
29 | namespace KABC { | ||
30 | |||
31 | class VCard | ||
32 | { | ||
33 | public: | ||
34 | typedef QValueList<VCard> List; | ||
35 | |||
36 | enum Version { v2_1, v3_0 }; | ||
37 | |||
38 | VCard(); | ||
39 | VCard( const VCard& ); | ||
40 | |||
41 | ~VCard(); | ||
42 | |||
43 | VCard& operator=( const VCard& ); | ||
44 | |||
45 | /** | ||
46 | * Removes all lines from the vCard. | ||
47 | */ | ||
48 | void clear(); | ||
49 | |||
50 | /** | ||
51 | * Returns a list of all identifiers that exists in the | ||
52 | * vCard. | ||
53 | */ | ||
54 | QStringList identifiers() const; | ||
55 | |||
56 | /** | ||
57 | * Adds a VCardLine to the VCard | ||
58 | */ | ||
59 | void addLine( const VCardLine& line ); | ||
60 | |||
61 | /** | ||
62 | * Returns all lines of the vcard with a special identifier. | ||
63 | */ | ||
64 | VCardLine::List lines( const QString& identifier ); | ||
65 | |||
66 | /** | ||
67 | * Returns only the first line of the vcard with a special identifier. | ||
68 | */ | ||
69 | VCardLine line( const QString& identifier ); | ||
70 | |||
71 | /** | ||
72 | * Set the version of the vCard. | ||
73 | */ | ||
74 | void setVersion( Version version ); | ||
75 | |||
76 | /** | ||
77 | * Returns the version of this vCard. | ||
78 | */ | ||
79 | Version version() const; | ||
80 | |||
81 | private: | ||
82 | QMap< QString, VCardLine::List > *mLineMap; | ||
83 | |||
84 | class VCardPrivate; | ||
85 | VCardPrivate *d; | ||
86 | }; | ||
87 | |||
88 | } | ||
89 | |||
90 | #endif | ||