• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • 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_DEPRECATED IncidenceBase : public CustomProperties
00103 {
00104   public:
00112     class KCAL_EXPORT_DEPRECATED 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 
00242     //KDE5: virtual QString typeStr() const = 0;
00243 
00251     void setUid( const QString &uid );
00252 
00258     QString uid() const;
00259 
00263     KUrl uri() const;
00264 
00273     void setLastModified( const KDateTime &lm );
00274 
00280     KDateTime lastModified() const;
00281 
00288     void setOrganizer( const Person &organizer );
00289 
00296     void setOrganizer( const QString &organizer );
00297 
00303     Person organizer() const;
00304 
00312     virtual void setReadOnly( bool readOnly );
00313 
00318     bool isReadOnly() const { return mReadOnly; }
00319 
00328     virtual void setDtStart( const KDateTime &dtStart );
00329 
00334     virtual KDateTime dtStart() const;
00335 
00347     virtual KDE_DEPRECATED QString dtStartTimeStr(
00348       bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00349 
00361     virtual KDE_DEPRECATED QString dtStartDateStr(
00362       bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00363 
00375     virtual KDE_DEPRECATED QString dtStartStr(
00376       bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00377 
00385     virtual void setDuration( const Duration &duration );
00386 
00392     Duration duration() const;
00393 
00401     void setHasDuration( bool hasDuration );
00402 
00408     bool hasDuration() const;
00409 
00416     bool allDay() const;
00417 
00426     void setAllDay( bool allDay );
00427 
00442     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00443                              const KDateTime::Spec &newSpec );
00444 
00452     void addComment( const QString &comment );
00453 
00462     bool removeComment( const QString &comment );
00463 
00467     void clearComments();
00468 
00472     QStringList comments() const;
00473 
00481     void addAttendee( Attendee *attendee, bool doUpdate = true );
00482 
00486     void clearAttendees();
00487 
00491     const Attendee::List &attendees() const;
00492 
00496     int attendeeCount() const;
00497 
00505     Attendee *attendeeByMail( const QString &email ) const;
00506 
00517     Attendee *attendeeByMails( const QStringList &emails,
00518                                const QString &email = QString() ) const;
00519 
00526     Attendee *attendeeByUid( const QString &uid ) const;
00527 
00536     void registerObserver( IncidenceObserver *observer );
00537 
00545     void unRegisterObserver( IncidenceObserver *observer );
00546 
00551     void updated();
00552 
00558     void startUpdates();
00559 
00565     void endUpdates();
00566 
00567   protected:
00572     virtual void customPropertyUpdated();
00573 
00577     bool mReadOnly;
00578 
00579   private:
00580     //@cond PRIVATE
00581     class Private;
00582     Private *const d;
00583     //@endcond
00584 };
00585 
00586 }
00587 
00588 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue May 8 2012 00:03:21 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

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

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • 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
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal