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

KCalCore Library

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
70 class KUrl;
71 class QDate;
72 
73 namespace KCalCore {
74 
76 typedef SortableList<QDate> DateList;
77 
79 typedef SortableList<KDateTime> DateTimeList;
80 
81 class Event;
82 class Todo;
83 class Journal;
84 class FreeBusy;
85 class Visitor;
86 
109 class KCALCORE_EXPORT IncidenceBase : public CustomProperties
110 {
111 public:
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 
686 protected:
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 
748 private:
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 
769 KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalCore::IncidenceBase::Ptr &);
770 
779 KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, const KCalCore::IncidenceBase::Ptr &);
780 
781 }
782 
783 Q_DECLARE_METATYPE(KCalCore::IncidenceBase *)
784 Q_DECLARE_METATYPE(KCalCore::IncidenceBase::Ptr)
785 
786 #endif
KCalCore::IncidenceBase::FieldRevision
Field representing the CREATED component.
Definition: incidencebase.h:187
attendee.h
This file is part of the API for handling calendar data and defines the Attendee class.
KCalCore::IncidenceBase::Field
Field
The different types of incidence fields.
Definition: incidencebase.h:160
KCalCore::IncidenceBase::TypeFreeBusy
Type is a free/busy.
Definition: incidencebase.h:125
KCalCore::IncidenceBase::FieldRecurrenceId
Field representing the longitude part of the GEO component.
Definition: incidencebase.h:181
customproperties.h
This file is part of the API for handling calendar data and defines the CustomProperties class...
KCalCore::IncidenceBase::RoleCalendarHashing
Role for looking up an incidence in a Calendar.
Definition: incidencebase.h:137
KCalCore::IncidenceBase::FieldDuration
Field representing the SEQUENCE component.
Definition: incidencebase.h:188
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:55
KCalCore::IncidenceBase::FieldDescription
Field representing the LAST-MODIFIED component.
Definition: incidencebase.h:164
KCalCore::IncidenceBase::TypeTodo
Type is a to-do.
Definition: incidencebase.h:123
KCalCore::IncidenceBase::FieldDtEnd
Field representing the DTSTART component.
Definition: incidencebase.h:162
sortablelist.h
This file is part of the API for handling calendar data and defines the Sortable List class...
KCalCore::IncidenceBase::FieldCompleted
Field representing the LOCATION component.
Definition: incidencebase.h:167
KCalCore::IncidenceBase::FieldStatus
Field representing the CLASS component.
Definition: incidencebase.h:175
KCalCore::IncidenceBase::FieldGeoLongitude
Field representing the latitude part of the GEO component.
Definition: incidencebase.h:180
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:109
KCalCore::IncidenceBase::RoleEndTimeZone
Role for determining an incidence's ending timezone.
Definition: incidencebase.h:139
KCalCore::IncidenceBase::FieldSchedulingId
Field representing the VALARM component.
Definition: incidencebase.h:183
KCalCore::Visitor
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:43
KCalCore::IncidenceBase::FieldOrganizer
Field representing the ATTENDEE component.
Definition: incidencebase.h:185
KCalCore::DateList
SortableList< QDate > DateList
List of dates.
Definition: incidencebase.h:76
KCalCore::IncidenceBase::FieldSummary
Field representing the DESCRIPTION component.
Definition: incidencebase.h:165
KCalCore::IncidenceBase::TypeJournal
Type is a journal.
Definition: incidencebase.h:124
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition: incidencebase.h:121
KCalCore::IncidenceBase::FieldResources
Field representing the TRANSPARENCY component.
Definition: incidencebase.h:177
KCalCore::IncidenceBase::FieldCategories
Field representing the DUE component.
Definition: incidencebase.h:170
KCalCore::IncidenceBase::FieldRecurrence
Field representing the RELATED-TO component.
Definition: incidencebase.h:172
KCalCore::IncidenceBase::FieldUid
Field representing the COMMENT component.
Definition: incidencebase.h:191
KCalCore::IncidenceBase::FieldAlarms
Field representing the RECURRENCE-ID component.
Definition: incidencebase.h:182
KCalCore::IncidenceBase::FieldAttachment
Field representing the EXDATE, EXRULE, RDATE, and RRULE components.
Definition: incidencebase.h:173
KCalCore::IncidenceBase::FieldCreated
Field representing the ORGANIZER component.
Definition: incidencebase.h:186
KCalCore::IncidenceBase::FieldComment
Field representing the CONTACT component.
Definition: incidencebase.h:190
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition: incidencebase.h:115
KCalCore::IncidenceBase::FieldAttendees
Field representing the X-KDE-LIBKCAL-ID component.
Definition: incidencebase.h:184
KCalCore::SortableList
A QList which can be sorted.
Definition: sortablelist.h:86
KCalCore::IncidenceBase::FieldPercentComplete
Field representing the COMPLETED component.
Definition: incidencebase.h:168
KCalCore::IncidenceBase::RoleSort
Role for an incidence's date/time used when sorting.
Definition: incidencebase.h:136
KCalCore::operator>>
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:863
KCalCore::IncidenceBase::FieldLocation
Field representing the SUMMARY component.
Definition: incidencebase.h:166
KCalCore::IncidenceBase::FieldGeoLatitude
Field representing the PRIORITY component.
Definition: incidencebase.h:179
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition: incidencebase.h:133
KCalCore::IncidenceBase::RoleAlarmEndOffset
Role for an incidence alarm's ending offset date/time.
Definition: incidencebase.h:135
KCalCore::Journal
Provides a Journal in the sense of RFC2445.
Definition: journal.h:43
KCalCore::IncidenceBase::FieldDtDue
Field representing the PERCENT-COMPLETE component.
Definition: incidencebase.h:169
KCalCore::IncidenceBase::RoleStartTimeZone
Role for determining an incidence's starting timezone.
Definition: incidencebase.h:138
duration.h
This file is part of the API for handling calendar data and defines the Duration class.
KCalCore::IncidenceBase::FieldLastModified
Field representing the DTEND component.
Definition: incidencebase.h:163
KCalCore::DateTimeList
SortableList< KDateTime > DateTimeList
List of times.
Definition: incidencebase.h:79
KCalCore::Person::Ptr
QSharedPointer< Person > Ptr
A shared pointer to a Person object.
Definition: person.h:56
KCalCore::Attendee::Ptr
QSharedPointer< Attendee > Ptr
A shared pointer to an Attendee object.
Definition: attendee.h:94
KCalCore::CustomProperties
A class to manage custom calendar properties.
Definition: customproperties.h:51
KCalCore::IncidenceBase::FieldContact
Field representing the DURATION component.
Definition: incidencebase.h:189
KCalCore::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:44
KCalCore::Event
This class provides an Event in the sense of RFC2445.
Definition: event.h:41
KCalCore::IncidenceBase::FieldPriority
Field representing the RESOURCES component.
Definition: incidencebase.h:178
KCalCore::FreeBusy
Provides information about the free/busy time of a calendar.
Definition: freebusy.h:52
KCalCore::IncidenceBase::mReadOnly
bool mReadOnly
Identifies a read-only incidence.
Definition: incidencebase.h:746
KCalCore::IncidenceBase::FieldRelatedTo
Field representing the CATEGORIES component.
Definition: incidencebase.h:171
KCalCore::IncidenceBase::FieldSecrecy
Field representing the ATTACH component.
Definition: incidencebase.h:174
KCalCore::IncidenceBase::IncidenceObserver
The IncidenceObserver class.
Definition: incidencebase.h:199
KCalCore::Attendee::List
QVector< Ptr > List
List of attendees.
Definition: attendee.h:99
KCalCore::operator<<
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:853
KCalCore::IncidenceBase::FieldTransparency
Field representing the STATUS component.
Definition: incidencebase.h:176
KCalCore::IncidenceBase::FieldUnknown
Field representing the UID component.
Definition: incidencebase.h:192
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:57 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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