libkcal Library API Documentation

scheduler.h

00001 /*
00002     This file is part of libkcal.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef SCHEDULER_H
00021 #define SCHEDULER_H
00022 
00023 // iTIP transactions base class
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
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:27 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001