KContacts

fieldgroup.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2016-2019 Laurent Montel <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef FIELDGROUP_H
9 #define FIELDGROUP_H
10 
11 #include "kcontacts_export.h"
12 
13 #include <QMap>
14 #include <QSharedDataPointer>
15 #include <QString>
16 
17 class FieldGroupTest;
18 
19 namespace KContacts
20 {
21 class ParameterMap;
22 
23 /** @short Class that holds a FieldGroup for a contact.
24  * @since 5.3
25  */
26 class KCONTACTS_EXPORT FieldGroup
27 {
28  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const FieldGroup &);
29  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, FieldGroup &);
30  friend class VCardTool;
31  friend class ::FieldGroupTest;
32 
33 public:
34  FieldGroup();
35  FieldGroup(const FieldGroup &other);
36  FieldGroup(const QString &fieldGroupName);
37 
38  ~FieldGroup();
39 
40  typedef QVector<FieldGroup> List;
41 
42  void setFieldGroupName(const QString &fieldGroup);
43  Q_REQUIRED_RESULT QString fieldGroupName() const;
44 
45  Q_REQUIRED_RESULT bool isValid() const;
46 
47  void setValue(const QString &value);
48  Q_REQUIRED_RESULT QString value() const;
49 
50 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
51  /**
52  * @deprecated Since 5.88 for lack of usage
53  */
54  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
55  void setParameters(const QMap<QString, QStringList> &params);
56 #endif
57 
58 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
59  /**
60  * @deprecated Since 5.88 for lack of usage
61  */
62  Q_REQUIRED_RESULT
63  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
64  QMap<QString, QStringList> parameters() const;
65 #endif
66 
67  Q_REQUIRED_RESULT bool operator==(const FieldGroup &other) const;
68  Q_REQUIRED_RESULT bool operator!=(const FieldGroup &other) const;
69 
70  FieldGroup &operator=(const FieldGroup &other);
71 
72  Q_REQUIRED_RESULT QString toString() const;
73 
74 private:
75  void setParams(const ParameterMap &params);
76  Q_REQUIRED_RESULT ParameterMap params() const;
77 
78  class Private;
80 };
81 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const FieldGroup &object);
82 
83 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, FieldGroup &object);
84 }
85 Q_DECLARE_TYPEINFO(KContacts::FieldGroup, Q_MOVABLE_TYPE);
86 #endif // FIELDGROUP_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Class that holds a FieldGroup for a contact.
Definition: fieldgroup.h:26
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:49:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.