1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2009 Eckhart Wörner <ewoerner@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 "event.h"
10
11using namespace Attica;
12
13class Q_DECL_HIDDEN Event::Private : public QSharedData
14{
15public:
16 QString m_id;
17 QString m_name;
18 QString m_description;
19 QString m_user;
20 QDate m_startDate;
21 QDate m_endDate;
22 qreal m_latitude;
23 qreal m_longitude;
24 QUrl m_homepage;
25 QString m_country;
26 QString m_city;
27 QMap<QString, QString> m_extendedAttributes;
28
29 Private()
30 : m_latitude(0)
31 , m_longitude(0)
32 {
33 }
34};
35
36Event::Event()
37 : d(new Private)
38{
39}
40
41Event::Event(const Event &other)
42 : d(other.d)
43{
44}
45
46Event &Event::operator=(const Event &other)
47{
48 d = other.d;
49 return *this;
50}
51
52Event::~Event()
53{
54}
55
56void Event::setId(const QString &id)
57{
58 d->m_id = id;
59}
60
61QString Event::id() const
62{
63 return d->m_id;
64}
65
66void Event::setName(const QString &name)
67{
68 d->m_name = name;
69}
70
71QString Event::name() const
72{
73 return d->m_name;
74}
75
76void Event::setDescription(const QString &text)
77{
78 d->m_description = text;
79}
80
81QString Event::description() const
82{
83 return d->m_description;
84}
85
86void Event::setUser(const QString &id)
87{
88 d->m_user = id;
89}
90
91QString Event::user() const
92{
93 return d->m_user;
94}
95
96void Event::setStartDate(const QDate &date)
97{
98 d->m_startDate = date;
99}
100
101QDate Event::startDate() const
102{
103 return d->m_startDate;
104}
105
106void Event::setEndDate(const QDate &date)
107{
108 d->m_endDate = date;
109}
110
111QDate Event::endDate() const
112{
113 return d->m_endDate;
114}
115
116void Event::setLatitude(qreal lat)
117{
118 d->m_latitude = lat;
119}
120
121qreal Event::latitude() const
122{
123 return d->m_latitude;
124}
125
126void Event::setLongitude(qreal lon)
127{
128 d->m_longitude = lon;
129}
130
131qreal Event::longitude() const
132{
133 return d->m_longitude;
134}
135
136void Event::setHomepage(const QUrl &url)
137{
138 d->m_homepage = url;
139}
140
141QUrl Event::homepage() const
142{
143 return d->m_homepage;
144}
145
146void Event::setCountry(const QString &country)
147{
148 d->m_country = country;
149}
150
151QString Event::country() const
152{
153 return d->m_country;
154}
155
156void Event::setCity(const QString &city)
157{
158 d->m_city = city;
159}
160
161QString Event::city() const
162{
163 return d->m_city;
164}
165
166void Event::addExtendedAttribute(const QString &key, const QString &value)
167{
168 d->m_extendedAttributes.insert(key, value);
169}
170
171QString Event::extendedAttribute(const QString &key) const
172{
173 return d->m_extendedAttributes.value(key);
174}
175
176QMap<QString, QString> Event::extendedAttributes() const
177{
178 return d->m_extendedAttributes;
179}
180
181bool Event::isValid() const
182{
183 return !(d->m_id.isEmpty());
184}
185

source code of attica/src/event.cpp