summaryrefslogtreecommitdiffabout
path: root/kabc/vcardparser/vcardline.h
Unidiff
Diffstat (limited to 'kabc/vcardparser/vcardline.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcardparser/vcardline.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/kabc/vcardparser/vcardline.h b/kabc/vcardparser/vcardline.h
new file mode 100644
index 0000000..78b61f8
--- a/dev/null
+++ b/kabc/vcardparser/vcardline.h
@@ -0,0 +1,99 @@
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 VCARDLINE_H
22#define VCARDLINE_H
23
24#include <qstringlist.h>
25#include <qvaluelist.h>
26#include <qvariant.h>
27#include <qmap.h>
28#include <qstring.h>
29
30namespace KABC {
31
32class VCardLine
33{
34 public:
35 typedef QValueList<VCardLine> List;
36
37 VCardLine();
38 VCardLine( const QString &identifier );
39 VCardLine( const QString &identifier, const QVariant &value );
40 VCardLine( const VCardLine& );
41
42 ~VCardLine();
43
44 VCardLine& operator=( const VCardLine& );
45
46 /**
47 * Sets the identifier of this line e.g. UID, FN, CLASS
48 */
49 void setIdentifier( const QString& identifier );
50
51 /**
52 * Returns the identifier of this line.
53 */
54 QString identifier() const;
55
56 /**
57 * Sets the value of of this line.
58 */
59 void setValue( const QVariant& value );
60
61 /**
62 * Returns the value of this line.
63 */
64 QVariant value() const;
65
66 /**
67 * Returns all parameters.
68 */
69 QStringList parameterList() const;
70
71 /**
72 * Add a new parameter to the line.
73 */
74 void addParameter( const QString& param, const QString& value );
75
76 /**
77 * Returns the values of a special parameter.
78 * You can get a list of all parameters with @ref paramList().
79 */
80 QStringList parameters( const QString& param ) const;
81
82 /**
83 * Returns only the first value of a special parameter.
84 * You can get a list of all parameters with @ref paramList().
85 */
86 QString parameter( const QString& param ) const;
87
88 private:
89 QMap< QString, QStringList > *mParamMap;
90 QString mIdentifier;
91 QVariant mValue;
92
93 class VCardLinePrivate;
94 VCardLinePrivate *d;
95};
96
97}
98
99#endif