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 
00041 class ScheduleMessage
00042 {
00043   public:
00047     enum Status { PublishNew, PublishUpdate, Obsolete, RequestNew,
00048                   RequestUpdate, Unknown };
00049   
00054     ScheduleMessage( IncidenceBase *, int method, Status status );
00055     ~ScheduleMessage() {};
00056     
00060     IncidenceBase *event() { return mIncidence; }
00064     int method() { return mMethod; }
00068     Status status() { return mStatus; }
00072     QString error() { return mError; }
00073 
00077     static QString statusName( Status status );
00078 
00079   private:
00080     IncidenceBase *mIncidence;
00081     int mMethod;
00082     Status mStatus;
00083     QString mError;
00084 
00085     class Private;
00086     Private *d;
00087 };
00088 
00094 class Scheduler
00095 {
00096   public:
00100     enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter,
00101                   Declinecounter,NoMethod };
00102   
00106     Scheduler( Calendar *calendar );
00107     virtual ~Scheduler();
00108     
00112     virtual bool publish( IncidenceBase *incidence,
00113                           const QString &recipients ) = 0;
00118     virtual bool performTransaction( IncidenceBase *incidence,
00119                                      Method method ) = 0;
00125     virtual bool performTransaction( IncidenceBase *incidence, Method method,
00126                                      const QString &recipients ) = 0;
00130     virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0;
00131 
00138     bool acceptTransaction( IncidenceBase *, Method method,
00139                             ScheduleMessage::Status status );
00140 
00144     static QString methodName( Method );
00148     static QString translatedMethodName( Method );
00149 
00150     virtual bool deleteTransaction( IncidenceBase *incidence );
00151     
00155     virtual QString freeBusyDir() = 0;
00156 
00157   protected:
00158     bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status,
00159                         Method method );
00160     bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status );
00161     bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status );
00162     bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status );
00163     bool acceptDeclineCounter( IncidenceBase *,
00164                                ScheduleMessage::Status status );
00165     bool acceptReply( IncidenceBase *, ScheduleMessage::Status status,
00166                       Method method );
00167     bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status );
00168     bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status );
00169     bool acceptFreeBusy( IncidenceBase *, Method method );
00170 
00171     Calendar *mCalendar;
00172     ICalFormat *mFormat;
00173 
00174   private:
00175     class Private;
00176     Private *d;
00177 };
00178 
00179 }
00180 
00181 #endif
KDE Logo
This file is part of the documentation for libkcal Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:23 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003