libkcal Library API Documentation

incidencebase.h

00001 /* 00002 This file is part of libkcal. 00003 00004 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 #ifndef KCAL_INCIDENCEBASE_H 00022 #define KCAL_INCIDENCEBASE_H 00023 00024 #include <qdatetime.h> 00025 #include <qstringlist.h> 00026 #include <qvaluelist.h> 00027 #include <qptrlist.h> 00028 00029 #include "customproperties.h" 00030 #include "attendee.h" 00031 00032 namespace KCal { 00033 00034 typedef QValueList<QDate> DateList; 00035 typedef QValueList<QDateTime> DateTimeList; 00036 00040 class IncidenceBase : public CustomProperties 00041 { 00042 public: 00043 class Observer { 00044 public: 00045 virtual void incidenceUpdated( IncidenceBase * ) = 0; 00046 }; 00047 00048 IncidenceBase(); 00049 IncidenceBase( const IncidenceBase & ); 00050 virtual ~IncidenceBase(); 00051 bool operator==( const IncidenceBase & ) const; 00052 00053 virtual QCString type() const = 0; 00054 00056 void setUid( const QString & ); 00058 QString uid() const; 00059 00061 void setLastModified( const QDateTime &lm ); 00063 QDateTime lastModified() const; 00064 00066 void setOrganizer( const QString &o ); 00067 QString organizer() const; 00068 00070 virtual void setReadOnly( bool ); 00072 bool isReadOnly() const { return mReadOnly; } 00073 00075 virtual void setDtStart( const QDateTime &dtStart ); 00077 virtual QDateTime dtStart() const; 00080 virtual QString dtStartTimeStr() const; 00083 virtual QString dtStartDateStr( bool shortfmt = true ) const; 00086 virtual QString dtStartStr() const; 00087 00088 virtual void setDuration( int seconds ); 00089 int duration() const; 00090 void setHasDuration( bool ); 00091 bool hasDuration() const; 00092 00095 bool doesFloat() const; 00097 void setFloats( bool f ); 00098 00099 // 00100 // Comments 00101 // 00102 00110 void addComment(const QString& comment); 00111 00120 bool removeComment(QString& comment); 00121 00123 void clearComments(); 00124 00126 QStringList comments() const; 00127 00134 void addAttendee( Attendee *a, bool doUpdate = true ); 00138 void clearAttendees(); 00142 const Attendee::List &attendees() const { return mAttendees; }; 00146 int attendeeCount() const { return mAttendees.count(); }; 00150 Attendee *attendeeByMail( const QString & ) const; 00154 Attendee *attendeeByMails( const QStringList &, 00155 const QString &email = QString::null ) const; 00159 Attendee *attendeeByUid( const QString &uid ) const; 00160 00164 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; 00168 void setSyncStatus( int status ); 00172 int syncStatus() const; 00173 00177 void setPilotId( unsigned long id ); 00181 unsigned long pilotId() const; 00182 00187 void registerObserver( Observer * ); 00191 void unRegisterObserver( Observer * ); 00196 void updated(); 00197 00198 protected: 00199 bool mReadOnly; 00200 00201 private: 00202 // base components 00203 QDateTime mDtStart; 00204 QString mOrganizer; 00205 QString mUid; 00206 QDateTime mLastModified; 00207 Attendee::List mAttendees; 00208 QStringList mComments; 00209 00210 bool mFloats; 00211 00212 int mDuration; 00213 bool mHasDuration; 00214 00215 // PILOT SYNCHRONIZATION STUFF 00216 unsigned long mPilotId; // unique id for pilot sync 00217 int mSyncStatus; // status (for sync) 00218 00219 QPtrList<Observer> mObservers; 00220 00221 class Private; 00222 Private *d; 00223 }; 00224 00225 } 00226 00227 #endif
KDE Logo
This file is part of the documentation for libkcal Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 1 15:18:42 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003