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
00166 bool KDE_DEPRECATED acceptTransaction( IncidenceBase *incidence, iTIPMethod method,
00167 ScheduleMessage::Status status );
00168
00181 bool acceptTransaction( IncidenceBase *incidence,
00182 iTIPMethod method,
00183 ScheduleMessage::Status status,
00184 const QString &email );
00185
00189 static QString methodName( iTIPMethod method );
00190
00194 static QString translatedMethodName( iTIPMethod method );
00195
00196 virtual bool deleteTransaction( IncidenceBase *incidence );
00197
00201 virtual QString freeBusyDir() = 0;
00202
00206 void setFreeBusyCache( FreeBusyCache * );
00207
00211 FreeBusyCache *freeBusyCache() const;
00212
00213 protected:
00214 bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status, iTIPMethod method );
00219 bool KDE_DEPRECATED acceptRequest( IncidenceBase *, ScheduleMessage::Status status );
00220 bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status,
00221 const QString &email );
00222 bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status );
00223 KDE_DEPRECATED bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status );
00224 bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status,
00225 const QString & attendee );
00226 bool acceptDeclineCounter( IncidenceBase *, ScheduleMessage::Status status );
00227 bool acceptReply( IncidenceBase *, ScheduleMessage::Status status, iTIPMethod method );
00228 bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status );
00229 bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status );
00230 bool acceptFreeBusy( IncidenceBase *, iTIPMethod method );
00231
00232 Calendar *mCalendar;
00233 ICalFormat *mFormat;
00234
00235 private:
00236 Q_DISABLE_COPY( Scheduler )
00237 struct Private;
00238 Private *const d;
00239 };
00240
00241 }
00242
00243 #endif