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

KCalCore Library

  • kcalcore
incidencebase.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 Copyright (c) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
8 Contact: Alvaro Manera <alvaro.manera@nokia.com>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19
20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA.
24*/
56#ifndef KCALCORE_INCIDENCEBASE_H
57#define KCALCORE_INCIDENCEBASE_H
58
59#include "attendee.h"
60#include "customproperties.h"
61#include "duration.h"
62#include "sortablelist.h"
63
64#include <KDE/KDateTime>
65
66#include <QtCore/QSet>
67#include <QtCore/QUrl>
68#include <QDataStream>
69
70class KUrl;
71class QDate;
72
73namespace KCalCore {
74
76typedef SortableList<QDate> DateList;
77
79typedef SortableList<KDateTime> DateTimeList;
80
81class Event;
82class Todo;
83class Journal;
84class FreeBusy;
85class Visitor;
86
109class KCALCORE_EXPORT IncidenceBase : public CustomProperties
110{
111public:
115 typedef QSharedPointer<IncidenceBase> Ptr;
116
121 enum IncidenceType {
122 TypeEvent = 0,
123 TypeTodo,
124 TypeJournal,
125 TypeFreeBusy,
126 TypeUnknown
127 };
128
133 enum DateTimeRole {
134 RoleAlarmStartOffset = 0,
135 RoleAlarmEndOffset,
136 RoleSort,
137 RoleCalendarHashing,
138 RoleStartTimeZone,
139 RoleEndTimeZone,
140 RoleEndRecurrenceBase,
141 RoleEnd,
143 RoleDisplayEnd,
145 RoleAlarm,
147 RoleRecurrenceStart,
152 RoleDisplayStart,
154 RoleDnD
155 };
156
160 enum Field {
161 FieldDtStart,
162 FieldDtEnd,
163 FieldLastModified,
164 FieldDescription,
165 FieldSummary,
166 FieldLocation,
167 FieldCompleted,
168 FieldPercentComplete,
169 FieldDtDue,
170 FieldCategories,
171 FieldRelatedTo,
172 FieldRecurrence,
173 FieldAttachment,
174 FieldSecrecy,
175 FieldStatus,
176 FieldTransparency,
177 FieldResources,
178 FieldPriority,
179 FieldGeoLatitude,
180 FieldGeoLongitude,
181 FieldRecurrenceId,
182 FieldAlarms,
183 FieldSchedulingId,
184 FieldAttendees,
185 FieldOrganizer,
186 FieldCreated,
187 FieldRevision,
188 FieldDuration,
189 FieldContact,
190 FieldComment,
191 FieldUid,
192 FieldUnknown,
193 FieldUrl
194 };
195
199 class KCALCORE_EXPORT IncidenceObserver
200 {
201 public:
202
206 virtual ~IncidenceObserver();
207
214 virtual void incidenceUpdate(const QString &uid, const KDateTime &recurrenceId) = 0;
215
222 virtual void incidenceUpdated(const QString &uid, const KDateTime &recurrenceId) = 0;
223 };
224
228 IncidenceBase();
229
233 virtual ~IncidenceBase();
234
252 IncidenceBase &operator=(const IncidenceBase &other);
253
260 bool operator==(const IncidenceBase &ib) const;
261
267 bool operator!=(const IncidenceBase &ib) const;
268
279 virtual bool accept(Visitor &v, IncidenceBase::Ptr incidence);
280
284 virtual IncidenceType type() const = 0;
285
289 virtual QByteArray typeStr() const = 0;
290
296 void setUid(const QString &uid);
297
302 QString uid() const;
303
307 KUrl uri() const;
308
317 virtual void setLastModified(const KDateTime &lm);
318
323 KDateTime lastModified() const;
324
331 void setOrganizer(const Person::Ptr &organizer);
332
339 void setOrganizer(const QString &organizer);
340
347 Person::Ptr organizer() const;
348
356 virtual void setReadOnly(bool readOnly);
357
362 bool isReadOnly() const;
363
372 virtual void setDtStart(const KDateTime &dtStart);
373
378 virtual KDateTime dtStart() const;
379
387 virtual void setDuration(const Duration &duration);
388
393 Duration duration() const;
394
400 void setHasDuration(bool hasDuration);
401
406 bool hasDuration() const;
407
413 bool allDay() const;
414
423 void setAllDay(bool allDay);
424
439 virtual void shiftTimes(const KDateTime::Spec &oldSpec,
440 const KDateTime::Spec &newSpec);
441
449 void addComment(const QString &comment);
450
459 bool removeComment(const QString &comment);
460
464 void clearComments();
465
469 QStringList comments() const;
470
478 void addContact(const QString &contact);
479
488 bool removeContact(const QString &contact);
489
493 void clearContacts();
494
498 QStringList contacts() const;
499
507 void addAttendee(const Attendee::Ptr &attendee,
508 bool doUpdate = true);
509
513 void clearAttendees();
514
523 void deleteAttendee(const Attendee::Ptr &attendee,
524 bool doUpdate = true);
525
530 Attendee::List attendees() const;
531
535 int attendeeCount() const;
536
544 Attendee::Ptr attendeeByMail(const QString &email) const;
545
556 Attendee::Ptr attendeeByMails(const QStringList &emails,
557 const QString &email = QString()) const;
558
565 Attendee::Ptr attendeeByUid(const QString &uid) const;
566
577 void setUrl(const QUrl &url);
578
585 QUrl url() const;
586
595 void registerObserver(IncidenceObserver *observer);
596
604 void unRegisterObserver(IncidenceObserver *observer);
605
610 void update();
611
616 void updated();
617
623 void startUpdates();
624
630 void endUpdates();
631
636 virtual KDateTime dateTime(DateTimeRole role) const = 0;
637
643 virtual void setDateTime(const KDateTime &dateTime, DateTimeRole role) = 0;
644
649 virtual QLatin1String mimeType() const = 0;
650
656 virtual KDateTime recurrenceId() const;
657
664 QSet<IncidenceBase::Field> dirtyFields() const;
665
671 void setDirtyFields(const QSet<IncidenceBase::Field> &);
672
677 void resetDirtyFields();
678
684 static quint32 magicSerializationIdentifier();
685
686protected:
687
693 void setFieldDirty(IncidenceBase::Field field);
694
699 virtual void customPropertyUpdate();
700
705 virtual void customPropertyUpdated();
706
711 IncidenceBase(const IncidenceBase &ib);
712
720 virtual bool equals(const IncidenceBase &incidenceBase) const;
721
726 virtual IncidenceBase &assign(const IncidenceBase &other);
727
736 virtual void virtual_hook(int id, void *data) = 0;
737
738 enum VirtualHook {
739 SerializerHook,
740 DeserializerHook
741 };
742
746 bool mReadOnly;
747
748private:
749 //@cond PRIVATE
750 class Private;
751 Private *const d;
752 //@endcond
753
754 friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream,
755 const KCalCore::IncidenceBase::Ptr &);
756
757 friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream,
758 const KCalCore::IncidenceBase::Ptr &);
759};
760
769KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalCore::IncidenceBase::Ptr &);
770
779KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, const KCalCore::IncidenceBase::Ptr &);
780
781}
782
783Q_DECLARE_METATYPE(KCalCore::IncidenceBase *)
784Q_DECLARE_METATYPE(KCalCore::IncidenceBase::Ptr)
785
786#endif
attendee.h
This file is part of the API for handling calendar data and defines the Attendee class.
KCalCore::Attendee::List
QVector< Ptr > List
List of attendees.
Definition: attendee.h:118
KCalCore::Attendee::Ptr
QSharedPointer< Attendee > Ptr
A shared pointer to an Attendee object.
Definition: attendee.h:113
KCalCore::CustomProperties
A class to manage custom calendar properties.
Definition: customproperties.h:52
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:56
KCalCore::Event
This class provides an Event in the sense of RFC2445.
Definition: event.h:42
KCalCore::FreeBusy
Provides information about the free/busy time of a calendar.
Definition: freebusy.h:53
KCalCore::IncidenceBase::IncidenceObserver
The IncidenceObserver class.
Definition: incidencebase.h:200
KCalCore::IncidenceBase::IncidenceObserver::incidenceUpdate
virtual void incidenceUpdate(const QString &uid, const KDateTime &recurrenceId)=0
The IncidenceObserver interface.
KCalCore::IncidenceBase::IncidenceObserver::incidenceUpdated
virtual void incidenceUpdated(const QString &uid, const KDateTime &recurrenceId)=0
The IncidenceObserver interface.
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes.
Definition: incidencebase.h:110
KCalCore::IncidenceBase::operator>>
friend KCALCORE_EXPORT QDataStream & operator>>(QDataStream &stream, const KCalCore::IncidenceBase::Ptr &)
Incidence deserializer.
KCalCore::IncidenceBase::virtual_hook
virtual void virtual_hook(int id, void *data)=0
KCalCore::IncidenceBase::setDateTime
virtual void setDateTime(const KDateTime &dateTime, DateTimeRole role)=0
Sets the date/time corresponding to the specified DateTimeRole.
KCalCore::IncidenceBase::mimeType
virtual QLatin1String mimeType() const =0
Returns the Akonadi specific sub MIME type of a KCalCore::IncidenceBase item, e.g.
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition: incidencebase.h:121
KCalCore::IncidenceBase::TypeFreeBusy
@ TypeFreeBusy
Type is a free/busy.
Definition: incidencebase.h:125
KCalCore::IncidenceBase::TypeJournal
@ TypeJournal
Type is a journal.
Definition: incidencebase.h:124
KCalCore::IncidenceBase::TypeTodo
@ TypeTodo
Type is a to-do.
Definition: incidencebase.h:123
KCalCore::IncidenceBase::Field
Field
The different types of incidence fields.
Definition: incidencebase.h:160
KCalCore::IncidenceBase::FieldResources
@ FieldResources
‍Field representing the TRANSPARENCY component.
Definition: incidencebase.h:177
KCalCore::IncidenceBase::FieldUnknown
@ FieldUnknown
‍Field representing the UID component.
Definition: incidencebase.h:192
KCalCore::IncidenceBase::FieldLocation
@ FieldLocation
‍Field representing the SUMMARY component.
Definition: incidencebase.h:166
KCalCore::IncidenceBase::FieldCategories
@ FieldCategories
‍Field representing the DUE component.
Definition: incidencebase.h:170
KCalCore::IncidenceBase::FieldTransparency
@ FieldTransparency
‍Field representing the STATUS component.
Definition: incidencebase.h:176
KCalCore::IncidenceBase::FieldRecurrenceId
@ FieldRecurrenceId
‍Field representing the longitude part of the GEO component.
Definition: incidencebase.h:181
KCalCore::IncidenceBase::FieldPriority
@ FieldPriority
‍Field representing the RESOURCES component.
Definition: incidencebase.h:178
KCalCore::IncidenceBase::FieldRelatedTo
@ FieldRelatedTo
‍Field representing the CATEGORIES component.
Definition: incidencebase.h:171
KCalCore::IncidenceBase::FieldDuration
@ FieldDuration
‍Field representing the SEQUENCE component.
Definition: incidencebase.h:188
KCalCore::IncidenceBase::FieldRecurrence
@ FieldRecurrence
‍Field representing the RELATED-TO component.
Definition: incidencebase.h:172
KCalCore::IncidenceBase::FieldPercentComplete
@ FieldPercentComplete
‍Field representing the COMPLETED component.
Definition: incidencebase.h:168
KCalCore::IncidenceBase::FieldSchedulingId
@ FieldSchedulingId
‍Field representing the VALARM component.
Definition: incidencebase.h:183
KCalCore::IncidenceBase::FieldContact
@ FieldContact
‍Field representing the DURATION component.
Definition: incidencebase.h:189
KCalCore::IncidenceBase::FieldAlarms
@ FieldAlarms
‍Field representing the RECURRENCE-ID component.
Definition: incidencebase.h:182
KCalCore::IncidenceBase::FieldLastModified
@ FieldLastModified
‍Field representing the DTEND component.
Definition: incidencebase.h:163
KCalCore::IncidenceBase::FieldStatus
@ FieldStatus
‍Field representing the CLASS component.
Definition: incidencebase.h:175
KCalCore::IncidenceBase::FieldAttachment
@ FieldAttachment
‍Field representing the EXDATE, EXRULE, RDATE, and RRULE components.
Definition: incidencebase.h:173
KCalCore::IncidenceBase::FieldComment
@ FieldComment
‍Field representing the CONTACT component.
Definition: incidencebase.h:190
KCalCore::IncidenceBase::FieldCreated
@ FieldCreated
‍Field representing the ORGANIZER component.
Definition: incidencebase.h:186
KCalCore::IncidenceBase::FieldAttendees
@ FieldAttendees
‍Field representing the X-KDE-LIBKCAL-ID component.
Definition: incidencebase.h:184
KCalCore::IncidenceBase::FieldGeoLatitude
@ FieldGeoLatitude
‍Field representing the PRIORITY component.
Definition: incidencebase.h:179
KCalCore::IncidenceBase::FieldSummary
@ FieldSummary
‍Field representing the DESCRIPTION component.
Definition: incidencebase.h:165
KCalCore::IncidenceBase::FieldUid
@ FieldUid
‍Field representing the COMMENT component.
Definition: incidencebase.h:191
KCalCore::IncidenceBase::FieldRevision
@ FieldRevision
‍Field representing the CREATED component.
Definition: incidencebase.h:187
KCalCore::IncidenceBase::FieldOrganizer
@ FieldOrganizer
‍Field representing the ATTENDEE component.
Definition: incidencebase.h:185
KCalCore::IncidenceBase::FieldDescription
@ FieldDescription
‍Field representing the LAST-MODIFIED component.
Definition: incidencebase.h:164
KCalCore::IncidenceBase::FieldSecrecy
@ FieldSecrecy
‍Field representing the ATTACH component.
Definition: incidencebase.h:174
KCalCore::IncidenceBase::FieldDtDue
@ FieldDtDue
‍Field representing the PERCENT-COMPLETE component.
Definition: incidencebase.h:169
KCalCore::IncidenceBase::FieldGeoLongitude
@ FieldGeoLongitude
‍Field representing the latitude part of the GEO component.
Definition: incidencebase.h:180
KCalCore::IncidenceBase::FieldDtEnd
@ FieldDtEnd
‍Field representing the DTSTART component.
Definition: incidencebase.h:162
KCalCore::IncidenceBase::FieldCompleted
@ FieldCompleted
‍Field representing the LOCATION component.
Definition: incidencebase.h:167
KCalCore::IncidenceBase::type
virtual IncidenceType type() const =0
Returns the incidence type.
KCalCore::IncidenceBase::typeStr
virtual QByteArray typeStr() const =0
Prints the type of incidence as a string.
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition: incidencebase.h:115
KCalCore::IncidenceBase::mReadOnly
bool mReadOnly
Identifies a read-only incidence.
Definition: incidencebase.h:746
KCalCore::IncidenceBase::dateTime
virtual KDateTime dateTime(DateTimeRole role) const =0
Returns a date/time corresponding to the specified DateTimeRole.
KCalCore::IncidenceBase::operator<<
friend KCALCORE_EXPORT QDataStream & operator<<(QDataStream &stream, const KCalCore::IncidenceBase::Ptr &)
Incidence serializer.
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition: incidencebase.h:133
KCalCore::IncidenceBase::RoleCalendarHashing
@ RoleCalendarHashing
Role for looking up an incidence in a Calendar.
Definition: incidencebase.h:137
KCalCore::IncidenceBase::RoleAlarmEndOffset
@ RoleAlarmEndOffset
Role for an incidence alarm's ending offset date/time.
Definition: incidencebase.h:135
KCalCore::IncidenceBase::RoleSort
@ RoleSort
Role for an incidence's date/time used when sorting.
Definition: incidencebase.h:136
KCalCore::IncidenceBase::RoleStartTimeZone
@ RoleStartTimeZone
Role for determining an incidence's starting timezone.
Definition: incidencebase.h:138
KCalCore::IncidenceBase::RoleEndTimeZone
@ RoleEndTimeZone
Role for determining an incidence's ending timezone.
Definition: incidencebase.h:139
KCalCore::Journal
Provides a Journal in the sense of RFC2445.
Definition: journal.h:44
KCalCore::Person::Ptr
QSharedPointer< Person > Ptr
A shared pointer to a Person object.
Definition: person.h:56
KCalCore::SortableList
A QList which can be sorted.
Definition: sortablelist.h:87
KCalCore::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:45
KCalCore::Visitor
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:44
customproperties.h
This file is part of the API for handling calendar data and defines the CustomProperties class.
duration.h
This file is part of the API for handling calendar data and defines the Duration class.
KCalCore
TODO: KDE5:
Definition: alarm.h:47
KCalCore::DateTimeList
SortableList< KDateTime > DateTimeList
List of times.
Definition: incidencebase.h:79
KCalCore::operator>>
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:863
KCalCore::operator<<
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:853
KCalCore::DateList
SortableList< QDate > DateList
List of dates.
Definition: incidencebase.h:76
sortablelist.h
This file is part of the API for handling calendar data and defines the Sortable List class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 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