summaryrefslogtreecommitdiffabout
path: root/libkcal/scheduler.h
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkcal/scheduler.h
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'libkcal/scheduler.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/scheduler.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h
index a9f43b9..357e98e 100644
--- a/libkcal/scheduler.h
+++ b/libkcal/scheduler.h
@@ -1,133 +1,133 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef SCHEDULER_H 20#ifndef SCHEDULER_H
21#define SCHEDULER_H 21#define SCHEDULER_H
22 22
23// iTIP transactions base class 23// iTIP transactions base class
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qptrlist.h> 26#include <q3ptrlist.h>
27 27
28namespace KCal { 28namespace KCal {
29 29
30class IncidenceBase; 30class IncidenceBase;
31class Event; 31class Event;
32class Calendar; 32class Calendar;
33class ICalFormat; 33class ICalFormat;
34 34
35/** 35/**
36 This class provides an encapsulation of a scheduling message. It associates an 36 This class provides an encapsulation of a scheduling message. It associates an
37 incidence with a method and status information. This class is used by the 37 incidence with a method and status information. This class is used by the
38 Scheduler class. 38 Scheduler class.
39 39
40 @short A Scheduling message 40 @short A Scheduling message
41*/ 41*/
42class ScheduleMessage { 42class ScheduleMessage {
43 public: 43 public:
44 /** Message status. */ 44 /** Message status. */
45 enum Status { PublishNew, Obsolete, RequestNew, RequestUpdate, Unknown }; 45 enum Status { PublishNew, Obsolete, RequestNew, RequestUpdate, Unknown };
46 46
47 /** 47 /**
48 Create a scheduling message with method as defined in Scheduler::Method 48 Create a scheduling message with method as defined in Scheduler::Method
49 and a status. 49 and a status.
50 */ 50 */
51 ScheduleMessage(IncidenceBase *,int method,Status status); 51 ScheduleMessage(IncidenceBase *,int method,Status status);
52 ~ScheduleMessage() {}; 52 ~ScheduleMessage() {};
53 53
54 /** Return event associated with this message. */ 54 /** Return event associated with this message. */
55 IncidenceBase *event() { return mIncidence; } 55 IncidenceBase *event() { return mIncidence; }
56 /** Return iTIP method associated with this message. */ 56 /** Return iTIP method associated with this message. */
57 int method() { return mMethod; } 57 int method() { return mMethod; }
58 /** Return status of this message. */ 58 /** Return status of this message. */
59 Status status() { return mStatus; } 59 Status status() { return mStatus; }
60 /** Return error message if there is any. */ 60 /** Return error message if there is any. */
61 QString error() { return mError; } 61 QString error() { return mError; }
62 62
63 /** Return a human-readable name for an ical message status. */ 63 /** Return a human-readable name for an ical message status. */
64 static QString statusName(Status status); 64 static QString statusName(Status status);
65 65
66 private: 66 private:
67 IncidenceBase *mIncidence; 67 IncidenceBase *mIncidence;
68 int mMethod; 68 int mMethod;
69 Status mStatus; 69 Status mStatus;
70 QString mError; 70 QString mError;
71}; 71};
72 72
73/** 73/**
74 This class provides an encapsulation of iTIP transactions. It is an abstract 74 This class provides an encapsulation of iTIP transactions. It is an abstract
75 base class for inheritance by implementations of the iTIP scheme like iMIP or 75 base class for inheritance by implementations of the iTIP scheme like iMIP or
76 iRIP. 76 iRIP.
77*/ 77*/
78class Scheduler { 78class Scheduler {
79 public: 79 public:
80 /** iTIP methods. */ 80 /** iTIP methods. */
81 enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter, 81 enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter,
82 Declinecounter,NoMethod }; 82 Declinecounter,NoMethod };
83 83
84 /** Create scheduler for calendar specified as argument. */ 84 /** Create scheduler for calendar specified as argument. */
85 Scheduler(Calendar *calendar); 85 Scheduler(Calendar *calendar);
86 virtual ~Scheduler(); 86 virtual ~Scheduler();
87 87
88 /** iTIP publish action */ 88 /** iTIP publish action */
89 virtual bool publish (IncidenceBase *incidence,const QString &recipients) = 0; 89 virtual bool publish (IncidenceBase *incidence,const QString &recipients) = 0;
90 /** Perform iTIP transaction on incidence. The method is specified as the 90 /** Perform iTIP transaction on incidence. The method is specified as the
91 method argumanet and can be any valid iTIP method. */ 91 method argumanet and can be any valid iTIP method. */
92 virtual bool performTransaction(IncidenceBase *incidence,Method method) = 0; 92 virtual bool performTransaction(IncidenceBase *incidence,Method method) = 0;
93 /** Perform iTIP transaction on incidence to specified recipient(s). The 93 /** Perform iTIP transaction on incidence to specified recipient(s). The
94 method is specified as the method argumanet and can be any valid iTIP 94 method is specified as the method argumanet and can be any valid iTIP
95 method. */ 95 method. */
96 virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0; 96 virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0;
97 /** Retrieve incoming iTIP transactions */ 97 /** Retrieve incoming iTIP transactions */
98 virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0; 98 virtual Q3PtrList<ScheduleMessage> retrieveTransactions() = 0;
99 99
100 /** 100 /**
101 Accept transaction. The incidence argument specifies the iCal compoennt 101 Accept transaction. The incidence argument specifies the iCal compoennt
102 on which the transaction acts. The status is the result of processing a 102 on which the transaction acts. The status is the result of processing a
103 iTIP message with the current calendar and specifies the action to be 103 iTIP message with the current calendar and specifies the action to be
104 taken for this incidence. 104 taken for this incidence.
105 */ 105 */
106 bool acceptTransaction(IncidenceBase *,Method method,ScheduleMessage::Status status); 106 bool acceptTransaction(IncidenceBase *,Method method,ScheduleMessage::Status status);
107 107
108 /** Return a machine-readable name for a iTIP method. */ 108 /** Return a machine-readable name for a iTIP method. */
109 static QString methodName(Method); 109 static QString methodName(Method);
110 /** Return a translated and human-readable name for a iTIP method. */ 110 /** Return a translated and human-readable name for a iTIP method. */
111 static QString translatedMethodName(Method); 111 static QString translatedMethodName(Method);
112 112
113 virtual bool deleteTransaction(IncidenceBase *incidence); 113 virtual bool deleteTransaction(IncidenceBase *incidence);
114 114
115 protected: 115 protected:
116 116
117 bool acceptPublish(IncidenceBase *,ScheduleMessage::Status status, Method method); 117 bool acceptPublish(IncidenceBase *,ScheduleMessage::Status status, Method method);
118 bool acceptRequest(IncidenceBase *,ScheduleMessage::Status status); 118 bool acceptRequest(IncidenceBase *,ScheduleMessage::Status status);
119 bool acceptAdd(IncidenceBase *,ScheduleMessage::Status status); 119 bool acceptAdd(IncidenceBase *,ScheduleMessage::Status status);
120 bool acceptCancel(IncidenceBase *,ScheduleMessage::Status status); 120 bool acceptCancel(IncidenceBase *,ScheduleMessage::Status status);
121 bool acceptDeclineCounter(IncidenceBase *,ScheduleMessage::Status status); 121 bool acceptDeclineCounter(IncidenceBase *,ScheduleMessage::Status status);
122 bool acceptReply(IncidenceBase *,ScheduleMessage::Status status, Method method); 122 bool acceptReply(IncidenceBase *,ScheduleMessage::Status status, Method method);
123 bool acceptRefresh(IncidenceBase *,ScheduleMessage::Status status); 123 bool acceptRefresh(IncidenceBase *,ScheduleMessage::Status status);
124 bool acceptCounter(IncidenceBase *,ScheduleMessage::Status status); 124 bool acceptCounter(IncidenceBase *,ScheduleMessage::Status status);
125 bool acceptFreeBusy(IncidenceBase *,Method method); 125 bool acceptFreeBusy(IncidenceBase *,Method method);
126 126
127 Calendar *mCalendar; 127 Calendar *mCalendar;
128 ICalFormat *mFormat; 128 ICalFormat *mFormat;
129}; 129};
130 130
131} 131}
132 132
133#endif // SCHEDULER_H 133#endif // SCHEDULER_H