KCalendarCore

event.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
15 #ifndef KCALCORE_EVENT_H
16 #define KCALCORE_EVENT_H
17 
18 #include "kcalendarcore_export.h"
19 #include "incidence.h"
20 
21 #include <QTimeZone>
22 
23 namespace KCalendarCore
24 {
25 
30 class KCALENDARCORE_EXPORT Event : public Incidence
31 {
32  Q_GADGET
33  Q_PROPERTY(QDateTime dtEnd READ dtEnd WRITE setDtEnd)
34  Q_PROPERTY(KCalendarCore::Event::Transparency transparency READ transparency WRITE setTransparency)
35 public:
39  enum Transparency {
41  Transparent
42  };
43  Q_ENUM(Transparency)
44 
45 
49 
53  typedef QVector<Ptr> List;
54 
56  // needed for Akonadi polymorphic payload support
57  typedef Incidence SuperClass;
59 
63  Event();
64 
69  Event(const Event &other);
70 
77  Event(const Incidence &other); //krazy:exclude=explicit (copy ctor)
78 
82  ~Event() override;
83 
88  Q_REQUIRED_RESULT IncidenceType type() const override;
89 
94  Q_REQUIRED_RESULT QByteArray typeStr() const override;
95 
99  Event *clone() const override;
100 
107  void setDtStart(const QDateTime &dt) override;
108 
117  void setDtEnd(const QDateTime &dtEnd);
118 
126  virtual QDateTime dtEnd() const;
127 
133  Q_REQUIRED_RESULT QDate dateEnd() const;
134 
138  Q_REQUIRED_RESULT bool hasEndDate() const;
139 
150  Q_REQUIRED_RESULT bool isMultiDay(const QTimeZone &zone = {}) const;
151 
156  void shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone) override;
157 
162  void setTransparency(Transparency transparency);
163 
167  Q_REQUIRED_RESULT Transparency transparency() const;
168 
173  void setDuration(const Duration &duration) override;
174 
179  void setAllDay(bool allDay) override;
180 
185  Q_REQUIRED_RESULT QDateTime dateTime(DateTimeRole role) const override;
186 
191  void setDateTime(const QDateTime &dateTime, DateTimeRole role) override;
192 
197  Q_REQUIRED_RESULT QLatin1String mimeType() const override;
198 
203  Q_REQUIRED_RESULT QLatin1String iconName(const QDateTime &recurrenceId = {}) const override;
204 
209  Q_REQUIRED_RESULT bool supportsGroupwareCommunication() const override;
210 
214  Q_REQUIRED_RESULT static QLatin1String eventMimeType();
215 
216 protected:
221  bool equals(const IncidenceBase &event) const override;
222 
227  IncidenceBase &assign(const IncidenceBase &other) override;
228 
233  void virtual_hook(VirtualHook id, void *data) override;
234 
235 private:
240  bool accept(Visitor &v, const IncidenceBase::Ptr &incidence) override;
241 
248  Event &operator=(const Event &other);
249 
250  // For polymorfic serialization
251  void serialize(QDataStream &out) const override;
252  void deserialize(QDataStream &in) override;
253 
254  //@cond PRIVATE
255  class Private;
256  Private *const d;
257  //@endcond
258 };
259 
260 } // namespace KCalendarCore
261 
262 //@cond PRIVATE
263 Q_DECLARE_TYPEINFO(KCalendarCore::Event::Ptr, Q_MOVABLE_TYPE);
264 Q_DECLARE_METATYPE(KCalendarCore::Event::Ptr)
265 Q_DECLARE_METATYPE(KCalendarCore::Event *)
266 //@endcond
267 
268 #endif
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:31
DateTimeRole
The different types of incidence date/times roles.
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:96
Represents a span of time measured in seconds or days.
Definition: duration.h:44
This class provides an Event in the sense of RFC2445.
Definition: event.h:30
Event appears in free/busy time.
Definition: event.h:40
IncidenceType
The different types of incidences, per RFC2445.
Transparency
The different Event transparency types.
Definition: event.h:39
This file is part of the API for handling calendar data and defines the Incidence class...
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:57
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Dec 5 2020 22:51:08 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.