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

KCal Library

incidencebase.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     Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021     Boston, MA 02110-1301, USA.
00022 */
00054 #ifndef KCAL_INCIDENCEBASE_H
00055 #define KCAL_INCIDENCEBASE_H
00056 
00057 #include <QtCore/QStringList>
00058 #include <QtCore/QByteArray>
00059 #include <QtCore/QList>
00060 
00061 #include <kdatetime.h>
00062 
00063 #include "attendee.h"
00064 #include "customproperties.h"
00065 #include "duration.h"
00066 #include "sortablelist.h"
00067 
00068 class KUrl;
00069 
00070 namespace KCal {
00071 
00073 typedef SortableList<QDate> DateList;
00075 typedef SortableList<KDateTime> DateTimeList;
00076 class Event;
00077 class Todo;
00078 class Journal;
00079 class FreeBusy;
00080 
00103 class KCAL_EXPORT IncidenceBase : public CustomProperties
00104 {
00105   public:
00113     class KCAL_EXPORT Visitor //krazy:exclude=dpointer
00114     {
00115       public:
00117         virtual ~Visitor() {}
00118 
00124         virtual bool visit( Event *event );
00125 
00131         virtual bool visit( Todo *todo );
00132 
00138         virtual bool visit( Journal *journal );
00139 
00145         virtual bool visit( FreeBusy *freebusy );
00146 
00147       protected:
00152         Visitor() {}
00153     };
00154 
00158     class IncidenceObserver
00159     {
00160       public:
00161 
00165         virtual ~IncidenceObserver() {}
00166 
00172         virtual void incidenceUpdated( IncidenceBase *incidenceBase ) = 0;
00173     };
00174 
00178     IncidenceBase();
00179 
00186     IncidenceBase( const IncidenceBase &ib );
00187 
00191     virtual ~IncidenceBase();
00192 
00198     bool operator==( const IncidenceBase &ib ) const;
00199 
00209     virtual bool accept( Visitor &v )
00210     {
00211       Q_UNUSED( v );
00212       return false;
00213     }
00214 
00218     virtual QByteArray type() const = 0;
00219 
00227     void setUid( const QString &uid );
00228 
00234     QString uid() const;
00235 
00239     KUrl uri() const;
00240 
00249     void setLastModified( const KDateTime &lm );
00250 
00256     KDateTime lastModified() const;
00257 
00264     void setOrganizer( const Person &organizer );
00265 
00272     void setOrganizer( const QString &organizer );
00273 
00279     Person organizer() const;
00280 
00288     virtual void setReadOnly( bool readOnly );
00289 
00294     bool isReadOnly() const { return mReadOnly; }
00295 
00304     virtual void setDtStart( const KDateTime &dtStart );
00305 
00310     virtual KDateTime dtStart() const;
00311 
00321     virtual QString dtStartTimeStr( bool shortfmt = true,
00322                                     const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00323 
00333     virtual QString dtStartDateStr( bool shortfmt = true,
00334                                     const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00335 
00345     virtual QString dtStartStr( bool shortfmt = true,
00346                                 const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00347 
00355     virtual void setDuration( const Duration &duration );
00356 
00362     Duration duration() const;
00363 
00371     void setHasDuration( bool hasDuration );
00372 
00378     bool hasDuration() const;
00379 
00386     bool allDay() const;
00387 
00396     void setAllDay( bool allDay );
00397 
00412     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00413                              const KDateTime::Spec &newSpec );
00414 
00422     void addComment( const QString &comment );
00423 
00432     bool removeComment( const QString &comment );
00433 
00437     void clearComments();
00438 
00442     QStringList comments() const;
00443 
00451     void addAttendee( Attendee *attendee, bool doUpdate = true );
00452 
00456     void clearAttendees();
00457 
00461     const Attendee::List &attendees() const;
00462 
00466     int attendeeCount() const;
00467 
00475     Attendee *attendeeByMail( const QString &email ) const;
00476 
00487     Attendee *attendeeByMails( const QStringList &emails,
00488                                const QString &email = QString() ) const;
00489 
00496     Attendee *attendeeByUid( const QString &uid ) const;
00497 
00506     void registerObserver( IncidenceObserver *observer );
00507 
00515     void unRegisterObserver( IncidenceObserver *observer );
00516 
00521     void updated();
00522 
00528     void startUpdates();
00529 
00535     void endUpdates();
00536 
00537   protected:
00542     virtual void customPropertyUpdated();
00543 
00547     bool mReadOnly;
00548 
00549   private:
00550     //@cond PRIVATE
00551     class Private;
00552     Private *const d;
00553     //@endcond
00554 };
00555 
00556 }
00557 
00558 #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"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.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