1 | /* |
2 | This file is part of the KContacts framework. |
3 | SPDX-FileCopyrightText: 2015-2019 Laurent Montel <montel@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef RELATED_H |
9 | #define RELATED_H |
10 | |
11 | #include "kcontacts_export.h" |
12 | |
13 | #include <QMap> |
14 | #include <QSharedDataPointer> |
15 | #include <QString> |
16 | |
17 | class RelatedTest; |
18 | |
19 | namespace KContacts |
20 | { |
21 | class ParameterMap; |
22 | |
23 | /*! |
24 | * \class KContacts::Related |
25 | * \inheaderfile KContacts/Related |
26 | * \inmodule KContacts |
27 | * |
28 | * \brief Describes a relationship of an Addressee. |
29 | */ |
30 | class KCONTACTS_EXPORT Related |
31 | { |
32 | friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Related &); |
33 | friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Related &); |
34 | friend class VCardTool; |
35 | friend class ::RelatedTest; |
36 | |
37 | public: |
38 | /*! |
39 | */ |
40 | Related(); |
41 | |
42 | Related(const Related &other); |
43 | |
44 | /*! |
45 | */ |
46 | Related(const QString &related); |
47 | |
48 | ~Related(); |
49 | |
50 | /*! |
51 | */ |
52 | typedef QList<Related> List; |
53 | |
54 | /*! |
55 | */ |
56 | void setRelated(const QString &relatedTo); |
57 | |
58 | /*! |
59 | */ |
60 | Q_REQUIRED_RESULT QString related() const; |
61 | |
62 | /*! |
63 | */ |
64 | Q_REQUIRED_RESULT bool isValid() const; |
65 | |
66 | /*! |
67 | */ |
68 | Q_REQUIRED_RESULT bool operator==(const Related &other) const; |
69 | |
70 | /*! |
71 | */ |
72 | Q_REQUIRED_RESULT bool operator!=(const Related &other) const; |
73 | |
74 | Related &operator=(const Related &other); |
75 | |
76 | /*! |
77 | */ |
78 | Q_REQUIRED_RESULT QString toString() const; |
79 | |
80 | private: |
81 | // exported for RelatedTest |
82 | void setParams(const ParameterMap ¶ms); |
83 | Q_REQUIRED_RESULT ParameterMap params() const; |
84 | |
85 | class Private; |
86 | QSharedDataPointer<Private> d; |
87 | }; |
88 | |
89 | /*! |
90 | * \relates KContacts::Related |
91 | */ |
92 | KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Related &object); |
93 | |
94 | /*! |
95 | * \relates KContacts::Related |
96 | */ |
97 | KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Related &object); |
98 | } |
99 | Q_DECLARE_TYPEINFO(KContacts::Related, Q_RELOCATABLE_TYPE); |
100 | #endif // LANG_H |
101 | |