libkcal

scheduler.h
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 #ifndef KCAL_SCHEDULER_H
22 #define KCAL_SCHEDULER_H
23 
24 #include <tqstring.h>
25 #include <tqptrlist.h>
26 
27 #include "libkcal_export.h"
28 
29 namespace KCal {
30 
31 class IncidenceBase;
32 class Event;
33 class Calendar;
34 class ICalFormat;
35 class FreeBusyCache;
36 
45 {
46  public:
50  enum Status { PublishNew, PublishUpdate, Obsolete, RequestNew,
51  RequestUpdate, Unknown };
52 
58  ~ScheduleMessage() {};
59 
63  IncidenceBase *event() { return mIncidence; }
67  int method() { return mMethod; }
71  Status status() { return mStatus; }
75  TQString error() { return mError; }
76 
80  static TQString statusName( Status status );
81 
82  private:
83  IncidenceBase *mIncidence;
84  int mMethod;
85  Status mStatus;
86  TQString mError;
87 
88  class Private;
89  Private *d;
90 };
91 
97 class LIBKCAL_EXPORT Scheduler
98 {
99  public:
103  enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter,
104  Declinecounter,NoMethod };
105 
109  Scheduler( Calendar *calendar );
110  virtual ~Scheduler();
111 
115  virtual bool publish( IncidenceBase *incidence,
116  const TQString &recipients ) = 0;
121  virtual bool performTransaction( IncidenceBase *incidence,
122  Method method ) = 0;
128  virtual bool performTransaction( IncidenceBase *incidence, Method method,
129  const TQString &recipients ) = 0;
133  virtual TQPtrList<ScheduleMessage> retrieveTransactions() = 0;
134 
142  bool acceptTransaction( IncidenceBase *, Method method,
144  const TQString& attendee = TQString() );
145 
149  static TQString methodName( Method );
153  static TQString translatedMethodName( Method );
154 
155  virtual bool deleteTransaction( IncidenceBase *incidence );
156 
160  virtual TQString freeBusyDir() = 0;
161 
165  void setFreeBusyCache( FreeBusyCache * );
169  FreeBusyCache *freeBusyCache() const;
170 
171  protected:
172  bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status,
173  Method method );
174  bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status,
175  const TQString & attendee );
176  bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status );
177  TDE_DEPRECATED bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status );
178  bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status,
179  const TQString & attendee );
180  bool acceptDeclineCounter( IncidenceBase *,
181  ScheduleMessage::Status status );
182  bool acceptReply( IncidenceBase *, ScheduleMessage::Status status,
183  Method method );
184  bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status );
185  bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status );
186  bool acceptFreeBusy( IncidenceBase *, Method method );
187 
188  Calendar *mCalendar;
189  ICalFormat *mFormat;
190 
191  private:
192  class Private;
193  Private *d;
194 };
195 
196 }
197 
198 #endif
This is the main "calendar" object class.
Definition: calendar.h:171
This class implements the iCalendar format.
Definition: icalformat.h:44
This class provides the base class common to all calendar components.
Definition: incidencebase.h:46
This class provides an encapsulation of a scheduling message.
Definition: scheduler.h:45
TQString error()
Return error message if there is any.
Definition: scheduler.h:75
IncidenceBase * event()
Return event associated with this message.
Definition: scheduler.h:63
ScheduleMessage(IncidenceBase *, int method, Status status)
Create a scheduling message with method as defined in Scheduler::Method and a status.
Definition: scheduler.cpp:42
int method()
Return iTIP method associated with this message.
Definition: scheduler.h:67
Status status()
Return status of this message.
Definition: scheduler.h:71
Status
Message status.
Definition: scheduler.h:50
static TQString statusName(Status status)
Return a human-readable name for an iTIP message status.
Definition: scheduler.cpp:49
This class provides an encapsulation of iTIP transactions.
Definition: scheduler.h:98
virtual TQString freeBusyDir()=0
Returns the directory where the free-busy information is stored.
virtual bool publish(IncidenceBase *incidence, const TQString &recipients)=0
iTIP publish action
virtual TQPtrList< ScheduleMessage > retrieveTransactions()=0
Retrieve incoming iTIP transactions.
virtual bool performTransaction(IncidenceBase *incidence, Method method, const TQString &recipients)=0
Perform iTIP transaction on incidence to specified recipient(s).
Method
iTIP methods.
Definition: scheduler.h:103
virtual bool performTransaction(IncidenceBase *incidence, Method method)=0
Perform iTIP transaction on incidence.
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38