KContacts

vcardline.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 VCARDLINE_H
9 #define VCARDLINE_H
10 
11 #include <QMap>
12 #include <QString>
13 #include <QStringList>
14 #include <QVariant>
15 
16 #include "kcontacts_export.h"
17 
18 namespace KContacts
19 {
20 class KCONTACTS_EXPORT VCardLine
21 {
22 public:
23  typedef QVector<VCardLine> List;
24  typedef QMap<QString, QStringList> ParamMap;
25 
26  VCardLine();
27  VCardLine(const QString &identifier);
28  VCardLine(const QString &identifier, const QVariant &value);
29  VCardLine(const VCardLine &line);
30 
31  ~VCardLine();
32 
33  VCardLine &operator=(const VCardLine &line);
34 
35  /**
36  * Equality operator.
37  *
38  */
39  Q_REQUIRED_RESULT bool operator==(const VCardLine &other) const;
40 
41  /**
42  * Sets the identifier of this line e.g. UID, FN, CLASS
43  *
44  * @param identifier The VCard identifier of this line
45  */
46  void setIdentifier(const QString &identifier);
47 
48  /**
49  * Returns the identifier of this line.
50  */
51  Q_REQUIRED_RESULT QString identifier() const;
52 
53  /**
54  * Sets the value of this line.
55  */
56  void setValue(const QVariant &value);
57 
58  /**
59  * Returns the value of this line.
60  */
61  Q_REQUIRED_RESULT QVariant value() const;
62 
63  /**
64  * Sets the group the line belongs to.
65  */
66  void setGroup(const QString &group);
67 
68  /**
69  * Returns the group the line belongs to.
70  */
71  Q_REQUIRED_RESULT QString group() const;
72 
73  /**
74  * Returns whether the line belongs to a group.
75  */
76  Q_REQUIRED_RESULT bool hasGroup() const;
77 
78  /**
79  * Returns all parameters.
80  */
81  Q_REQUIRED_RESULT QStringList parameterList() const;
82 
83  /**
84  * Add a new parameter to the line.
85  *
86  * @param param Name of the parameter to insert
87  * @param value Value of the parameter to insert
88  */
89  void addParameter(const QString &param, const QString &value);
90 
91  /**
92  * Returns the values of a special parameter.
93  * You can get a list of all parameters with paramList().
94  *
95  * @param param Name of the parameter to look for
96  */
97  Q_REQUIRED_RESULT QStringList parameters(const QString &param) const;
98 
99  /**
100  * Returns only the first value of a special parameter.
101  * You can get a list of all parameters with paramList().
102  *
103  * @param param Name of the parameter to look for
104  */
105  Q_REQUIRED_RESULT QString parameter(const QString &param) const;
106 
107  /**
108  * Returns all parameters
109  * @since 4.14.5
110  */
111  Q_REQUIRED_RESULT ParamMap parameterMap() const;
112 
113 private:
114  ParamMap mParamMap;
115  QString mIdentifier;
116  QString mGroup;
117  QVariant mValue;
118 };
119 }
120 
121 #endif
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
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.