• Skip to content
  • Skip to link menu
KDE 4.2 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 "attendee.h"
00058 #include "customproperties.h"
00059 #include "duration.h"
00060 #include "sortablelist.h"
00061 
00062 #include <kdatetime.h>
00063 
00064 #include <QtCore/QStringList>
00065 #include <QtCore/QByteArray>
00066 
00067 class KUrl;
00068 
00069 namespace KCal {
00070 
00072 typedef SortableList<QDate> DateList;
00074 typedef SortableList<KDateTime> DateTimeList;
00075 class Event;
00076 class Todo;
00077 class Journal;
00078 class FreeBusy;
00079 
00102 class KCAL_EXPORT IncidenceBase : public CustomProperties
00103 {
00104   public:
00112     class KCAL_EXPORT Visitor //krazy:exclude=dpointer
00113     {
00114       public:
00116         virtual ~Visitor() {}
00117 
00123         virtual bool visit( Event *event );
00124 
00130         virtual bool visit( Todo *todo );
00131 
00137         virtual bool visit( Journal *journal );
00138 
00144         virtual bool visit( FreeBusy *freebusy );
00145 
00146       protected:
00151         Visitor() {}
00152     };
00153 
00157     class IncidenceObserver
00158     {
00159       public:
00160 
00164         virtual ~IncidenceObserver() {}
00165 
00171         virtual void incidenceUpdated( IncidenceBase *incidenceBase ) = 0;
00172     };
00173 
00177     IncidenceBase();
00178 
00185     IncidenceBase( const IncidenceBase &ib );
00186 
00190     virtual ~IncidenceBase();
00191 
00195     IncidenceBase &operator=( const IncidenceBase &other );
00196 
00202     bool operator==( const IncidenceBase &ib ) const;
00203 
00213     virtual bool accept( Visitor &v )
00214     {
00215       Q_UNUSED( v );
00216       return false;
00217     }
00218 
00222     virtual QByteArray type() const = 0;
00223 
00231     void setUid( const QString &uid );
00232 
00238     QString uid() const;
00239 
00243     KUrl uri() const;
00244 
00253     void setLastModified( const KDateTime &lm );
00254 
00260     KDateTime lastModified() const;
00261 
00268     void setOrganizer( const Person &organizer );
00269 
00276     void setOrganizer( const QString &organizer );
00277 
00283     Person organizer() const;
00284 
00292     virtual void setReadOnly( bool readOnly );
00293 
00298     bool isReadOnly() const { return mReadOnly; }
00299 
00308     virtual void setDtStart( const KDateTime &dtStart );
00309 
00314     virtual KDateTime dtStart() const;
00315 
00325     virtual QString dtStartTimeStr( bool shortfmt = true,
00326                                     const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00327 
00337     virtual QString dtStartDateStr( bool shortfmt = true,
00338                                     const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00339 
00349     virtual QString dtStartStr( bool shortfmt = true,
00350                                 const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00351 
00359     virtual void setDuration( const Duration &duration );
00360 
00366     Duration duration() const;
00367 
00375     void setHasDuration( bool hasDuration );
00376 
00382     bool hasDuration() const;
00383 
00390     bool allDay() const;
00391 
00400     void setAllDay( bool allDay );
00401 
00416     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00417                              const KDateTime::Spec &newSpec );
00418 
00426     void addComment( const QString &comment );
00427 
00436     bool removeComment( const QString &comment );
00437 
00441     void clearComments();
00442 
00446     QStringList comments() const;
00447 
00455     void addAttendee( Attendee *attendee, bool doUpdate = true );
00456 
00460     void clearAttendees();
00461 
00465     const Attendee::List &attendees() const;
00466 
00470     int attendeeCount() const;
00471 
00479     Attendee *attendeeByMail( const QString &email ) const;
00480 
00491     Attendee *attendeeByMails( const QStringList &emails,
00492                                const QString &email = QString() ) const;
00493 
00500     Attendee *attendeeByUid( const QString &uid ) const;
00501 
00510     void registerObserver( IncidenceObserver *observer );
00511 
00519     void unRegisterObserver( IncidenceObserver *observer );
00520 
00525     void updated();
00526 
00532     void startUpdates();
00533 
00539     void endUpdates();
00540 
00541   protected:
00546     virtual void customPropertyUpdated();
00547 
00551     bool mReadOnly;
00552 
00553   private:
00554     //@cond PRIVATE
00555     class Private;
00556     Private *const d;
00557     //@endcond
00558 };
00559 
00560 }
00561 
00562 #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.8
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