24 #ifndef KCALCORE_RECURRENCE_H
25 #define KCALCORE_RECURRENCE_H
27 #include "kcalcore_export.h"
28 #include "recurrencerule.h"
87 class KCALCORE_EXPORT
Recurrence :
public RecurrenceRule::RuleObserver
90 class RecurrenceObserver
93 virtual ~RecurrenceObserver();
95 virtual void recurrenceUpdated(
Recurrence *r) = 0;
105 rMonthlyPos = 0x0005,
106 rMonthlyDay = 0x0006,
107 rYearlyMonth = 0x0007,
143 return !operator==(r);
154 KDateTime startDateTime()
const;
156 QDate startDate()
const;
162 void setStartDateTime(
const KDateTime &start);
174 void setAllDay(
bool allDay);
177 void setRecurReadOnly(
bool readOnly);
180 bool recurReadOnly()
const;
187 ushort recurrenceType()
const;
202 bool recursOn(
const QDate &date,
const KDateTime::Spec &timeSpec)
const;
211 bool recursAt(
const KDateTime &dt)
const;
230 TimeList recurTimesOn(
const QDate &date,
const KDateTime::Spec &timeSpec)
const;
244 DateTimeList timesInInterval(
const KDateTime &start,
const KDateTime &end)
const;
252 KDateTime getNextDateTime(
const KDateTime &preDateTime)
const;
262 KDateTime getPreviousDateTime(
const KDateTime &afterDateTime)
const;
265 int frequency()
const;
268 void setFrequency(
int freq);
274 int duration()
const;
278 void setDuration(
int duration);
283 int durationTo(
const KDateTime &dt)
const;
288 int durationTo(
const QDate &date)
const;
293 KDateTime endDateTime()
const;
298 QDate endDate()
const;
303 void setEndDate(
const QDate &endDate);
307 void setEndDateTime(
const KDateTime &endDateTime);
323 void shiftTimes(
const KDateTime::Spec &oldSpec,
const KDateTime::Spec &newSpec);
335 void setMinutely(
int freq);
350 void setHourly(
int freq);
365 void setDaily(
int freq);
378 void setWeekly(
int freq,
int weekStart = 1);
391 void setWeekly(
int freq,
const QBitArray &days,
int weekStart = 1);
396 void addWeeklyDays(
const QBitArray &days);
402 int weekStart()
const;
405 QBitArray days()
const;
421 void setMonthly(
int freq);
430 void addMonthlyPos(
short pos,
const QBitArray &days);
431 void addMonthlyPos(
short pos, ushort day);
437 void addMonthlyDate(
short day);
440 QList<RecurrenceRule::WDayPos> monthPositions()
const;
444 QList<int> monthDays()
const;
468 void setYearly(
int freq);
476 void addYearlyDay(
int day);
486 void addYearlyDate(
int date);
493 void addYearlyMonth(
short _rNum);
511 void addYearlyPos(
short pos,
const QBitArray &days);
518 QList<int> yearDays()
const;
527 QList<int> yearDates()
const;
537 QList<int> yearMonths()
const;
548 QList<RecurrenceRule::WDayPos> yearPositions()
const;
559 RecurrenceRule::List rRules()
const;
581 RecurrenceRule::List exRules()
const;
607 void setRDates(
const DateList &rdates);
608 void addRDateTime(
const KDateTime &rdate);
609 void addRDate(
const QDate &rdate);
615 void setExDates(
const DateList &exdates);
616 void addExDateTime(
const KDateTime &exdate);
617 void addExDate(
const QDate &exdate);
630 void addObserver(RecurrenceObserver *observer);
637 void removeObserver(RecurrenceObserver *observer);
This class represents a recurrence rule for a calendar incidence.
A QList which can be sorted.
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
static const QDate MAX_DATE
Upper date limit for recurrences.
PeriodType
enum for describing the frequency how an event recurs, if at all.
bool operator!=(const Recurrence &r) const
Comparison operator for inequality.
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
This class represents a recurrence rule for a calendar incidence.