00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KCALUTILS_SCHEDULER_H
00022 #define KCALUTILS_SCHEDULER_H
00023
00024 #include "kcalutils_export.h"
00025
00026 #include <kcalcore/schedulemessage.h>
00027 #include <kcalcore/incidencebase.h>
00028 #include <kcalcore/calendar.h>
00029
00030 #include <QtCore/QString>
00031 #include <QtCore/QList>
00032
00033 namespace KCalCore {
00034 class ICalFormat;
00035 class FreeBusyCache;
00036 }
00037
00038 namespace KCalUtils {
00044 class KCALUTILS_EXPORT Scheduler
00045 {
00046 public:
00050 explicit Scheduler( const KCalCore::Calendar::Ptr &calendar );
00051 virtual ~Scheduler();
00052
00056 virtual bool publish( const KCalCore::IncidenceBase::Ptr &incidence,
00057 const QString &recipients ) = 0;
00065 virtual bool performTransaction( const KCalCore::IncidenceBase::Ptr &incidence,
00066 KCalCore::iTIPMethod method ) = 0;
00067
00076 virtual bool performTransaction( const KCalCore::IncidenceBase::Ptr &incidence,
00077 KCalCore::iTIPMethod method, const QString &recipients ) = 0;
00078
00082
00083 virtual QList<KCalCore::ScheduleMessage*> retrieveTransactions() = 0;
00084
00097 bool acceptTransaction( const KCalCore::IncidenceBase::Ptr &incidence,
00098 KCalCore::iTIPMethod method,
00099 KCalCore::ScheduleMessage::Status status,
00100 const QString &email = QString() );
00101
00102 virtual bool deleteTransaction( const KCalCore::IncidenceBase::Ptr &incidence );
00103
00107 virtual QString freeBusyDir() = 0;
00108
00112 void setFreeBusyCache( KCalCore::FreeBusyCache * );
00113
00117 KCalCore::FreeBusyCache *freeBusyCache() const;
00118
00119 protected:
00120 bool acceptPublish( const KCalCore::IncidenceBase::Ptr &,
00121 KCalCore::ScheduleMessage::Status status,
00122 KCalCore::iTIPMethod method );
00123
00124 bool acceptRequest( const KCalCore::IncidenceBase::Ptr &,
00125 KCalCore::ScheduleMessage::Status status,
00126 const QString &email );
00127
00128 bool acceptAdd( const KCalCore::IncidenceBase::Ptr &,
00129 KCalCore::ScheduleMessage::Status status );
00130
00131 bool acceptCancel( const KCalCore::IncidenceBase::Ptr &,
00132 KCalCore::ScheduleMessage::Status status,
00133 const QString &attendee );
00134
00135 bool acceptDeclineCounter( const KCalCore::IncidenceBase::Ptr &,
00136 KCalCore::ScheduleMessage::Status status );
00137
00138 bool acceptReply( const KCalCore::IncidenceBase::Ptr &,
00139 KCalCore::ScheduleMessage::Status status,
00140 KCalCore::iTIPMethod method );
00141
00142 bool acceptRefresh( const KCalCore::IncidenceBase::Ptr &,
00143 KCalCore::ScheduleMessage::Status status );
00144
00145 bool acceptCounter( const KCalCore::IncidenceBase::Ptr &,
00146 KCalCore::ScheduleMessage::Status status );
00147
00148 bool acceptFreeBusy( const KCalCore::IncidenceBase::Ptr &, KCalCore::iTIPMethod method );
00149
00150 KCalCore::Calendar::Ptr mCalendar;
00151 KCalCore::ICalFormat *mFormat;
00152
00153 private:
00154 Q_DISABLE_COPY( Scheduler )
00155 struct Private;
00156 Private *const d;
00157 };
00158
00159 }
00160
00161 #endif