scheduler.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SCHEDULER_H
00021 #define SCHEDULER_H
00022
00023
00024
00025 #include <qstring.h>
00026 #include <qptrlist.h>
00027
00028 namespace KCal {
00029
00030 class IncidenceBase;
00031 class Event;
00032 class Calendar;
00033 class ICalFormat;
00034
00042 class ScheduleMessage {
00043 public:
00045 enum Status { PublishNew, Obsolete, RequestNew, RequestUpdate, Unknown };
00046
00051 ScheduleMessage(IncidenceBase *,int method,Status status);
00052 ~ScheduleMessage() {};
00053
00055 IncidenceBase *event() { return mIncidence; }
00057 int method() { return mMethod; }
00059 Status status() { return mStatus; }
00061 QString error() { return mError; }
00062
00064 static QString statusName(Status status);
00065
00066 private:
00067 IncidenceBase *mIncidence;
00068 int mMethod;
00069 Status mStatus;
00070 QString mError;
00071 };
00072
00078 class Scheduler {
00079 public:
00081 enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter,
00082 Declinecounter,NoMethod };
00083
00085 Scheduler(Calendar *calendar);
00086 virtual ~Scheduler();
00087
00089 virtual bool publish (IncidenceBase *incidence,const QString &recipients) = 0;
00092 virtual bool performTransaction(IncidenceBase *incidence,Method method) = 0;
00096 virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0;
00098 virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0;
00099
00106 bool acceptTransaction(IncidenceBase *,Method method,ScheduleMessage::Status status);
00107
00109 static QString methodName(Method);
00110
00111 virtual bool deleteTransaction(IncidenceBase *incidence);
00112
00113 protected:
00114
00115 bool acceptPublish(IncidenceBase *,ScheduleMessage::Status status, Method method);
00116 bool acceptRequest(IncidenceBase *,ScheduleMessage::Status status);
00117 bool acceptAdd(IncidenceBase *,ScheduleMessage::Status status);
00118 bool acceptCancel(IncidenceBase *,ScheduleMessage::Status status);
00119 bool acceptDeclineCounter(IncidenceBase *,ScheduleMessage::Status status);
00120 bool acceptReply(IncidenceBase *,ScheduleMessage::Status status, Method method);
00121 bool acceptRefresh(IncidenceBase *,ScheduleMessage::Status status);
00122 bool acceptCounter(IncidenceBase *,ScheduleMessage::Status status);
00123 bool acceptFreeBusy(IncidenceBase *,Method method);
00124
00125 Calendar *mCalendar;
00126 ICalFormat *mFormat;
00127 };
00128
00129 }
00130
00131 #endif // SCHEDULER_H
This file is part of the documentation for kdelibs Version 3.1.5.