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 NOTE_H |
9 | #define NOTE_H |
10 | |
11 | #include "kcontacts_export.h" |
12 | |
13 | #include <QMap> |
14 | #include <QSharedDataPointer> |
15 | #include <QString> |
16 | |
17 | namespace KContacts |
18 | { |
19 | class ParameterMap; |
20 | |
21 | /*! |
22 | * \class KContacts::Note |
23 | * \inheaderfile KContacts/Note |
24 | * \inmodule KContacts |
25 | * |
26 | * \brief Class that holds a Note for a contact. |
27 | * \since 5.3 |
28 | */ |
29 | class KCONTACTS_EXPORT Note |
30 | { |
31 | friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Note &); |
32 | friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Note &); |
33 | friend class VCardTool; |
34 | |
35 | public: |
36 | /*! |
37 | */ |
38 | Note(); |
39 | |
40 | Note(const Note &other); |
41 | |
42 | /*! |
43 | */ |
44 | Note(const QString ¬e); |
45 | |
46 | ~Note(); |
47 | |
48 | /*! |
49 | */ |
50 | typedef QList<Note> List; |
51 | |
52 | /*! |
53 | */ |
54 | void setNote(const QString ¬e); |
55 | |
56 | /*! |
57 | */ |
58 | Q_REQUIRED_RESULT QString note() const; |
59 | |
60 | /*! |
61 | */ |
62 | Q_REQUIRED_RESULT bool isValid() const; |
63 | |
64 | /*! |
65 | */ |
66 | Q_REQUIRED_RESULT bool operator==(const Note &other) const; |
67 | |
68 | /*! |
69 | */ |
70 | Q_REQUIRED_RESULT bool operator!=(const Note &other) const; |
71 | |
72 | Note &operator=(const Note &other); |
73 | |
74 | /*! |
75 | */ |
76 | Q_REQUIRED_RESULT QString toString() const; |
77 | |
78 | private: |
79 | KCONTACTS_NO_EXPORT void setParams(const ParameterMap ¶ms); |
80 | Q_REQUIRED_RESULT KCONTACTS_NO_EXPORT ParameterMap params() const; |
81 | |
82 | class Private; |
83 | QSharedDataPointer<Private> d; |
84 | }; |
85 | |
86 | /*! |
87 | * \relates KContacts::Note |
88 | */ |
89 | KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Note &object); |
90 | |
91 | /*! |
92 | * \relates KContacts::Note |
93 | */ |
94 | KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Note &object); |
95 | } |
96 | Q_DECLARE_TYPEINFO(KContacts::Note, Q_RELOCATABLE_TYPE); |
97 | #endif // NOTE_H |
98 | |