• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.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 
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Fri Jan 3 2014 22:20:29 by doxygen 1.8.3.1 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.5 API Reference

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