| 1 | /* |
| 2 | This file is part of the KContacts framework. |
| 3 | SPDX-FileCopyrightText: 2016-2019 Laurent Montel <montel@kde.org> |
| 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 | /*! |
| 24 | * \class KContacts::FieldGroup |
| 25 | * \inheaderfile KContacts/FieldGroup |
| 26 | * \inmodule KContacts |
| 27 | * |
| 28 | * \brief Class that holds a FieldGroup for a contact. |
| 29 | * \since 5.3 |
| 30 | */ |
| 31 | class KCONTACTS_EXPORT FieldGroup |
| 32 | { |
| 33 | friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const FieldGroup &); |
| 34 | friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, FieldGroup &); |
| 35 | friend class VCardTool; |
| 36 | friend class ::FieldGroupTest; |
| 37 | |
| 38 | public: |
| 39 | /*! |
| 40 | */ |
| 41 | FieldGroup(); |
| 42 | |
| 43 | FieldGroup(const FieldGroup &other); |
| 44 | |
| 45 | /*! |
| 46 | */ |
| 47 | FieldGroup(const QString &fieldGroupName); |
| 48 | |
| 49 | ~FieldGroup(); |
| 50 | |
| 51 | typedef QList<FieldGroup> List; |
| 52 | |
| 53 | /*! |
| 54 | */ |
| 55 | void setFieldGroupName(const QString &fieldGroup); |
| 56 | |
| 57 | /*! |
| 58 | */ |
| 59 | Q_REQUIRED_RESULT QString fieldGroupName() const; |
| 60 | |
| 61 | /*! |
| 62 | */ |
| 63 | Q_REQUIRED_RESULT bool isValid() const; |
| 64 | |
| 65 | /*! |
| 66 | */ |
| 67 | void setValue(const QString &value); |
| 68 | |
| 69 | /*! |
| 70 | */ |
| 71 | Q_REQUIRED_RESULT QString value() const; |
| 72 | |
| 73 | /*! |
| 74 | */ |
| 75 | Q_REQUIRED_RESULT bool operator==(const FieldGroup &other) const; |
| 76 | |
| 77 | /*! |
| 78 | */ |
| 79 | Q_REQUIRED_RESULT bool operator!=(const FieldGroup &other) const; |
| 80 | |
| 81 | FieldGroup &operator=(const FieldGroup &other); |
| 82 | |
| 83 | /*! |
| 84 | */ |
| 85 | Q_REQUIRED_RESULT QString toString() const; |
| 86 | |
| 87 | private: |
| 88 | void setParams(const ParameterMap ¶ms); |
| 89 | Q_REQUIRED_RESULT ParameterMap params() const; |
| 90 | |
| 91 | class Private; |
| 92 | QSharedDataPointer<Private> d; |
| 93 | }; |
| 94 | |
| 95 | /*! |
| 96 | * \relates KContacts::FieldGroup |
| 97 | */ |
| 98 | KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const FieldGroup &object); |
| 99 | |
| 100 | /*! |
| 101 | * \relates KContacts::FieldGroup |
| 102 | */ |
| 103 | KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, FieldGroup &object); |
| 104 | } |
| 105 | Q_DECLARE_TYPEINFO(KContacts::FieldGroup, Q_RELOCATABLE_TYPE); |
| 106 | #endif // FIELDGROUP_H |
| 107 | |