Attica

event.cpp
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
37 : d(new Private)
38{
39}
40
41Event::Event(const Event &other)
42 : d(other.d)
43{
44}
45
47{
48 d = other.d;
49 return *this;
50}
51
53{
54}
55
56void Event::setId(const QString &id)
57{
58 d->m_id = id;
59}
60
62{
63 return d->m_id;
64}
65
66void Event::setName(const QString &name)
67{
68 d->m_name = name;
69}
70
72{
73 return d->m_name;
74}
75
77{
78 d->m_description = text;
79}
80
82{
83 return d->m_description;
84}
85
86void Event::setUser(const QString &id)
87{
88 d->m_user = id;
89}
90
92{
93 return d->m_user;
94}
95
96void Event::setStartDate(const QDate &date)
97{
98 d->m_startDate = date;
99}
100
102{
103 return d->m_startDate;
104}
105
106void Event::setEndDate(const QDate &date)
107{
108 d->m_endDate = date;
109}
110
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
142{
143 return d->m_homepage;
144}
145
146void Event::setCountry(const QString &country)
147{
148 d->m_country = country;
149}
150
152{
153 return d->m_country;
154}
155
156void Event::setCity(const QString &city)
157{
158 d->m_city = city;
159}
160
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
172{
173 return d->m_extendedAttributes.value(key);
174}
175
177{
178 return d->m_extendedAttributes;
179}
180
181bool Event::isValid() const
182{
183 return !(d->m_id.isEmpty());
184}
Represents a single event.
Definition event.h:28
QString description() const
Gets the description of the Event.
Definition event.cpp:81
qreal longitude() const
Gets the longitude of the position the Event takes place.
Definition event.cpp:131
QString name() const
Gets the name of the Event.
Definition event.cpp:71
void addExtendedAttribute(const QString &key, const QString &value)
Add an attribute that is not included in the basis set of attributes exposed by the Event class.
Definition event.cpp:166
void setId(const QString &id)
Sets the id of the Event.
Definition event.cpp:56
QString country() const
Gets the country where the Event takes place.
Definition event.cpp:151
QMap< QString, QString > extendedAttributes() const
Get all attributes that are not included in the basis set of attributes exposed by the Event class.
Definition event.cpp:176
QString extendedAttribute(const QString &key) const
Get an attribute that is not included in the basis set of attributes exposed by the Event class.
Definition event.cpp:171
Event()
Creates an empty Event.
Definition event.cpp:36
void setCity(const QString &city)
Sets the city where the Event takes place.
Definition event.cpp:156
void setHomepage(const QUrl &homepage)
Sets the homepage of the Event.
Definition event.cpp:136
void setEndDate(const QDate &endDate)
Sets the end date of the Event.
Definition event.cpp:106
void setCountry(const QString &country)
Sets the country where the Event takes place.
Definition event.cpp:146
~Event()
Destructor.
Definition event.cpp:52
QString user() const
Gets the id of the user bound to the Event.
Definition event.cpp:91
void setUser(const QString &user)
Sets the id of the user bound to the Event.
Definition event.cpp:86
void setLongitude(qreal longitude)
Sets the longitude of the position the Event takes place.
Definition event.cpp:126
Event & operator=(const Event &other)
Assignment operator.
Definition event.cpp:46
void setLatitude(qreal latitude)
Sets the latitude of the position the Event takes place.
Definition event.cpp:116
QDate startDate() const
Gets the start date of the Event.
Definition event.cpp:101
void setStartDate(const QDate &startDate)
Sets the start date of the Event.
Definition event.cpp:96
qreal latitude() const
Gets the latitude of the position the Event takes place.
Definition event.cpp:121
QString city() const
Gets the city where the Event takes place.
Definition event.cpp:161
void setName(const QString &name)
Sets the name of the Event.
Definition event.cpp:66
void setDescription(const QString &description)
Sets the description of the Event.
Definition event.cpp:76
QDate endDate() const
Gets the start date of the Event.
Definition event.cpp:111
QUrl homepage() const
Gets the homepage of the Event.
Definition event.cpp:141
bool isValid() const
Checks whether this Event has an id.
Definition event.cpp:181
QString id() const
Gets the id of the Event.
Definition event.cpp:61
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:48 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.