KCal Library
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 "kcal_export.h"
00025
00026 #include <QtCore/QString>
00027 #include <QtCore/QList>
00028
00029 namespace KCal {
00030
00034 enum iTIPMethod {
00035 iTIPPublish,
00036 iTIPRequest,
00037 iTIPReply,
00038 iTIPAdd,
00039 iTIPCancel,
00040 iTIPRefresh,
00041 iTIPCounter,
00042 iTIPDeclineCounter,
00043 iTIPNoMethod
00044 };
00045
00046 class IncidenceBase;
00047 class Calendar;
00048 class ICalFormat;
00049 class FreeBusyCache;
00050
00058 class KCAL_EXPORT ScheduleMessage
00059 {
00060 public:
00064 enum Status {
00065 PublishNew,
00066 PublishUpdate,
00067 Obsolete,
00068 RequestNew,
00069 RequestUpdate,
00070 Unknown
00071 };
00072
00077 ScheduleMessage( IncidenceBase *incidence, iTIPMethod method, Status status );
00078
00082 ~ScheduleMessage();
00083
00087 IncidenceBase *event();
00088
00092 iTIPMethod method();
00093
00097 Status status();
00098
00102 static QString statusName( Status status );
00103
00107 QString error();
00108
00109 private:
00110 Q_DISABLE_COPY( ScheduleMessage )
00111 class Private;
00112 Private *const d;
00113 };
00114
00120 class KCAL_EXPORT Scheduler
00121 {
00122 public:
00126 explicit Scheduler( Calendar *calendar );
00127 virtual ~Scheduler();
00128
00132 virtual bool publish( IncidenceBase *incidence,
00133 const QString &recipients ) = 0;
00141 virtual bool performTransaction( IncidenceBase *incidence,
00142 iTIPMethod method ) = 0;
00143
00153 virtual bool performTransaction( IncidenceBase *incidence,
00154 iTIPMethod method,
00155 const QString &recipients ) = 0;
00156
00160 virtual QList<ScheduleMessage*> retrieveTransactions() = 0;
00161
00171 bool acceptTransaction( IncidenceBase *, iTIPMethod method,
00172 ScheduleMessage::Status status );
00173
00177 static QString methodName( iTIPMethod method );
00178
00182 static QString translatedMethodName( iTIPMethod method );
00183
00184 virtual bool deleteTransaction( IncidenceBase *incidence );
00185
00189 virtual QString freeBusyDir() = 0;
00190
00194 void setFreeBusyCache( FreeBusyCache * );
00195
00199 FreeBusyCache *freeBusyCache() const;
00200
00201 protected:
00202 bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status, iTIPMethod method );
00203 bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status );
00204 bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status );
00205 bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status );
00206 bool acceptDeclineCounter( IncidenceBase *, ScheduleMessage::Status status );
00207 bool acceptReply( IncidenceBase *, ScheduleMessage::Status status, iTIPMethod method );
00208 bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status );
00209 bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status );
00210 bool acceptFreeBusy( IncidenceBase *, iTIPMethod method );
00211
00212 Calendar *mCalendar;
00213 ICalFormat *mFormat;
00214
00215 private:
00216 Q_DISABLE_COPY( Scheduler )
00217 struct Private;
00218 Private *const d;
00219 };
00220
00221 }
00222
00223 #endif