• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 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 
68 class KUrl;
69 class QDate;
70 
71 namespace KCalCore {
72 
74 typedef SortableList<QDate> DateList;
75 
77 typedef SortableList<KDateTime> DateTimeList;
78 
79 class Event;
80 class Todo;
81 class Journal;
82 class FreeBusy;
83 class Visitor;
84 
107 class KCALCORE_EXPORT IncidenceBase : public CustomProperties
108 {
109  public:
113  typedef QSharedPointer<IncidenceBase> Ptr;
114 
119  enum IncidenceType {
120  TypeEvent = 0,
121  TypeTodo,
122  TypeJournal,
123  TypeFreeBusy,
124  TypeUnknown
125  };
126 
131  enum DateTimeRole {
132  RoleAlarmStartOffset = 0,
133  RoleAlarmEndOffset,
134  RoleSort,
135  RoleCalendarHashing,
136  RoleStartTimeZone,
137  RoleEndTimeZone,
138  RoleEndRecurrenceBase,
139  RoleEnd,
141  RoleDisplayEnd,
143  RoleAlarm,
145  RoleRecurrenceStart,
150  RoleDisplayStart,
152  RoleDnD
153  };
154 
158  enum Field {
159  FieldDtStart,
160  FieldDtEnd,
161  FieldLastModified,
162  FieldDescription,
163  FieldSummary,
164  FieldLocation,
165  FieldCompleted,
166  FieldPercentComplete,
167  FieldDtDue,
168  FieldCategories,
169  FieldRelatedTo,
170  FieldRecurrence,
171  FieldAttachment,
172  FieldSecrecy,
173  FieldStatus,
174  FieldTransparency,
175  FieldResources,
176  FieldPriority,
177  FieldGeoLatitude,
178  FieldGeoLongitude,
179  FieldRecurrenceId,
180  FieldAlarms,
181  FieldSchedulingId,
182  FieldAttendees,
183  FieldOrganizer,
184  FieldCreated,
185  FieldRevision,
186  FieldDuration,
187  FieldContact,
188  FieldComment,
189  FieldUid,
190  FieldUnknown
191  };
192 
196  class KCALCORE_EXPORT IncidenceObserver
197  {
198  public:
199 
203  virtual ~IncidenceObserver();
204 
211  virtual void incidenceUpdate( const QString &uid, const KDateTime &recurrenceId ) = 0;
212 
219  virtual void incidenceUpdated( const QString &uid, const KDateTime &recurrenceId ) = 0;
220  };
221 
225  IncidenceBase();
226 
230  virtual ~IncidenceBase();
231 
249  IncidenceBase &operator=( const IncidenceBase &other );
250 
257  bool operator==( const IncidenceBase &ib ) const;
258 
264  bool operator!=( const IncidenceBase &ib ) const;
265 
276  virtual bool accept( Visitor &v, IncidenceBase::Ptr incidence );
277 
281  virtual IncidenceType type() const = 0;
282 
286  virtual QByteArray typeStr() const = 0;
287 
293  void setUid( const QString &uid );
294 
299  QString uid() const;
300 
304  KUrl uri() const;
305 
314  virtual void setLastModified( const KDateTime &lm );
315 
320  KDateTime lastModified() const;
321 
328  void setOrganizer( const Person::Ptr &organizer );
329 
336  void setOrganizer( const QString &organizer );
337 
344  Person::Ptr organizer() const;
345 
353  virtual void setReadOnly( bool readOnly );
354 
359  bool isReadOnly() const;
360 
369  virtual void setDtStart( const KDateTime &dtStart );
370 
375  virtual KDateTime dtStart() const;
376 
384  virtual void setDuration( const Duration &duration );
385 
390  Duration duration() const;
391 
397  void setHasDuration( bool hasDuration );
398 
403  bool hasDuration() const;
404 
410  bool allDay() const;
411 
420  void setAllDay( bool allDay );
421 
436  virtual void shiftTimes( const KDateTime::Spec &oldSpec,
437  const KDateTime::Spec &newSpec );
438 
446  void addComment( const QString &comment );
447 
456  bool removeComment( const QString &comment );
457 
461  void clearComments();
462 
466  QStringList comments() const;
467 
475  void addContact( const QString &contact );
476 
485  bool removeContact( const QString &contact );
486 
490  void clearContacts();
491 
495  QStringList contacts() const;
496 
504  void addAttendee( const Attendee::Ptr &attendee,
505  bool doUpdate = true );
506 
510  void clearAttendees();
511 
520  void deleteAttendee( const Attendee::Ptr &attendee,
521  bool doUpdate = true );
522 
527  Attendee::List attendees() const;
528 
532  int attendeeCount() const;
533 
541  Attendee::Ptr attendeeByMail( const QString &email ) const;
542 
553  Attendee::Ptr attendeeByMails( const QStringList &emails,
554  const QString &email = QString() ) const;
555 
562  Attendee::Ptr attendeeByUid( const QString &uid ) const;
563 
572  void registerObserver( IncidenceObserver *observer );
573 
581  void unRegisterObserver( IncidenceObserver *observer );
582 
587  void update();
588 
593  void updated();
594 
600  void startUpdates();
601 
607  void endUpdates();
608 
613  virtual KDateTime dateTime( DateTimeRole role ) const = 0;
614 
620  virtual void setDateTime( const KDateTime &dateTime, DateTimeRole role ) = 0;
621 
626  virtual QLatin1String mimeType() const = 0;
627 
633  virtual KDateTime recurrenceId() const;
634 
641  QSet<IncidenceBase::Field> dirtyFields() const;
642 
648  void setDirtyFields( const QSet<IncidenceBase::Field> & );
649 
654  void resetDirtyFields();
655 
656  protected:
657 
663  void setFieldDirty( IncidenceBase::Field field );
664 
669  virtual void customPropertyUpdate();
670 
675  virtual void customPropertyUpdated();
676 
681  IncidenceBase( const IncidenceBase &ib );
682 
690  virtual bool equals( const IncidenceBase &incidenceBase ) const;
691 
696  virtual IncidenceBase &assign( const IncidenceBase &other );
697 
705  virtual void virtual_hook( int id, void *data ) = 0;
706 
710  bool mReadOnly;
711 
712  private:
713  //@cond PRIVATE
714  class Private;
715  Private *const d;
716  //@endcond
717 };
718 
719 }
720 
721 Q_DECLARE_METATYPE( KCalCore::IncidenceBase * )
722 Q_DECLARE_METATYPE( KCalCore::IncidenceBase::Ptr )
723 
724 #endif
KCalCore::IncidenceBase::FieldRevision
Field representing the CREATED component.
Definition: incidencebase.h:185
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:158
KCalCore::IncidenceBase::TypeFreeBusy
Type is a free/busy.
Definition: incidencebase.h:123
KCalCore::IncidenceBase::FieldRecurrenceId
Field representing the longitude part of the GEO component.
Definition: incidencebase.h:179
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:135
KCalCore::IncidenceBase::FieldDuration
Field representing the SEQUENCE component.
Definition: incidencebase.h:186
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:52
KCalCore::IncidenceBase::FieldDescription
Field representing the LAST-MODIFIED component.
Definition: incidencebase.h:162
KCalCore::IncidenceBase::TypeTodo
Type is a to-do.
Definition: incidencebase.h:121
KCalCore::IncidenceBase::FieldDtEnd
Field representing the DTSTART component.
Definition: incidencebase.h:160
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:165
KCalCore::IncidenceBase::FieldStatus
Field representing the CLASS component.
Definition: incidencebase.h:173
KCalCore::IncidenceBase::FieldGeoLongitude
Field representing the latitude part of the GEO component.
Definition: incidencebase.h:178
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:107
KCalCore::IncidenceBase::RoleEndTimeZone
Role for determining an incidence&#39;s ending timezone.
Definition: incidencebase.h:137
KCalCore::IncidenceBase::FieldSchedulingId
Field representing the VALARM component.
Definition: incidencebase.h:181
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:183
KCalCore::DateList
SortableList< QDate > DateList
List of dates.
Definition: incidencebase.h:74
KCalCore::IncidenceBase::FieldSummary
Field representing the DESCRIPTION component.
Definition: incidencebase.h:163
KCalCore::IncidenceBase::TypeJournal
Type is a journal.
Definition: incidencebase.h:122
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition: incidencebase.h:119
KCalCore::IncidenceBase::FieldResources
Field representing the TRANSPARENCY component.
Definition: incidencebase.h:175
KCalCore::IncidenceBase::FieldCategories
Field representing the DUE component.
Definition: incidencebase.h:168
KCalCore::IncidenceBase::FieldRecurrence
Field representing the RELATED-TO component.
Definition: incidencebase.h:170
KCalCore::IncidenceBase::FieldUid
Field representing the COMMENT component.
Definition: incidencebase.h:189
KCalCore::IncidenceBase::FieldAlarms
Field representing the RECURRENCE-ID component.
Definition: incidencebase.h:180
KCalCore::IncidenceBase::FieldAttachment
Field representing the EXDATE, EXRULE, RDATE, and RRULE components.
Definition: incidencebase.h:171
KCalCore::IncidenceBase::FieldCreated
Field representing the ORGANIZER component.
Definition: incidencebase.h:184
KCalCore::IncidenceBase::FieldComment
Field representing the CONTACT component.
Definition: incidencebase.h:188
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition: incidencebase.h:113
KCalCore::IncidenceBase::FieldAttendees
Field representing the X-KDE-LIBKCAL-ID component.
Definition: incidencebase.h:182
KCalCore::SortableList
A QList which can be sorted.
Definition: sortablelist.h:86
KCalCore::IncidenceBase::FieldPercentComplete
Field representing the COMPLETED component.
Definition: incidencebase.h:166
KCalCore::IncidenceBase::RoleSort
Role for an incidence&#39;s date/time used when sorting.
Definition: incidencebase.h:134
KCalCore::IncidenceBase::FieldLocation
Field representing the SUMMARY component.
Definition: incidencebase.h:164
KCalCore::IncidenceBase::FieldGeoLatitude
Field representing the PRIORITY component.
Definition: incidencebase.h:177
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition: incidencebase.h:131
KCalCore::IncidenceBase::RoleAlarmEndOffset
Role for an incidence alarm&#39;s ending offset date/time.
Definition: incidencebase.h:133
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:167
KCalCore::IncidenceBase::RoleStartTimeZone
Role for determining an incidence&#39;s starting timezone.
Definition: incidencebase.h:136
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:161
KCalCore::DateTimeList
SortableList< KDateTime > DateTimeList
List of times.
Definition: incidencebase.h:77
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:187
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:176
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:710
KCalCore::IncidenceBase::FieldRelatedTo
Field representing the CATEGORIES component.
Definition: incidencebase.h:169
KCalCore::IncidenceBase::FieldSecrecy
Field representing the ATTACH component.
Definition: incidencebase.h:172
KCalCore::IncidenceBase::IncidenceObserver
The IncidenceObserver class.
Definition: incidencebase.h:196
KCalCore::Attendee::List
QVector< Ptr > List
List of attendees.
Definition: attendee.h:99
KCalCore::IncidenceBase::FieldTransparency
Field representing the STATUS component.
Definition: incidencebase.h:174
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:02:04 by doxygen 1.8.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.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 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