scheduler.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KCAL_SCHEDULER_H
00022 #define KCAL_SCHEDULER_H
00023
00024 #include <qstring.h>
00025 #include <qptrlist.h>
00026
00027 namespace KCal {
00028
00029 class IncidenceBase;
00030 class Event;
00031 class Calendar;
00032 class ICalFormat;
00033 class FreeBusyCache;
00034
00042 class ScheduleMessage
00043 {
00044 public:
00048 enum Status { PublishNew, PublishUpdate, Obsolete, RequestNew,
00049 RequestUpdate, Unknown };
00050
00055 ScheduleMessage( IncidenceBase *, int method, Status status );
00056 ~ScheduleMessage() {};
00057
00061 IncidenceBase *event() { return mIncidence; }
00065 int method() { return mMethod; }
00069 Status status() { return mStatus; }
00073 QString error() { return mError; }
00074
00078 static QString statusName( Status status );
00079
00080 private:
00081 IncidenceBase *mIncidence;
00082 int mMethod;
00083 Status mStatus;
00084 QString mError;
00085
00086 class Private;
00087 Private *d;
00088 };
00089
00095 class Scheduler
00096 {
00097 public:
00101 enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter,
00102 Declinecounter,NoMethod };
00103
00107 Scheduler( Calendar *calendar );
00108 virtual ~Scheduler();
00109
00113 virtual bool publish( IncidenceBase *incidence,
00114 const QString &recipients ) = 0;
00119 virtual bool performTransaction( IncidenceBase *incidence,
00120 Method method ) = 0;
00126 virtual bool performTransaction( IncidenceBase *incidence, Method method,
00127 const QString &recipients ) = 0;
00131 virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0;
00132
00140 bool acceptTransaction( IncidenceBase *, Method method,
00141 ScheduleMessage::Status status,
00142 const QString& attendee = QString::null );
00143
00147 static QString methodName( Method );
00151 static QString translatedMethodName( Method );
00152
00153 virtual bool deleteTransaction( IncidenceBase *incidence );
00154
00158 virtual QString freeBusyDir() = 0;
00159
00163 void setFreeBusyCache( FreeBusyCache * );
00167 FreeBusyCache *freeBusyCache() const;
00168
00169 protected:
00170 bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status,
00171 Method method );
00172 bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status,
00173 const QString & attendee );
00174 bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status );
00175 bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status );
00176 bool acceptDeclineCounter( IncidenceBase *,
00177 ScheduleMessage::Status status );
00178 bool acceptReply( IncidenceBase *, ScheduleMessage::Status status,
00179 Method method );
00180 bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status );
00181 bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status );
00182 bool acceptFreeBusy( IncidenceBase *, Method method );
00183
00184 Calendar *mCalendar;
00185 ICalFormat *mFormat;
00186
00187 private:
00188 class Private;
00189 Private *d;
00190 };
00191
00192 }
00193
00194 #endif
This file is part of the documentation for libkcal Library Version 3.3.2.