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

source code of kcontacts/src/org.h