libkcal Library API Documentation

scheduler.h

00001 /* 00002 This file is part of libkcal. 00003 00004 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 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 class FreeBusyCache; 00034 00042 class ScheduleMessage 00043 { 00044 public: 00048 enum Status { PublishNew, PublishUpdate, Obsolete, RequestNew, 00049 RequestUpdate, Unknown }; 00050 00055 ScheduleMessage( IncidenceBase *, int method, Status status ); 00056 ~ScheduleMessage() {}; 00057 00061 IncidenceBase *event() { return mIncidence; } 00065 int method() { return mMethod; } 00069 Status status() { return mStatus; } 00073 QString error() { return mError; } 00074 00078 static QString statusName( Status status ); 00079 00080 private: 00081 IncidenceBase *mIncidence; 00082 int mMethod; 00083 Status mStatus; 00084 QString mError; 00085 00086 class Private; 00087 Private *d; 00088 }; 00089 00095 class Scheduler 00096 { 00097 public: 00101 enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter, 00102 Declinecounter,NoMethod }; 00103 00107 Scheduler( Calendar *calendar ); 00108 virtual ~Scheduler(); 00109 00113 virtual bool publish( IncidenceBase *incidence, 00114 const QString &recipients ) = 0; 00119 virtual bool performTransaction( IncidenceBase *incidence, 00120 Method method ) = 0; 00126 virtual bool performTransaction( IncidenceBase *incidence, Method method, 00127 const QString &recipients ) = 0; 00131 virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0; 00132 00139 bool acceptTransaction( IncidenceBase *, Method method, 00140 ScheduleMessage::Status status ); 00141 00145 static QString methodName( Method ); 00149 static QString translatedMethodName( Method ); 00150 00151 virtual bool deleteTransaction( IncidenceBase *incidence ); 00152 00156 virtual QString freeBusyDir() = 0; 00157 00161 void setFreeBusyCache( FreeBusyCache * ); 00165 FreeBusyCache *freeBusyCache() const; 00166 00167 protected: 00168 bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status, 00169 Method method ); 00170 bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status ); 00171 bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status ); 00172 bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status ); 00173 bool acceptDeclineCounter( IncidenceBase *, 00174 ScheduleMessage::Status status ); 00175 bool acceptReply( IncidenceBase *, ScheduleMessage::Status status, 00176 Method method ); 00177 bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status ); 00178 bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status ); 00179 bool acceptFreeBusy( IncidenceBase *, Method method ); 00180 00181 Calendar *mCalendar; 00182 ICalFormat *mFormat; 00183 00184 private: 00185 class Private; 00186 Private *d; 00187 }; 00188 00189 } 00190 00191 #endif
KDE Logo
This file is part of the documentation for libkcal Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 21 19:46:20 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003