• Skip to content
  • Skip to link menu
KDE 4.3 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 
00203     // KDE5: make protected to prevent accidental usage
00204     IncidenceBase &operator=( const IncidenceBase &other );
00205 
00216     // KDE5: make protected to prevent accidental usage
00217     bool operator==( const IncidenceBase &ib ) const;
00218 
00228     virtual bool accept( Visitor &v )
00229     {
00230       Q_UNUSED( v );
00231       return false;
00232     }
00233 
00237     virtual QByteArray type() const = 0;
00238 
00246     void setUid( const QString &uid );
00247 
00253     QString uid() const;
00254 
00258     KUrl uri() const;
00259 
00268     void setLastModified( const KDateTime &lm );
00269 
00275     KDateTime lastModified() const;
00276 
00283     void setOrganizer( const Person &organizer );
00284 
00291     void setOrganizer( const QString &organizer );
00292 
00298     Person organizer() const;
00299 
00307     virtual void setReadOnly( bool readOnly );
00308 
00313     bool isReadOnly() const { return mReadOnly; }
00314 
00323     virtual void setDtStart( const KDateTime &dtStart );
00324 
00329     virtual KDateTime dtStart() const;
00330 
00342     virtual KDE_DEPRECATED QString dtStartTimeStr(
00343       bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00344 
00356     virtual KDE_DEPRECATED QString dtStartDateStr(
00357       bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00358 
00370     virtual KDE_DEPRECATED QString dtStartStr(
00371       bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00372 
00380     virtual void setDuration( const Duration &duration );
00381 
00387     Duration duration() const;
00388 
00396     void setHasDuration( bool hasDuration );
00397 
00403     bool hasDuration() const;
00404 
00411     bool allDay() const;
00412 
00421     void setAllDay( bool allDay );
00422 
00437     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00438                              const KDateTime::Spec &newSpec );
00439 
00447     void addComment( const QString &comment );
00448 
00457     bool removeComment( const QString &comment );
00458 
00462     void clearComments();
00463 
00467     QStringList comments() const;
00468 
00476     void addAttendee( Attendee *attendee, bool doUpdate = true );
00477 
00481     void clearAttendees();
00482 
00486     const Attendee::List &attendees() const;
00487 
00491     int attendeeCount() const;
00492 
00500     Attendee *attendeeByMail( const QString &email ) const;
00501 
00512     Attendee *attendeeByMails( const QStringList &emails,
00513                                const QString &email = QString() ) const;
00514 
00521     Attendee *attendeeByUid( const QString &uid ) const;
00522 
00531     void registerObserver( IncidenceObserver *observer );
00532 
00540     void unRegisterObserver( IncidenceObserver *observer );
00541 
00546     void updated();
00547 
00553     void startUpdates();
00554 
00560     void endUpdates();
00561 
00562   protected:
00567     virtual void customPropertyUpdated();
00568 
00572     bool mReadOnly;
00573 
00574   private:
00575     //@cond PRIVATE
00576     class Private;
00577     Private *const d;
00578     //@endcond
00579 };
00580 
00581 }
00582 
00583 #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
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • 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