summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.h
Unidiff
Diffstat (limited to 'libkcal/incidence.h') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/incidence.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index f89942f..2940129 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -16,25 +16,27 @@
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 INCIDENCE_H 20#ifndef INCIDENCE_H
21#define INCIDENCE_H 21#define INCIDENCE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <q3valuelist.h>
29//Added by qt3to4:
30#include <Q3PtrList>
29 31
30#include "recurrence.h" 32#include "recurrence.h"
31#include "alarm.h" 33#include "alarm.h"
32#include "attachment.h" 34#include "attachment.h"
33#include "listbase.h" 35#include "listbase.h"
34#include "incidencebase.h" 36#include "incidencebase.h"
35 37
36namespace KCal { 38namespace KCal {
37 39
38class Event; 40class Event;
39class Todo; 41class Todo;
40class Journal; 42class Journal;
@@ -104,25 +106,25 @@ class Incidence : public IncidenceBase
104 106
105 /** 107 /**
106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to 108 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to
107 provide this implementation: 109 provide this implementation:
108 <pre> 110 <pre>
109 bool accept(Visitor &v) { return v.visit(this); } 111 bool accept(Visitor &v) { return v.visit(this); }
110 </pre> 112 </pre>
111 */ 113 */
112 virtual bool accept(Visitor &) { return false; } 114 virtual bool accept(Visitor &) { return false; }
113 115
114 virtual Incidence *clone() = 0; 116 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * ); 117 virtual void cloneRelations( Incidence * );
116 void addRelationsToList(QPtrList<Incidence> *rel); 118 void addRelationsToList(Q3PtrList<Incidence> *rel);
117 void clearRelations(); 119 void clearRelations();
118 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; 120 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
119 void setReadOnly( bool ); 121 void setReadOnly( bool );
120 122
121 /** 123 /**
122 Recreate event. The event is made a new unique event, but already stored 124 Recreate event. The event is made a new unique event, but already stored
123 event information is preserved. Sets uniquie id, creation date, last 125 event information is preserved. Sets uniquie id, creation date, last
124 modification date and revision number. 126 modification date and revision number.
125 */ 127 */
126 void recreate(); 128 void recreate();
127 Incidence* recreateCloneException(QDate); 129 Incidence* recreateCloneException(QDate);
128 130
@@ -168,52 +170,52 @@ class Incidence : public IncidenceBase
168 * exists. */ 170 * exists. */
169 void setRelatedToUid(const QString &); 171 void setRelatedToUid(const QString &);
170 /** what event does this one relate to? This function should 172 /** what event does this one relate to? This function should
171 * only be used when constructing a calendar before the related Event 173 * only be used when constructing a calendar before the related Event
172 * exists. */ 174 * exists. */
173 QString relatedToUid() const; 175 QString relatedToUid() const;
174 /** point at some other event to which the event relates */ 176 /** point at some other event to which the event relates */
175 void setRelatedTo(Incidence *relatedTo); 177 void setRelatedTo(Incidence *relatedTo);
176 void resetRelatedTo(); 178 void resetRelatedTo();
177 /** what event does this one relate to? */ 179 /** what event does this one relate to? */
178 Incidence *relatedTo() const; 180 Incidence *relatedTo() const;
179 /** All events that are related to this event */ 181 /** All events that are related to this event */
180 QPtrList<Incidence> relations() const; 182 Q3PtrList<Incidence> relations() const;
181 /** Add an event which is related to this event */ 183 /** Add an event which is related to this event */
182 void addRelation(Incidence *); 184 void addRelation(Incidence *);
183 /** Remove event that is related to this event */ 185 /** Remove event that is related to this event */
184 void removeRelation(Incidence *); 186 void removeRelation(Incidence *);
185 187
186 /** returns the list of dates which are exceptions to the recurrence rule */ 188 /** returns the list of dates which are exceptions to the recurrence rule */
187 DateList exDates() const; 189 DateList exDates() const;
188 /** sets the list of dates which are exceptions to the recurrence rule */ 190 /** sets the list of dates which are exceptions to the recurrence rule */
189 void setExDates(const DateList &_exDates); 191 void setExDates(const DateList &_exDates);
190 void setExDates(const char *dates); 192 void setExDates(const char *dates);
191 /** Add a date to the list of exceptions of the recurrence rule. */ 193 /** Add a date to the list of exceptions of the recurrence rule. */
192 void addExDate(const QDate &date); 194 void addExDate(const QDate &date);
193 195
194 /** returns true if there is an exception for this date in the recurrence 196 /** returns true if there is an exception for this date in the recurrence
195 rule set, or false otherwise. */ 197 rule set, or false otherwise. */
196 bool isException(const QDate &qd) const; 198 bool isException(const QDate &qd) const;
197 199
198 /** add attachment to this event */ 200 /** add attachment to this event */
199 void addAttachment(Attachment *attachment); 201 void addAttachment(Attachment *attachment);
200 /** remove and delete a specific attachment */ 202 /** remove and delete a specific attachment */
201 void deleteAttachment(Attachment *attachment); 203 void deleteAttachment(Attachment *attachment);
202 /** remove and delete all attachments with this mime type */ 204 /** remove and delete all attachments with this mime type */
203 void deleteAttachments(const QString& mime); 205 void deleteAttachments(const QString& mime);
204 /** return list of all associated attachments */ 206 /** return list of all associated attachments */
205 QPtrList<Attachment> attachments() const; 207 Q3PtrList<Attachment> attachments() const;
206 /** find a list of attachments with this mime type */ 208 /** find a list of attachments with this mime type */
207 QPtrList<Attachment> attachments(const QString& mime) const; 209 Q3PtrList<Attachment> attachments(const QString& mime) const;
208 210
209 /** sets the event's status the value specified. See the enumeration 211 /** sets the event's status the value specified. See the enumeration
210 * above for possible values. */ 212 * above for possible values. */
211 void setSecrecy(int); 213 void setSecrecy(int);
212 /** return the event's secrecy. */ 214 /** return the event's secrecy. */
213 int secrecy() const; 215 int secrecy() const;
214 /** return the event's secrecy in string format. */ 216 /** return the event's secrecy in string format. */
215 QString secrecyStr() const; 217 QString secrecyStr() const;
216 /** return list of all availbale secrecy classes */ 218 /** return list of all availbale secrecy classes */
217 static QStringList secrecyList(); 219 static QStringList secrecyList();
218 /** return human-readable name of secrecy class */ 220 /** return human-readable name of secrecy class */
219 static QString secrecyName(int); 221 static QString secrecyName(int);
@@ -226,25 +228,25 @@ class Incidence : public IncidenceBase
226 228
227 /** set resources used, such as Office, Car, etc. */ 229 /** set resources used, such as Office, Car, etc. */
228 void setResources(const QStringList &resources); 230 void setResources(const QStringList &resources);
229 /** return list of current resources */ 231 /** return list of current resources */
230 QStringList resources() const; 232 QStringList resources() const;
231 233
232 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ 234 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
233 void setPriority(int priority); 235 void setPriority(int priority);
234 /** get the event's priority */ 236 /** get the event's priority */
235 int priority() const; 237 int priority() const;
236 238
237 /** All alarms that are associated with this incidence */ 239 /** All alarms that are associated with this incidence */
238 QPtrList<Alarm> alarms() const; 240 Q3PtrList<Alarm> alarms() const;
239 /** Create a new alarm which is associated with this incidence */ 241 /** Create a new alarm which is associated with this incidence */
240 Alarm* newAlarm(); 242 Alarm* newAlarm();
241 /** Add an alarm which is associated with this incidence */ 243 /** Add an alarm which is associated with this incidence */
242 void addAlarm(Alarm*); 244 void addAlarm(Alarm*);
243 /** Remove an alarm that is associated with this incidence */ 245 /** Remove an alarm that is associated with this incidence */
244 void removeAlarm(Alarm*); 246 void removeAlarm(Alarm*);
245 /** Remove all alarms that are associated with this incidence */ 247 /** Remove all alarms that are associated with this incidence */
246 void clearAlarms(); 248 void clearAlarms();
247 /** return whether any alarm associated with this incidence is enabled */ 249 /** return whether any alarm associated with this incidence is enabled */
248 bool isAlarmEnabled() const; 250 bool isAlarmEnabled() const;
249 251
250 /** 252 /**
@@ -279,45 +281,45 @@ class Incidence : public IncidenceBase
279 bool isHoliday() const; 281 bool isHoliday() const;
280 bool isBirthday() const; 282 bool isBirthday() const;
281 bool isAnniversary() const; 283 bool isAnniversary() const;
282 QDateTime lastModifiedSub(); 284 QDateTime lastModifiedSub();
283 QString lastModifiedSubSortKey() const; 285 QString lastModifiedSubSortKey() const;
284 QString recurrenceText() const; 286 QString recurrenceText() const;
285 void setLastModifiedSubInvalid(); 287 void setLastModifiedSubInvalid();
286 288
287 virtual QString durationText(); 289 virtual QString durationText();
288 QString durationText4Time( int secs ); 290 QString durationText4Time( int secs );
289 Recurrence *mRecurrence; 291 Recurrence *mRecurrence;
290protected: 292protected:
291 QPtrList<Alarm> mAlarms; 293 Q3PtrList<Alarm> mAlarms;
292 QPtrList<Incidence> mRelations; 294 Q3PtrList<Incidence> mRelations;
293 QDateTime mRecurrenceID; 295 QDateTime mRecurrenceID;
294 bool mHasRecurrenceID; 296 bool mHasRecurrenceID;
295 private: 297 private:
296 void checkCategories(); 298 void checkCategories();
297 QString mLastModifiedSubSortKey; 299 QString mLastModifiedSubSortKey;
298 bool mHoliday, mBirthday, mAnniversary; 300 bool mHoliday, mBirthday, mAnniversary;
299 int mRevision; 301 int mRevision;
300 bool mCancelled; 302 bool mCancelled;
301 303
302 // base components of jounal, event and todo 304 // base components of jounal, event and todo
303 QDateTime mCreated; 305 QDateTime mCreated;
304 QDateTime mLastModifiedSub; 306 QDateTime mLastModifiedSub;
305 QString mDescription; 307 QString mDescription;
306 QString mSummary; 308 QString mSummary;
307 QStringList mCategories; 309 QStringList mCategories;
308 Incidence *mRelatedTo; 310 Incidence *mRelatedTo;
309 QString mRelatedToUid; 311 QString mRelatedToUid;
310 DateList mExDates; 312 DateList mExDates;
311 QPtrList<Attachment> mAttachments; 313 Q3PtrList<Attachment> mAttachments;
312 QStringList mResources; 314 QStringList mResources;
313 bool mHasStartDate; // if todo has associated start date 315 bool mHasStartDate; // if todo has associated start date
314 316
315 int mSecrecy; 317 int mSecrecy;
316 int mPriority; // 1 = highest, 2 = less, etc. 318 int mPriority; // 1 = highest, 2 = less, etc.
317 319
318 //QPtrList<Alarm> mAlarms; 320 //QPtrList<Alarm> mAlarms;
319 321
320 QString mLocation; 322 QString mLocation;
321}; 323};
322 324
323bool operator==( const Incidence&, const Incidence& ); 325bool operator==( const Incidence&, const Incidence& );