• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 
155  enum Field {
156  FieldDtStart,
157  FieldDtEnd,
158  FieldLastModified,
159  FieldDescription,
160  FieldSummary,
161  FieldLocation,
162  FieldCompleted,
163  FieldPercentComplete,
164  FieldDtDue,
165  FieldCategories,
166  FieldRelatedTo,
167  FieldRecurrence,
168  FieldAttachment,
169  FieldSecrecy,
170  FieldStatus,
171  FieldTransparency,
172  FieldResources,
173  FieldPriority,
174  FieldGeoLatitude,
175  FieldGeoLongitude,
176  FieldRecurrenceId,
177  FieldAlarms,
178  FieldSchedulingId,
179  FieldAttendees,
180  FieldOrganizer,
181  FieldCreated,
182  FieldRevision,
183  FieldDuration,
184  FieldContact,
185  FieldComment,
186  FieldUid,
187  FieldUnknown
188  };
189 
193  class KCALCORE_EXPORT IncidenceObserver
194  {
195  public:
196 
200  virtual ~IncidenceObserver();
201 
208  virtual void incidenceUpdate( const QString &uid, const KDateTime &recurrenceId ) = 0;
209 
216  virtual void incidenceUpdated( const QString &uid, const KDateTime &recurrenceId ) = 0;
217  };
218 
222  IncidenceBase();
223 
227  virtual ~IncidenceBase();
228 
246  IncidenceBase &operator=( const IncidenceBase &other );
247 
254  bool operator==( const IncidenceBase &ib ) const;
255 
261  bool operator!=( const IncidenceBase &ib ) const;
262 
273  virtual bool accept( Visitor &v, IncidenceBase::Ptr incidence );
274 
278  virtual IncidenceType type() const = 0;
279 
283  virtual QByteArray typeStr() const = 0;
284 
290  void setUid( const QString &uid );
291 
296  QString uid() const;
297 
301  KUrl uri() const;
302 
311  virtual void setLastModified( const KDateTime &lm );
312 
317  KDateTime lastModified() const;
318 
325  void setOrganizer( const Person::Ptr &organizer );
326 
333  void setOrganizer( const QString &organizer );
334 
339  Person::Ptr organizer() const;
340 
348  virtual void setReadOnly( bool readOnly );
349 
354  bool isReadOnly() const;
355 
364  virtual void setDtStart( const KDateTime &dtStart );
365 
370  virtual KDateTime dtStart() const;
371 
379  virtual void setDuration( const Duration &duration );
380 
385  Duration duration() const;
386 
392  void setHasDuration( bool hasDuration );
393 
398  bool hasDuration() const;
399 
405  bool allDay() const;
406 
415  void setAllDay( bool allDay );
416 
431  virtual void shiftTimes( const KDateTime::Spec &oldSpec,
432  const KDateTime::Spec &newSpec );
433 
441  void addComment( const QString &comment );
442 
451  bool removeComment( const QString &comment );
452 
456  void clearComments();
457 
461  QStringList comments() const;
462 
470  void addContact( const QString &contact );
471 
480  bool removeContact( const QString &contact );
481 
485  void clearContacts();
486 
490  QStringList contacts() const;
491 
499  void addAttendee( const Attendee::Ptr &attendee,
500  bool doUpdate = true );
501 
505  void clearAttendees();
506 
515  void deleteAttendee( const Attendee::Ptr &attendee,
516  bool doUpdate = true );
517 
522  Attendee::List attendees() const;
523 
527  int attendeeCount() const;
528 
536  Attendee::Ptr attendeeByMail( const QString &email ) const;
537 
548  Attendee::Ptr attendeeByMails( const QStringList &emails,
549  const QString &email = QString() ) const;
550 
557  Attendee::Ptr attendeeByUid( const QString &uid ) const;
558 
567  void registerObserver( IncidenceObserver *observer );
568 
576  void unRegisterObserver( IncidenceObserver *observer );
577 
582  void update();
583 
588  void updated();
589 
595  void startUpdates();
596 
602  void endUpdates();
603 
608  virtual KDateTime dateTime( DateTimeRole role ) const = 0;
609 
615  virtual void setDateTime( const KDateTime &dateTime, DateTimeRole role ) = 0;
616 
621  virtual QLatin1String mimeType() const = 0;
622 
628  virtual KDateTime recurrenceId() const;
629 
636  QSet<IncidenceBase::Field> dirtyFields() const;
637 
643  void setDirtyFields( const QSet<IncidenceBase::Field> & );
644 
649  void resetDirtyFields();
650 
651  protected:
652 
657  void setFieldDirty( IncidenceBase::Field field );
658 
663  virtual void customPropertyUpdate();
664 
669  virtual void customPropertyUpdated();
670 
676  IncidenceBase( const IncidenceBase &ib );
677 
685  virtual bool equals( const IncidenceBase &incidenceBase ) const;
686 
691  virtual IncidenceBase &assign( const IncidenceBase &other );
692 
700  virtual void virtual_hook( int id, void *data ) = 0;
701 
705  bool mReadOnly;
706 
707  private:
708  //@cond PRIVATE
709  class Private;
710  Private *const d;
711  //@endcond
712 };
713 
714 }
715 
716 Q_DECLARE_METATYPE( KCalCore::IncidenceBase * )
717 Q_DECLARE_METATYPE( KCalCore::IncidenceBase::Ptr )
718 
719 #endif
KCalCore::IncidenceBase::FieldRevision
Field representing the CREATED component.
Definition: incidencebase.h:182
attendee.h
This file is part of the API for handling calendar data and defines the Attendee class.
KCalCore::IncidenceBase::Field
Field
Definition: incidencebase.h:155
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:176
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:183
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:159
KCalCore::IncidenceBase::TypeTodo
Type is a to-do.
Definition: incidencebase.h:121
KCalCore::IncidenceBase::FieldDtEnd
Field representing the DTSTART component.
Definition: incidencebase.h:157
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:162
KCalCore::IncidenceBase::FieldStatus
Field representing the CLASS component.
Definition: incidencebase.h:170
KCalCore::IncidenceBase::FieldGeoLongitude
Field representing the latitude part of the GEO component.
Definition: incidencebase.h:175
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:178
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:180
KCalCore::DateList
SortableList< QDate > DateList
List of dates.
Definition: incidencebase.h:74
KCalCore::IncidenceBase::FieldSummary
Field representing the DESCRIPTION component.
Definition: incidencebase.h:160
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:172
KCalCore::IncidenceBase::FieldCategories
Field representing the DUE component.
Definition: incidencebase.h:165
KCalCore::IncidenceBase::FieldRecurrence
Field representing the RELATED-TO component.
Definition: incidencebase.h:167
KCalCore::IncidenceBase::FieldUid
Field representing the COMMENT component.
Definition: incidencebase.h:186
KCalCore::IncidenceBase::FieldAlarms
Field representing the RECURRENCE-ID component.
Definition: incidencebase.h:177
KCalCore::IncidenceBase::FieldAttachment
Field representing the EXDATE, EXRULE, RDATE, and RRULE components.
Definition: incidencebase.h:168
KCalCore::IncidenceBase::FieldCreated
Field representing the ORGANIZER component.
Definition: incidencebase.h:181
KCalCore::IncidenceBase::FieldComment
Field representing the CONTACT component.
Definition: incidencebase.h:185
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:179
KCalCore::SortableList
A QList which can be sorted.
Definition: sortablelist.h:86
KCalCore::IncidenceBase::FieldPercentComplete
Field representing the COMPLETED component.
Definition: incidencebase.h:163
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:161
KCalCore::IncidenceBase::FieldGeoLatitude
Field representing the PRIORITY component.
Definition: incidencebase.h:174
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:164
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:158
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:184
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:173
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:705
KCalCore::IncidenceBase::FieldRelatedTo
Field representing the CATEGORIES component.
Definition: incidencebase.h:166
KCalCore::IncidenceBase::FieldSecrecy
Field representing the ATTACH component.
Definition: incidencebase.h:169
KCalCore::IncidenceBase::IncidenceObserver
The IncidenceObserver class.
Definition: incidencebase.h:193
KCalCore::Attendee::List
QVector< Ptr > List
List of attendees.
Definition: attendee.h:99
KCalCore::IncidenceBase::FieldTransparency
Field representing the STATUS component.
Definition: incidencebase.h:171
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Sep 8 2021 11:22:27 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.10.5 API Reference

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