• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • kcalcore
event.h
Go to the documentation of this file.
1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
28#ifndef KCALCORE_EVENT_H
29#define KCALCORE_EVENT_H
30
31#include "kcalcore_export.h"
32#include "incidence.h"
33#include "supertrait.h"
34
35namespace KCalCore {
36
41class KCALCORE_EXPORT Event : public Incidence
42{
43public:
47 enum Transparency {
48 Opaque,
49 Transparent
50 };
51
55 typedef QSharedPointer<Event> Ptr;
56
60 typedef QVector<Ptr> List;
61
65 Event();
66
71 Event(const Event &other);
72
79 Event(const Incidence &other);
80
84 ~Event();
85
90 IncidenceType type() const;
91
96 QByteArray typeStr() const;
97
101 Event *clone() const;
102
109 virtual void setDtStart(const KDateTime &dt);
110
119 void setDtEnd(const KDateTime &dtEnd);
120
128 virtual KDateTime dtEnd() const;
129
135 QDate dateEnd() const;
136
142 KCALCORE_DEPRECATED void setHasEndDate(bool b);
143
147 bool hasEndDate() const;
148
159 bool isMultiDay(const KDateTime::Spec &spec = KDateTime::Spec()) const;
160
165 virtual void shiftTimes(const KDateTime::Spec &oldSpec,
166 const KDateTime::Spec &newSpec);
167
172 void setTransparency(Transparency transparency);
173
177 Transparency transparency() const;
178
183 void setDuration(const Duration &duration);
184
189 void setAllDay(bool allDay);
190
195 KDateTime dateTime(DateTimeRole role) const;
196
201 void setDateTime(const KDateTime &dateTime, DateTimeRole role);
202
207 QLatin1String mimeType() const;
208
213 QLatin1String iconName(const KDateTime &recurrenceId = KDateTime()) const;
214
218 static QLatin1String eventMimeType();
219
220protected:
225 virtual bool equals(const IncidenceBase &event) const;
226
231 virtual IncidenceBase &assign(const IncidenceBase &other);
232
237 virtual void virtual_hook(int id, void *data);
238
239private:
244 bool accept(Visitor &v, IncidenceBase::Ptr incidence);
245
252 Event &operator=(const Event &other);
253
254 // For polymorfic serialization
255 void serialize(QDataStream &out);
256 void deserialize(QDataStream &in);
257
258 //@cond PRIVATE
259 class Private;
260 Private *const d;
261 //@endcond
262};
263
264} // namespace KCalCore
265
266//@cond PRIVATE
267Q_DECLARE_TYPEINFO(KCalCore::Event::Ptr, Q_MOVABLE_TYPE);
268Q_DECLARE_METATYPE(KCalCore::Event::Ptr)
269//@endcond
270
271//@cond PRIVATE
272namespace KPIMUtils {
273// super class trait specialization
274template <> struct SuperClass<KCalCore::Event> : public SuperClassTrait<KCalCore::Incidence> {};
275}
276//@endcond
277
278#endif
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition duration.h:56
KCalCore::Event::isMultiDay
bool isMultiDay(const KDateTime::Spec &spec=KDateTime::Spec()) const
Returns true if the event spans multiple days, otherwise return false.
Definition event.cpp:198
KCalCore::Event::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition event.cpp:329
KCalCore::Event::type
IncidenceType type() const
Definition event.cpp:122
KCalCore::Event::setDtStart
virtual void setDtStart(const KDateTime &dt)
Sets the incidence starting date/time.
Definition event.cpp:132
KCalCore::Event::typeStr
QByteArray typeStr() const
Definition event.cpp:127
KCalCore::Event::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Definition event.cpp:233
KCalCore::Event::iconName
QLatin1String iconName(const KDateTime &recurrenceId=KDateTime()) const
Definition event.cpp:353
KCalCore::Event::clone
Event * clone() const
Returns an exact copy of this Event.
Definition event.cpp:92
KCalCore::Event::Transparency
Transparency
The different Event transparency types.
Definition event.h:47
KCalCore::Event::Transparent
@ Transparent
Event does not appear in free/busy time.
Definition event.h:49
KCalCore::Event::Opaque
@ Opaque
Event appears in free/busy time.
Definition event.h:48
KCalCore::Event::setDtEnd
void setDtEnd(const KDateTime &dtEnd)
Sets the event end date and time.
Definition event.cpp:138
KCalCore::Event::dtEnd
virtual KDateTime dtEnd() const
Returns the event end date and time.
Definition event.cpp:156
KCalCore::Event::setDateTime
void setDateTime(const KDateTime &dateTime, DateTimeRole role)
Definition event.cpp:310
KCalCore::Event::setDuration
void setDuration(const Duration &duration)
Sets the duration of this event.
Definition event.cpp:259
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
A shared pointer to an Event object.
Definition event.h:55
KCalCore::Event::setTransparency
void setTransparency(Transparency transparency)
Sets the event's time transparency level.
Definition event.cpp:243
KCalCore::Event::Event
Event()
Constructs an event.
Definition event.cpp:71
KCalCore::Event::List
QVector< Ptr > List
List of events.
Definition event.h:60
KCalCore::Event::dateEnd
QDate dateEnd() const
Returns the date when the event ends.
Definition event.cpp:177
KCalCore::Event::transparency
Transparency transparency() const
Returns the event's time transparency level.
Definition event.cpp:254
KCalCore::Event::dateTime
KDateTime dateTime(DateTimeRole role) const
Definition event.cpp:278
KCalCore::Event::setAllDay
void setAllDay(bool allDay)
Definition event.cpp:265
KCalCore::Event::setHasEndDate
KCALCORE_DEPRECATED void setHasEndDate(bool b)
Sets whether the event has an end date/time.
Definition event.cpp:187
KCalCore::Event::mimeType
QLatin1String mimeType() const
Definition event.cpp:343
KCalCore::Event::eventMimeType
static QLatin1String eventMimeType()
Returns the Akonadi specific sub MIME type of a KCalCore::Event.
Definition event.cpp:348
KCalCore::Event::hasEndDate
bool hasEndDate() const
Returns whether the event has an end date/time.
Definition event.cpp:193
KCalCore::Event::assign
virtual IncidenceBase & assign(const IncidenceBase &other)
Definition event.cpp:97
KCalCore::Event::equals
virtual bool equals(const IncidenceBase &event) const
Compares two events for equality.
Definition event.cpp:107
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes.
Definition incidencebase.h:110
KCalCore::IncidenceBase::allDay
bool allDay() const
Returns true or false depending on whether the incidence is all-day.
Definition incidencebase.cpp:326
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition incidencebase.h:121
KCalCore::IncidenceBase::duration
Duration duration() const
Returns the length of the incidence duration.
Definition incidencebase.cpp:555
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition incidencebase.h:115
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition incidencebase.h:133
KCalCore::Incidence::recurrenceId
KDateTime recurrenceId() const
Returns the incidence recurrenceId.
Definition incidence.cpp:1039
KCalCore::Incidence::Incidence
Incidence()
Constructs an empty incidence.
Definition incidence.cpp:182
KCalCore::Visitor
This class provides the interface for a visitor of calendar components.
Definition visitor.h:44
incidence.h
This file is part of the API for handling calendar data and defines the Incidence class.
KCalCore
TODO: KDE5:
Definition alarm.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal