• 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:24:52 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.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