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#ifndef ATTICA_EVENT_H
10#define ATTICA_EVENT_H
11
12#include "attica_export.h"
13
14#include <QDate>
15#include <QList>
16#include <QMap>
17#include <QSharedDataPointer>
18#include <QUrl>
19
20namespace Attica
21{
22/*!
23 * \class Attica::Event
24 * \inheaderfile Attica/Event
25 * \inmodule Attica
26 *
27 * \brief Represents a single event.
28 */
29class ATTICA_EXPORT Event
30{
31public:
32 /*!
33 *
34 */
35 typedef QList<Event> List;
36 class Parser;
37
38 /*!
39 * Creates an empty Event
40 */
41 Event();
42
43 Event(const Event &other);
44
45 Event &operator=(const Event &other);
46
47 ~Event();
48
49 /*!
50 * Sets the id of the Event.
51 *
52 * The id uniquely identifies a Event with the OCS API.
53 *
54 * \a id the new id
55 */
56 void setId(const QString &id);
57
58 /*!
59 * Returns the id of the Event.
60 *
61 * The id uniquely identifies a Event with the OCS API.
62 */
63 QString id() const;
64
65 /*!
66 * Sets the name of the Event.
67 *
68 * \a name the new name
69 */
70 void setName(const QString &name);
71
72 /*!
73 * Returns the name of the Event.
74 */
75 QString name() const;
76
77 /*!
78 * Sets the description of the Event.
79 *
80 * \a description the new description
81 */
82 void setDescription(const QString &description);
83
84 /*!
85 * Returns the description of the Event.
86 */
87 QString description() const;
88
89 /*!
90 * Sets the id of the user bound to the Event.
91 *
92 * \a user the new user id
93 */
94 void setUser(const QString &user);
95
96 /*!
97 * Returns the id of the user bound to the Event.
98 */
99 QString user() const;
100
101 /*!
102 * Sets the start date of the Event.
103 *
104 * \a startDate the start date
105 */
106 void setStartDate(const QDate &startDate);
107
108 /*!
109 * Returns the start date of the Event.
110 */
111 QDate startDate() const;
112
113 /*!
114 * Sets the end date of the Event.
115 *
116 * \a endDate the end date
117 */
118 void setEndDate(const QDate &endDate);
119
120 /*!
121 * Returns the start date of the Event.
122 */
123 QDate endDate() const;
124
125 /*!
126 * Sets the latitude of the position the Event takes place.
127 */
128 void setLatitude(qreal latitude);
129
130 /*!
131 * Returns the latitude of the position the Event takes place.
132 */
133 qreal latitude() const;
134
135 /*!
136 * Sets the longitude of the position the Event takes place.
137 */
138 void setLongitude(qreal longitude);
139
140 /*!
141 * Returns the longitude of the position the Event takes place.
142 */
143 qreal longitude() const;
144
145 /*!
146 * Sets the homepage of the Event.
147 *
148 * \a homepage the new homepage
149 */
150 void setHomepage(const QUrl &homepage);
151
152 /*!
153 * Returns the homepage of the Event.
154 */
155 QUrl homepage() const;
156
157 /*!
158 * Sets the country where the Event takes place.
159 *
160 * \a country the new country
161 */
162 void setCountry(const QString &country);
163
164 /*!
165 * Returns the country where the Event takes place.
166 */
167 QString country() const;
168
169 /*!
170 * Sets the city where the Event takes place.
171 *
172 * \a city the new city
173 */
174 void setCity(const QString &city);
175
176 /*!
177 * Returns the city where the Event takes place.
178 */
179 QString city() const;
180
181 /*!
182 * Add an attribute that is not included in the basis set of attributes exposed by the Event class.
183 *
184 * If the attribute already exists it gets overwritten.
185 *
186 * \a key the key of the attribute
187 *
188 * \a value the value of the attribute
189 */
190 void addExtendedAttribute(const QString &key, const QString &value);
191
192 /*!
193 * Get an attribute that is not included in the basis set of attributes exposed by the Event class.
194 *
195 * \a key the key of the attribute
196 *
197 * Returns the value of the attribute with the specified key, or an empty string, if the key has not been found
198 */
199 QString extendedAttribute(const QString &key) const;
200
201 /*!
202 * Get all attributes that are not included in the basis set of attributes exposed by the Event class.
203 */
204 QMap<QString, QString> extendedAttributes() const;
205
206 /*!
207 * Checks whether this Event has an id
208 */
209 bool isValid() const;
210
211private:
212 class Private;
213 QSharedDataPointer<Private> d;
214};
215
216}
217
218#endif
219

source code of attica/src/event.h