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

source code of kcontacts/src/nickname.h