24 #ifndef KCALCORE_RECURRENCERULE_H
25 #define KCALCORE_RECURRENCERULE_H
27 #include "kcalcore_export.h"
30 #include <KDE/KDateTime>
36 typedef SortableList<QDate>
DateList;
38 typedef SortableList<QTime> TimeList;
49 virtual ~RuleObserver();
53 typedef QList<RecurrenceRule*> List;
71 explicit WDayPos(
int ps = 0,
short dy = 0 );
72 void setDay(
short dy );
74 void setPos(
int ps );
91 bool operator!=(
const RecurrenceRule &r )
const {
return !operator==(r); }
95 void setReadOnly(
bool readOnly );
100 bool isReadOnly()
const;
107 void setRecurrenceType( PeriodType period );
108 PeriodType recurrenceType()
const;
116 uint frequency()
const;
121 void setFrequency(
int freq );
128 KDateTime startDt()
const;
142 void setStartDt(
const KDateTime &start );
152 void setAllDay(
bool allDay );
159 KDateTime endDt(
bool *result = 0 )
const;
163 void setEndDt(
const KDateTime &endDateTime );
169 int duration()
const;
173 void setDuration(
int duration );
176 int durationTo(
const KDateTime &dt )
const;
179 int durationTo(
const QDate &date )
const;
195 void shiftTimes(
const KDateTime::Spec &oldSpec,
const KDateTime::Spec &newSpec );
203 bool recursOn(
const QDate &date,
const KDateTime::Spec &timeSpec )
const;
211 bool recursAt(
const KDateTime &dt )
const;
220 bool dateMatchesRules(
const KDateTime &dt )
const;
228 TimeList recurTimesOn(
const QDate &date,
const KDateTime::Spec &timeSpec )
const;
241 DateTimeList timesInInterval(
const KDateTime &start,
const KDateTime &end )
const;
248 KDateTime getNextDate(
const KDateTime &preDateTime )
const;
256 KDateTime getPreviousDate(
const KDateTime &afterDateTime )
const;
258 void setBySeconds(
const QList<int> &bySeconds );
259 void setByMinutes(
const QList<int> &byMinutes );
260 void setByHours(
const QList<int> &byHours );
262 void setByDays(
const QList<WDayPos> &byDays );
263 void setByMonthDays(
const QList<int> &byMonthDays );
264 void setByYearDays(
const QList<int> &byYearDays );
265 void setByWeekNumbers(
const QList<int> &byWeekNumbers );
266 void setByMonths(
const QList<int> &byMonths );
267 void setBySetPos(
const QList<int> &bySetPos );
268 void setWeekStart(
short weekStart );
270 const QList<int> &bySeconds()
const;
271 const QList<int> &byMinutes()
const;
272 const QList<int> &byHours()
const;
274 const QList<WDayPos> &byDays()
const;
275 const QList<int> &byMonthDays()
const;
276 const QList<int> &byYearDays()
const;
277 const QList<int> &byWeekNumbers()
const;
278 const QList<int> &byMonths()
const;
279 const QList<int> &bySetPos()
const;
280 short weekStart()
const;
289 void setRRule(
const QString &rrule );
290 QString rrule()
const;
300 void addObserver( RuleObserver *observer );
308 void removeObserver( RuleObserver *observer );
structure for describing the n-th weekday of the month/year.
This file is part of the API for handling calendar data and defines the Sortable List class...
SortableList< QDate > DateList
List of dates.
A QList which can be sorted.
PeriodType
enum for describing the frequency how an event recurs, if at all.
SortableList< KDateTime > DateTimeList
List of times.
This class represents a recurrence rule for a calendar incidence.