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
00041 class ScheduleMessage
00042 {
00043 public:
00047 enum Status { PublishNew, PublishUpdate, Obsolete, RequestNew,
00048 RequestUpdate, Unknown };
00049
00054 ScheduleMessage( IncidenceBase *, int method, Status status );
00055 ~ScheduleMessage() {};
00056
00060 IncidenceBase *event() { return mIncidence; }
00064 int method() { return mMethod; }
00068 Status status() { return mStatus; }
00072 QString error() { return mError; }
00073
00077 static QString statusName( Status status );
00078
00079 private:
00080 IncidenceBase *mIncidence;
00081 int mMethod;
00082 Status mStatus;
00083 QString mError;
00084
00085 class Private;
00086 Private *d;
00087 };
00088
00094 class Scheduler
00095 {
00096 public:
00100 enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter,
00101 Declinecounter,NoMethod };
00102
00106 Scheduler( Calendar *calendar );
00107 virtual ~Scheduler();
00108
00112 virtual bool publish( IncidenceBase *incidence,
00113 const QString &recipients ) = 0;
00118 virtual bool performTransaction( IncidenceBase *incidence,
00119 Method method ) = 0;
00125 virtual bool performTransaction( IncidenceBase *incidence, Method method,
00126 const QString &recipients ) = 0;
00130 virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0;
00131
00138 bool acceptTransaction( IncidenceBase *, Method method,
00139 ScheduleMessage::Status status );
00140
00144 static QString methodName( Method );
00148 static QString translatedMethodName( Method );
00149
00150 virtual bool deleteTransaction( IncidenceBase *incidence );
00151
00155 virtual QString freeBusyDir() = 0;
00156
00157 protected:
00158 bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status,
00159 Method method );
00160 bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status );
00161 bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status );
00162 bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status );
00163 bool acceptDeclineCounter( IncidenceBase *,
00164 ScheduleMessage::Status status );
00165 bool acceptReply( IncidenceBase *, ScheduleMessage::Status status,
00166 Method method );
00167 bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status );
00168 bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status );
00169 bool acceptFreeBusy( IncidenceBase *, Method method );
00170
00171 Calendar *mCalendar;
00172 ICalFormat *mFormat;
00173
00174 private:
00175 class Private;
00176 Private *d;
00177 };
00178
00179 }
00180
00181 #endif
This file is part of the documentation for libkcal Library Version 3.2.2.