174 virtual ~Observer() {}
181 rSecondly, rMinutely, rHourly,
182 rDaily, rWeekly, rMonthly, rYearly
187 WDayPos(
int ps = 0 ,
short dy = 0 ) : mDay(dy), mPos(ps) {}
188 short day()
const {
return mDay; }
189 int pos()
const {
return mPos; }
190 void setDay(
short dy ) { mDay = dy; }
191 void setPos(
int ps ) { mPos = ps; }
194 return ( mDay == pos2.mDay ) && ( mPos == pos2.mPos );
207 bool operator!=(
const RecurrenceRule& r )
const {
return !operator==(r); }
222 void setRecurrenceType( PeriodType period );
223 PeriodType recurrenceType()
const {
return mPeriod; }
231 void setFrequency(
int freq );
235 TQDateTime
startDt()
const {
return mDateStart; }
237 void setStartDt(
const TQDateTime &start);
243 void setFloats(
bool floats );
251 TQDateTime endDt(
bool* result = 0 )
const;
254 void setEndDt(
const TQDateTime &endDateTime);
264 void setDuration(
int duration);
268 int durationTo(
const TQDateTime &)
const;
276 bool recursOn(
const TQDate &qd )
const;
280 bool recursAt(
const TQDateTime & )
const;
285 bool dateMatchesRules(
const TQDateTime &qdt )
const;
292 TimeList recurTimesOn(
const TQDate &date )
const;
305 DateTimeList timesInInterval(
const TQDateTime &start,
const TQDateTime &end )
const;
312 TQDateTime getNextDate(
const TQDateTime& preDateTime )
const;
319 TQDateTime getPreviousDate(
const TQDateTime& afterDateTime )
const;
324 void setBySeconds(
const TQValueList<int> bySeconds );
325 void setByMinutes(
const TQValueList<int> byMinutes );
326 void setByHours(
const TQValueList<int> byHours );
328 void setByDays(
const TQValueList<WDayPos> byDays );
329 void setByMonthDays(
const TQValueList<int> byMonthDays );
330 void setByYearDays(
const TQValueList<int> byYearDays );
331 void setByWeekNumbers(
const TQValueList<int> byWeekNumbers );
332 void setByMonths(
const TQValueList<int> byMonths );
333 void setBySetPos(
const TQValueList<int> bySetPos );
334 void setWeekStart(
short weekStart );
336 const TQValueList<int> &bySeconds()
const {
return mBySeconds; }
337 const TQValueList<int> &byMinutes()
const {
return mByMinutes; }
338 const TQValueList<int> &byHours()
const {
return mByHours; }
340 const TQValueList<WDayPos> &byDays()
const {
return mByDays; }
341 const TQValueList<int> &byMonthDays()
const {
return mByMonthDays; }
342 const TQValueList<int> &byYearDays()
const {
return mByYearDays; }
343 const TQValueList<int> &byWeekNumbers()
const {
return mByWeekNumbers; }
344 const TQValueList<int> &byMonths()
const {
return mByMonths; }
345 const TQValueList<int> &bySetPos()
const {
return mBySetPos; }
346 short weekStart()
const {
return mWeekStart; }
357 void addObserver( Observer *observer );
364 void removeObserver( Observer *observer );
375 typedef TQValueList<Constraint> List;
377 Constraint(
int wkst = 1 );
383 Constraint(
const TQDateTime &preDate, PeriodType type,
int wkst );
398 bool readDateTime(
const TQDateTime &preDate, PeriodType type );
399 bool matches(
const TQDate &dt, RecurrenceRule::PeriodType type )
const;
400 bool matches(
const TQDateTime &dt, RecurrenceRule::PeriodType type )
const;
401 bool isConsistent()
const;
402 bool isConsistent( PeriodType period )
const;
403 bool increase( PeriodType type,
int freq );
404 TQDateTime intervalDateTime( PeriodType type )
const;
405 DateTimeList dateTimes( PeriodType type )
const;
409 Constraint getNextValidDateInterval(
const TQDateTime &preDate, PeriodType type )
const;
410 Constraint getPreviousValidDateInterval(
const TQDateTime &preDate, PeriodType type )
const;
411 DateTimeList datesForInterval(
const Constraint &interval, PeriodType type )
const;
412 bool mergeIntervalConstraint( Constraint *merged,
const Constraint &conit,
413 const Constraint &interval )
const;
414 bool buildCache()
const;
418 TQDateTime mDateStart;
430 TQValueList<int> mBySeconds;
431 TQValueList<int> mByMinutes;
432 TQValueList<int> mByHours;
434 TQValueList<WDayPos> mByDays;
435 TQValueList<int> mByMonthDays;
436 TQValueList<int> mByYearDays;
437 TQValueList<int> mByWeekNumbers;
438 TQValueList<int> mByMonths;
439 TQValueList<int> mBySetPos;
442 Constraint::List mConstraints;
443 void buildConstraints();
445 TQValueList<Observer*> mObservers;
448 mutable DateTimeList mCachedDates;
449 mutable TQDateTime mCachedDateEnd;
450 mutable TQDateTime mCachedLastDate;
451 mutable bool mCached;
454 uint mTimedRepetition;