• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KCal Library

incidence.h

Go to the documentation of this file.
00001 /*
00002   This file is part of the kcal library.
00003 
00004   Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005   Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Library General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Library General Public License for more details.
00016 
00017   You should have received a copy of the GNU Library General Public License
00018   along with this library; see the file COPYING.LIB.  If not, write to
00019   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020   Boston, MA 02110-1301, USA.
00021 */
00031 #ifndef INCIDENCE_H
00032 #define INCIDENCE_H
00033 
00034 #include "kcal_export.h"
00035 #include "incidencebase.h"
00036 #include "alarm.h"
00037 #include "attachment.h"
00038 #include "recurrence.h"
00039 
00040 #include <QtCore/QList>
00041 
00042 namespace KCal {
00043 
00063 class KCAL_EXPORT Incidence //krazy:exclude=dpointer since nested class templates confuse krazy
00064   : public IncidenceBase, public Recurrence::RecurrenceObserver
00065 {
00066   public:
00071     //@cond PRIVATE
00072     template<class T>
00073     class AddVisitor : public IncidenceBase::Visitor
00074     {
00075       public:
00076         AddVisitor( T *r ) : mResource( r ) {}
00077 
00078         bool visit( Event *e )
00079         {
00080           return mResource->addEvent( e );
00081         }
00082         bool visit( Todo *t )
00083         {
00084           return mResource->addTodo( t );
00085         }
00086         bool visit( Journal *j )
00087         {
00088           return mResource->addJournal( j );
00089         }
00090         bool visit( FreeBusy * )
00091         {
00092           return false;
00093         }
00094 
00095       private:
00096         T *mResource;
00097     };
00098     //@endcond
00099 
00105     //@cond PRIVATE
00106     template<class T>
00107     class DeleteVisitor : public IncidenceBase::Visitor
00108     {
00109       public:
00110         DeleteVisitor( T *r ) : mResource( r ) {}
00111 
00112         bool visit( Event *e )
00113         {
00114           mResource->deleteEvent( e );
00115           return true;
00116         }
00117         bool visit( Todo *t )
00118         {
00119           mResource->deleteTodo( t );
00120           return true;
00121         }
00122         bool visit( Journal *j )
00123         {
00124           mResource->deleteJournal( j );
00125           return true;
00126         }
00127         bool visit( FreeBusy * )
00128         {
00129           return false;
00130         }
00131 
00132       private:
00133         T *mResource;
00134     };
00135     //@endcond
00136 
00141     enum Status {
00142       StatusNone,           
00143       StatusTentative,      
00144       StatusConfirmed,      
00145       StatusCompleted,      
00146       StatusNeedsAction,    
00147       StatusCanceled,       
00148       StatusInProcess,      
00149       StatusDraft,          
00150       StatusFinal,          
00151       StatusX               
00152     };
00153 
00157     enum Secrecy {
00158       SecrecyPublic=0,      
00159       SecrecyPrivate=1,     
00160       SecrecyConfidential=2 
00161     };
00162 
00166     typedef ListBase<Incidence> List;
00167 
00171     Incidence();
00172 
00177     Incidence( const Incidence &other );
00178 
00182     ~Incidence();
00183 
00188     virtual Incidence *clone() = 0;
00189 
00196     void setReadOnly( bool readonly );
00197 
00202     void setAllDay( bool allDay );
00203 
00209     void recreate();
00210 
00217     void setCreated( const KDateTime &dt );
00218 
00223     KDateTime created() const;
00224 
00231     void setRevision( int rev );
00232 
00237     int revision() const;
00238 
00245     virtual void setDtStart( const KDateTime &dt );
00246 
00251     virtual KDateTime dtEnd() const;
00252 
00257     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00258                              const KDateTime::Spec &newSpec );
00259 
00267     void setDescription( const QString &description, bool isRich );
00268 
00277     void setDescription( const QString &description );
00278 
00284     QString description() const;
00285 
00292     QString richDescription() const;
00293 
00298     bool descriptionIsRich() const;
00299 
00307     void setSummary( const QString &summary, bool isRich );
00308 
00316     void setSummary( const QString &summary );
00317 
00323     QString summary() const;
00324 
00331     QString richSummary() const;
00332 
00337     bool summaryIsRich() const;
00338 
00346     void setLocation( const QString &location, bool isRich );
00347 
00357     void setLocation( const QString &location );
00358 
00364     QString location() const;
00365 
00372     QString richLocation() const;
00373 
00378     bool locationIsRich() const;
00379 
00386     void setCategories( const QStringList &categories );
00387 
00395     void setCategories( const QString &catStr );
00396 
00401     QStringList categories() const;
00402 
00407     QString categoriesStr() const;
00408 
00416     void setRelatedToUid( const QString &uid );
00417 
00424     QString relatedToUid() const;
00425 
00433     void setRelatedTo( Incidence *incidence );
00434 
00441     Incidence *relatedTo() const;
00442 
00447     Incidence::List relations() const;
00448 
00455     void addRelation( Incidence *incidence );
00456 
00463     void removeRelation( Incidence *incidence );
00464 
00465 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00466 // %%%%%  Recurrence-related methods
00467 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00468 
00473     Recurrence *recurrence() const;
00474 
00478     void clearRecurrence();
00479 
00484     bool recurs() const;
00485 
00490     ushort recurrenceType() const;
00491 
00496     virtual bool recursOn( const QDate &date, const KDateTime::Spec &timeSpec ) const;
00497 
00502     bool recursAt( const KDateTime &dt ) const;
00503 
00515     virtual QList<KDateTime> startDateTimesForDate(
00516       const QDate &date,
00517       const KDateTime::Spec &timeSpec = KDateTime::LocalZone ) const;
00518 
00528     virtual QList<KDateTime> startDateTimesForDateTime(
00529       const KDateTime &datetime ) const;
00530 
00540     virtual KDateTime endDateForStart( const KDateTime &startDt ) const;
00541 
00542 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00543 // %%%%%  Attachment-related methods
00544 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00545 
00552     void addAttachment( Attachment *attachment );
00553 
00561     void deleteAttachment( Attachment *attachment );
00562 
00570     void deleteAttachments( const QString &mime );
00571 
00576     Attachment::List attachments() const;
00577 
00584     Attachment::List attachments( const QString &mime ) const;
00585 
00590     void clearAttachments();
00591 
00592 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00593 // %%%%%  Secrecy and Status methods
00594 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00595 
00602     void setSecrecy( Secrecy secrecy );
00603 
00608     Secrecy secrecy() const;
00609 
00614     QString secrecyStr() const;
00615 
00621     static QStringList secrecyList();
00622 
00629     static QString secrecyName( Secrecy secrecy );
00630 
00638     void setStatus( Status status );
00639 
00647     void setCustomStatus( const QString &status );
00648 
00653     Status status() const;
00654 
00659     QString statusStr() const;
00660 
00666     static QString statusName( Status status );
00667 
00668 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00669 // %%%%%  Other methods
00670 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00671 
00679     void setResources( const QStringList &resources );
00680 
00685     QStringList resources() const;
00686 
00695     void setPriority( int priority );
00696 
00701     int priority() const;
00702 
00703 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00704 // %%%%%  Alarm-related methods
00705 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00706 
00710     const Alarm::List &alarms() const;
00711 
00715     Alarm *newAlarm();
00716 
00723     void addAlarm( Alarm *alarm );
00724 
00731     void removeAlarm( Alarm *alarm );
00732 
00737     void clearAlarms();
00738 
00742     bool isAlarmEnabled() const;
00743 
00744 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00745 // %%%%%  Other methods
00746 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00747 
00760     void setSchedulingID( const QString &sid );
00761 
00767     QString schedulingID() const;
00768 
00776     virtual void recurrenceUpdated( Recurrence *recurrence );
00777 
00781     Incidence &operator=( const Incidence &other );
00782 
00788     bool operator==( const Incidence &incidence ) const;
00789 
00790   protected:
00796     virtual KDateTime endDateRecurrenceBase() const
00797     {
00798       return dtStart();
00799     }
00800 
00801   private:
00802     void init( const Incidence &other );
00803     //@cond PRIVATE
00804     class Private;
00805     Private *const d;
00806     //@endcond
00807 };
00808 
00809 }
00810 
00811 #endif

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7
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