1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#include "person.h"
10
11using namespace Attica;
12
13class Q_DECL_HIDDEN Person::Private : public QSharedData
14{
15public:
16 QString m_id;
17 QString m_firstName;
18 QString m_lastName;
19 QDate m_birthday;
20 QString m_country;
21 qreal m_latitude;
22 qreal m_longitude;
23 QUrl m_avatarUrl;
24 QString m_homepage;
25 QString m_city;
26
27 QMap<QString, QString> m_extendedAttributes;
28
29 Private()
30 : m_latitude(0)
31 , m_longitude(0)
32 {
33 }
34};
35
36Person::Person()
37 : d(new Private)
38{
39}
40
41Person::Person(const Person &other)
42 : d(other.d)
43{
44}
45
46Person &Person::operator=(const Attica::Person &other)
47{
48 d = other.d;
49 return *this;
50}
51
52Person::~Person()
53{
54}
55
56void Person::setId(const QString &u)
57{
58 d->m_id = u;
59}
60
61QString Person::id() const
62{
63 return d->m_id;
64}
65
66void Person::setFirstName(const QString &name)
67{
68 d->m_firstName = name;
69}
70
71QString Person::firstName() const
72{
73 return d->m_firstName;
74}
75
76void Person::setLastName(const QString &name)
77{
78 d->m_lastName = name;
79}
80
81QString Person::lastName() const
82{
83 return d->m_lastName;
84}
85
86void Person::setBirthday(const QDate &date)
87{
88 d->m_birthday = date;
89}
90
91QDate Person::birthday() const
92{
93 return d->m_birthday;
94}
95
96void Person::setCountry(const QString &c)
97{
98 d->m_country = c;
99}
100
101QString Person::country() const
102{
103 return d->m_country;
104}
105
106void Person::setLatitude(qreal l)
107{
108 d->m_latitude = l;
109}
110
111qreal Person::latitude() const
112{
113 return d->m_latitude;
114}
115
116void Person::setLongitude(qreal l)
117{
118 d->m_longitude = l;
119}
120
121qreal Person::longitude() const
122{
123 return d->m_longitude;
124}
125
126void Person::setAvatarUrl(const QUrl &url)
127{
128 d->m_avatarUrl = url;
129}
130
131QUrl Person::avatarUrl() const
132{
133 return d->m_avatarUrl;
134}
135
136void Person::setHomepage(const QString &h)
137{
138 d->m_homepage = h;
139}
140
141QString Person::homepage() const
142{
143 return d->m_homepage;
144}
145
146void Person::setCity(const QString &h)
147{
148 d->m_city = h;
149}
150
151QString Person::city() const
152{
153 return d->m_city;
154}
155void Person::addExtendedAttribute(const QString &key, const QString &value)
156{
157 d->m_extendedAttributes.insert(key, value);
158}
159
160QString Person::extendedAttribute(const QString &key) const
161{
162 return d->m_extendedAttributes.value(key);
163}
164
165QMap<QString, QString> Person::extendedAttributes() const
166{
167 return d->m_extendedAttributes;
168}
169
170bool Person::isValid() const
171{
172 return !(d->m_id.isEmpty());
173}
174

source code of attica/src/person.cpp