• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KCalCore Library

incidencebase.h
Go to the documentation of this file.
00001 /*
00002   This file is part of the kcalcore library.
00003 
00004   Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005   Copyright (c) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006   Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
00007   Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00008   Contact: Alvaro Manera <alvaro.manera@nokia.com>
00009 
00010   This library is free software; you can redistribute it and/or
00011   modify it under the terms of the GNU Library General Public
00012   License as published by the Free Software Foundation; either
00013   version 2 of the License, or (at your option) any later version.
00014 
00015   This library is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018   Library General Public License for more details.
00019 
00020   You should have received a copy of the GNU Library General Public License
00021   along with this library; see the file COPYING.LIB.  If not, write to
00022   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00023   Boston, MA 02110-1301, USA.
00024 */
00056 #ifndef KCALCORE_INCIDENCEBASE_H
00057 #define KCALCORE_INCIDENCEBASE_H
00058 
00059 #include "attendee.h"
00060 #include "customproperties.h"
00061 #include "duration.h"
00062 #include "sortablelist.h"
00063 
00064 #include <KDE/KDateTime>
00065 
00066 #include <QtCore/QSet>
00067 
00068 class KUrl;
00069 class QDate;
00070 
00071 namespace KCalCore {
00072 
00074 typedef SortableList<QDate> DateList;
00075 
00077 typedef SortableList<KDateTime> DateTimeList;
00078 
00079 class Event;
00080 class Todo;
00081 class Journal;
00082 class FreeBusy;
00083 class Visitor;
00084 
00107 class KCALCORE_EXPORT IncidenceBase : public CustomProperties
00108 {
00109   public:
00113     typedef QSharedPointer<IncidenceBase> Ptr;
00114 
00119     enum IncidenceType {
00120       TypeEvent = 0,           
00121       TypeTodo,                
00122       TypeJournal,             
00123       TypeFreeBusy,            
00124       TypeUnknown              
00125     };
00126 
00131     enum DateTimeRole {
00132       RoleAlarmStartOffset = 0,
00133       RoleAlarmEndOffset,      
00134       RoleSort,                
00135       RoleCalendarHashing,     
00136       RoleStartTimeZone,       
00137       RoleEndTimeZone,         
00138       RoleEndRecurrenceBase,
00139       RoleEnd,                 
00141       RoleDisplayEnd,          
00143       RoleAlarm,               
00145       RoleRecurrenceStart,      
00150       RoleDisplayStart          
00152     };
00153 
00154     enum Field {
00155       FieldDtStart,         
00156       FieldDtEnd,           
00157       FieldLastModified,    
00158       FieldDescription,     
00159       FieldSummary,         
00160       FieldLocation,        
00161       FieldCompleted,       
00162       FieldPercentComplete, 
00163       FieldDtDue,           
00164       FieldCategories,      
00165       FieldRelatedTo,       
00166       FieldRecurrence,      
00167       FieldAttachment,      
00168       FieldSecrecy,         
00169       FieldStatus,          
00170       FieldTransparency,    
00171       FieldResources,       
00172       FieldPriority,        
00173       FieldGeoLatitude,     
00174       FieldGeoLongitude,    
00175       FieldRecurrenceId,    
00176       FieldAlarms,          
00177       FieldSchedulingId,    
00178       FieldAttendees,       
00179       FieldOrganizer,       
00180       FieldCreated,         
00181       FieldRevision,        
00182       FieldDuration,        
00183       FieldContact,         
00184       FieldComment,         
00185       FieldUid,             
00186       FieldUnknown          
00187     };
00188 
00192     class KCALCORE_EXPORT IncidenceObserver
00193     {
00194       public:
00195 
00199         virtual ~IncidenceObserver();
00200 
00207         virtual void incidenceUpdate( const QString &uid, const KDateTime &recurrenceId ) = 0;
00208 
00215         virtual void incidenceUpdated( const QString &uid, const KDateTime &recurrenceId ) = 0;
00216     };
00217 
00221     IncidenceBase();
00222 
00226     virtual ~IncidenceBase();
00227 
00245     IncidenceBase &operator=( const IncidenceBase &other );
00246 
00253     bool operator==( const IncidenceBase &ib ) const;
00254 
00260     bool operator!=( const IncidenceBase &ib ) const;
00261 
00272     virtual bool accept( Visitor &v, IncidenceBase::Ptr incidence );
00273 
00277     virtual IncidenceType type() const = 0;
00278 
00282     virtual QByteArray typeStr() const = 0;
00283 
00289     void setUid( const QString &uid );
00290 
00295     QString uid() const;
00296 
00300     KUrl uri() const;
00301 
00310     virtual void setLastModified( const KDateTime &lm );
00311 
00316     KDateTime lastModified() const;
00317 
00324     void setOrganizer( const Person::Ptr &organizer );
00325 
00332     void setOrganizer( const QString &organizer );
00333 
00338     Person::Ptr organizer() const;
00339 
00347     virtual void setReadOnly( bool readOnly );
00348 
00353     bool isReadOnly() const;
00354 
00363     virtual void setDtStart( const KDateTime &dtStart );
00364 
00369     virtual KDateTime dtStart() const;
00370 
00378     virtual void setDuration( const Duration &duration );
00379 
00384     Duration duration() const;
00385 
00391     void setHasDuration( bool hasDuration );
00392 
00397     bool hasDuration() const;
00398 
00404     bool allDay() const;
00405 
00414     void setAllDay( bool allDay );
00415 
00430     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00431                              const KDateTime::Spec &newSpec );
00432 
00440     void addComment( const QString &comment );
00441 
00450     bool removeComment( const QString &comment );
00451 
00455     void clearComments();
00456 
00460     QStringList comments() const;
00461 
00469     void addContact( const QString &contact );
00470 
00479     bool removeContact( const QString &contact );
00480 
00484     void clearContacts();
00485 
00489     QStringList contacts() const;
00490 
00498     void addAttendee( const Attendee::Ptr &attendee,
00499                       bool doUpdate = true );
00500 
00504     void clearAttendees();
00505 
00514     void deleteAttendee( const Attendee::Ptr &attendee,
00515                          bool doUpdate = true );
00516 
00521     Attendee::List attendees() const;
00522 
00526     int attendeeCount() const;
00527 
00535     Attendee::Ptr attendeeByMail( const QString &email ) const;
00536 
00547     Attendee::Ptr attendeeByMails( const QStringList &emails,
00548                                    const QString &email = QString() ) const;
00549 
00556     Attendee::Ptr attendeeByUid( const QString &uid ) const;
00557 
00566     void registerObserver( IncidenceObserver *observer );
00567 
00575     void unRegisterObserver( IncidenceObserver *observer );
00576 
00581     void update();
00582 
00587     void updated();
00588 
00594     void startUpdates();
00595 
00601     void endUpdates();
00602 
00607     virtual KDateTime dateTime( DateTimeRole role ) const = 0;
00608 
00614     virtual void setDateTime( const KDateTime &dateTime, DateTimeRole role ) = 0;
00615 
00620     virtual QLatin1String mimeType() const = 0;
00621 
00627     virtual KDateTime recurrenceId() const;
00628 
00635     QSet<IncidenceBase::Field> dirtyFields() const;
00636 
00641     void resetDirtyFields();
00642 
00643   protected:
00644 
00649     void setFieldDirty( IncidenceBase::Field field );
00650 
00655     virtual void customPropertyUpdate();
00656 
00661     virtual void customPropertyUpdated();
00662 
00668     IncidenceBase( const IncidenceBase &ib );
00669 
00677     virtual bool equals( const IncidenceBase &incidenceBase ) const;
00678 
00683     virtual IncidenceBase &assign( const IncidenceBase &other );
00684 
00692     virtual void virtual_hook( int id, void *data ) = 0;
00693 
00697     bool mReadOnly;
00698 
00699   private:
00700     //@cond PRIVATE
00701     class Private;
00702     Private *const d;
00703     //@endcond
00704 };
00705 
00706 }
00707 
00708 #endif

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal