KContacts

related.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2015-2019 Laurent Montel <[email protected]>
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 /** Describes a relationship of an Addressee. */
24 class KCONTACTS_EXPORT Related
25 {
26  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Related &);
27  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Related &);
28  friend class VCardTool;
29  friend class ::RelatedTest;
30 
31 public:
32  Related();
33  Related(const Related &other);
34  Related(const QString &related);
35 
36  ~Related();
37 
38  typedef QVector<Related> List;
39 
40  void setRelated(const QString &relatedTo);
41  Q_REQUIRED_RESULT QString related() const;
42 
43  Q_REQUIRED_RESULT bool isValid() const;
44 
45 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
46  /**
47  * @deprecated Since 5.88 for lack of usage
48  */
49  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
50  void setParameters(const QMap<QString, QStringList> &params);
51 #endif
52 
53 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
54  /**
55  * @deprecated Since 5.88 for lack of usage
56  */
57  Q_REQUIRED_RESULT
58  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
59  QMap<QString, QStringList> parameters() const;
60 #endif
61 
62  Q_REQUIRED_RESULT bool operator==(const Related &other) const;
63  Q_REQUIRED_RESULT bool operator!=(const Related &other) const;
64 
65  Related &operator=(const Related &other);
66 
67  Q_REQUIRED_RESULT QString toString() const;
68 
69 private:
70  // exported for RelatedTest
71  void setParams(const ParameterMap &params);
72  Q_REQUIRED_RESULT ParameterMap params() const;
73 
74  class Private;
76 };
77 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Related &object);
78 
79 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Related &object);
80 }
81 Q_DECLARE_TYPEINFO(KContacts::Related, Q_MOVABLE_TYPE);
82 #endif // LANG_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Describes a relationship of an Addressee.
Definition: related.h:24
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.