KCal::Recurrence Class Reference
This class represents a recurrence rule for a calendar incidence. More...
#include <recurrence.h>
Public Types | |
enum | { rNone = 0, rMinutely = 0x001, rHourly = 0x0002, rDaily = 0x0003, rWeekly = 0x0004, rMonthlyPos = 0x0005, rMonthlyDay = 0x0006, rYearlyMonth = 0x0007, rYearlyDay = 0x0008, rYearlyPos = 0x0009 } |
enum | Feb29Type { rMar1, rFeb28, rFeb29 } |
Public Methods | |
Recurrence (Incidence *parent, int compatVersion=0) | |
Recurrence (const Recurrence &, Incidence *parent) | |
~Recurrence () | |
bool | operator== (const Recurrence &) const |
bool | operator!= (const Recurrence &r) const |
Incidence * | parent () |
QDateTime | recurStart () const |
void | setRecurStart (const QDateTime &start) |
void | setRecurStart (const QDate &start) |
void | setFloats (bool f) |
bool | doesFloat () const |
void | setRecurReadOnly (bool readOnly) |
bool | recurReadOnly () const |
void | setCompatVersion (int version=0) |
ushort | doesRecur () const |
bool | recursOnPure (const QDate &qd) const |
bool | recursAtPure (const QDateTime &) const |
void | unsetRecurs () |
QValueList< QTime > | recurTimesOn (const QDate &date) const |
QDate | getNextDate (const QDate &preDate, bool *last=0) const |
QDateTime | getNextDateTime (const QDateTime &preDateTime, bool *last=0) const |
QDate | getPreviousDate (const QDate &afterDate, bool *last=0) const |
QDateTime | getPreviousDateTime (const QDateTime &afterDateTime, bool *last=0) const |
int | frequency () const |
int | duration () const |
void | setDuration (int duration) |
int | durationTo (const QDate &) const |
int | durationTo (const QDateTime &) const |
QDate | endDate (bool *result=0) const |
QDateTime | endDateTime (bool *result=0) const |
QString | endDateStr (bool shortfmt=true) const |
void | setMinutely (int _rFreq, int duration) |
void | setMinutely (int _rFreq, const QDateTime &endDateTime) |
void | setHourly (int _rFreq, int duration) |
void | setHourly (int _rFreq, const QDateTime &endDateTime) |
void | setDaily (int _rFreq, int duration) |
void | setDaily (int _rFreq, const QDate &endDate) |
void | setWeekly (int _rFreq, const QBitArray &_rDays, int duration, int weekStart=1) |
void | setWeekly (int _rFreq, const QBitArray &_rDays, const QDate &endDate, int weekStart=1) |
int | weekStart () const |
const QBitArray & | days () const |
void | setMonthly (short type, int _rFreq, int duration) |
void | setMonthly (short type, int _rFreq, const QDate &endDate) |
void | addMonthlyPos (short _rPos, const QBitArray &_rDays) |
void | addMonthlyDay (short _rDay) |
const QPtrList< rMonthPos > & | monthPositions () const |
const QPtrList< int > & | monthDays () const |
void | setYearly (int type, int freq, int duration) |
void | setYearly (int type, int freq, const QDate &endDate) |
void | setYearlyByDate (Feb29Type type, int freq, int duration) |
void | setYearlyByDate (Feb29Type type, int freq, const QDate &endDate) |
void | setYearlyByDate (int day, Feb29Type type, int freq, int duration) |
void | setYearlyByDate (int day, Feb29Type type, int freq, const QDate &endDate) |
void | addYearlyNum (short _rNum) |
void | addYearlyMonthPos (short _rPos, const QBitArray &_rDays) |
const QPtrList< int > & | yearNums () const |
const QPtrList< rMonthPos > & | yearMonthPositions () const |
Feb29Type | feb29YearlyType () const |
void | dump () const |
int | countMonthlyPosDays () const |
void | getMonthlyPosDays (QValueList< int > &, int daysInMonth, int startDayOfWeek) const |
bool | getMonthlyDayDays (QValueList< int > &, int daysInMonth) const |
bool | getYearlyMonthMonths (int day, QValueList< int > &, QValueList< int > &leaplist) const |
Static Public Methods | |
void | setFeb29YearlyTypeDefault (Feb29Type t) |
Feb29Type | setFeb29YearlyTypeDefault () |
Protected Types | |
enum | PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE } |
Protected Methods | |
bool | recursSecondly (const QDate &, int secondFreq) const |
bool | recursMinutelyAt (const QDateTime &dt, int minuteFreq) const |
bool | recursDaily (const QDate &) const |
bool | recursWeekly (const QDate &) const |
bool | recursMonthly (const QDate &) const |
bool | recursYearlyByMonth (const QDate &) const |
bool | recursYearlyByPos (const QDate &) const |
bool | recursYearlyByDay (const QDate &) const |
QDate | getNextDateNoTime (const QDate &preDate, bool *last) const |
QDate | getPreviousDateNoTime (const QDate &afterDate, bool *last) const |
void | addMonthlyPos_ (short _rPos, const QBitArray &_rDays) |
void | setDailySub (short type, int freq, int duration) |
void | setYearly_ (short type, Feb29Type, int freq, int duration) |
int | recurCalc (PeriodFunc, QDate &enddate) const |
int | recurCalc (PeriodFunc, QDateTime &endtime) const |
int | secondlyCalc (PeriodFunc, QDateTime &endtime, int freq) const |
int | dailyCalc (PeriodFunc, QDate &enddate) const |
int | weeklyCalc (PeriodFunc, QDate &enddate) const |
int | weeklyCalcEndDate (QDate &enddate, int daysPerWeek) const |
int | weeklyCalcToDate (const QDate &enddate, int daysPerWeek) const |
int | weeklyCalcNextAfter (QDate &enddate, int daysPerWeek) const |
int | monthlyCalc (PeriodFunc, QDate &enddate) const |
int | monthlyCalcEndDate (QDate &enddate, MonthlyData &) const |
int | monthlyCalcToDate (const QDate &enddate, MonthlyData &) const |
int | monthlyCalcNextAfter (QDate &enddate, MonthlyData &) const |
int | yearlyMonthCalc (PeriodFunc, QDate &enddate) const |
int | yearlyMonthCalcEndDate (QDate &enddate, YearlyMonthData &) const |
int | yearlyMonthCalcToDate (const QDate &enddate, YearlyMonthData &) const |
int | yearlyMonthCalcNextAfter (QDate &enddate, YearlyMonthData &) const |
int | yearlyPosCalc (PeriodFunc, QDate &enddate) const |
int | yearlyPosCalcEndDate (QDate &enddate, YearlyPosData &) const |
int | yearlyPosCalcToDate (const QDate &enddate, YearlyPosData &) const |
int | yearlyPosCalcNextAfter (QDate &enddate, YearlyPosData &) const |
int | yearlyDayCalc (PeriodFunc, QDate &enddate) const |
int | yearlyDayCalcEndDate (QDate &enddate, YearlyDayData &) const |
int | yearlyDayCalcToDate (const QDate &enddate, YearlyDayData &) const |
int | yearlyDayCalcNextAfter (QDate &enddate, YearlyDayData &) const |
Detailed Description
This class represents a recurrence rule for a calendar incidence.
Definition at line 37 of file recurrence.h.
Member Enumeration Documentation
|
enumeration for describing how an event recurs, if at all.
Definition at line 41 of file recurrence.h. |
|
Enumeration for specifying what date yearly recurrences of February 29th occur in non-leap years.
Definition at line 47 of file recurrence.h. Referenced by feb29YearlyType(), and setFeb29YearlyTypeDefault(). |
Member Function Documentation
|
Return the start of the recurrence.
Definition at line 70 of file recurrence.h. |
|
Set start of recurrence, as a date and time.
Definition at line 307 of file recurrence.cpp. References QDateTime::setTime(), and QDateTime::time(). Referenced by KCal::ResourceKABC::load(), KCal::Incidence::recurrence(), and KCal::Incidence::setDtStart(). |
|
Set start of recurrence, as a date with no time. Recurrence types which are sub-daily (e.g. rHourly) always have a time; the time is set to 00:00:00 in these cases. Definition at line 330 of file recurrence.cpp. References QDateTime::setDate(), and QDateTime::setTime(). |
|
Set whether the recurrence has no time, just a date. Recurrence types which are sub-daily (e.g. rHourly) always have a time and cannot be set to float. N.B. This property is derived by default from the parent incidence, or according to whether a time is specified in setRecurStart(). Definition at line 353 of file recurrence.cpp. References QDateTime::setTime(). |
|
Returns whether the recurrence has no time, just a date.
Definition at line 86 of file recurrence.h. |
|
Set if recurrence is read-only or can be changed.
Definition at line 89 of file recurrence.h. Referenced by KCal::Incidence::recurrence(), and KCal::Incidence::setReadOnly(). |
|
Returns true if the recurrence is read-only, or false if it can be changed.
Definition at line 91 of file recurrence.h. |
|
Set the calendar file version for backwards compatibility.
Definition at line 143 of file recurrence.cpp. |
|
Returns the event's recurrence status. See the enumeration at the top of this file for possible values. Definition at line 149 of file recurrence.cpp. Referenced by KCal::Incidence::doesRecur(), and KCal::VCalFormat::eventToVEvent(). |
|
Returns true if the date specified is one on which the event will recur.
Definition at line 154 of file recurrence.cpp. Referenced by KCal::Incidence::recursOn(), and recurTimesOn(). |
|
Returns true if the date/time specified is one at which the event will recur. Times are rounded down to the nearest minute to determine the result. Definition at line 182 of file recurrence.cpp. References QDateTime::date(), and QDateTime::time(). Referenced by KCal::Incidence::recursAt(). |
|
Turns off recurrence for the event.
Definition at line 297 of file recurrence.cpp. References QPtrList< int >::clear(), and QPtrList< rMonthPos >::clear(). |
|
Returns a list of the times on the specified date at which the recurrence will occur.
Definition at line 736 of file recurrence.cpp. References QTime::addSecs(), QDateTime::addSecs(), QValueList::append(), QDateTime::date(), endDate(), recursOnPure(), QDateTime::secsTo(), and QDateTime::time(). |
|
Returns the date of the next recurrence, after the specified date.
Definition at line 826 of file recurrence.cpp. References QDateTime::date(), and getNextDateTime(). |
|
Returns the date and time of the next recurrence, after the specified date/time. If the recurrence has no time, the next date after the specified date is returned.
Definition at line 777 of file recurrence.cpp. References QDate::addDays(), QDateTime::addSecs(), QDateTime::date(), QDateTime::secsTo(), and QDateTime::time(). Referenced by KCal::CalendarLocal::appendRecurringAlarms(), and getNextDate(). |
|
Returns the date of the last previous recurrence, before the specified date.
Definition at line 896 of file recurrence.cpp. References QDateTime::date(), and getPreviousDateTime(). |
|
Returns the date and time of the last previous recurrence, before the specified date/time. If a time later than 00:00:00 is specified and the recurrence has no time, 00:00:00 on the specified date is returned if that date recurs.
Definition at line 847 of file recurrence.cpp. References QDate::addDays(), QDateTime::addSecs(), QDateTime::date(), QDateTime::secsTo(), and QDateTime::time(). Referenced by getPreviousDate(). |
|
Returns frequency of recurrence, in terms of the recurrence time period type.
Definition at line 381 of file recurrence.cpp. Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Returns the total number of recurrences, including the initial occurrence.
Definition at line 386 of file recurrence.cpp. Referenced by KCal::VCalFormat::eventToVEvent(), and KCal::CalendarLocal::rawEvents(). |
|
Sets the total number of times the event is to occur, including both the first and last.
Definition at line 391 of file recurrence.cpp. |
|
Returns the number of recurrences up to and including the date specified.
Definition at line 285 of file recurrence.cpp. |
|
Returns the number of recurrences up to and including the date/time specified.
Definition at line 291 of file recurrence.cpp. |
|
Returns the date of the last recurrence. An invalid date is returned if the recurrence has no end.
Definition at line 215 of file recurrence.cpp. References QDateTime::date(), and endDateTime(). Referenced by KCal::VCalFormat::eventToVEvent(), KCal::CalendarLocal::rawEvents(), and recurTimesOn(). |
|
Returns the date and time of the last recurrence. An invalid date is returned if the recurrence has no end.
Definition at line 220 of file recurrence.cpp. References QDateTime::addDays(), QDateTime::addSecs(), QDateTime::isValid(), and QDateTime::time(). Referenced by endDate(). |
|
Returns a string representing the recurrence end date in the format according to the user's locale settings.
Definition at line 403 of file recurrence.cpp. References QDateTime::date(). |
|
Sets an event to recur minutely.
Definition at line 428 of file recurrence.cpp. |
|
Sets an event to recur minutely.
Definition at line 435 of file recurrence.cpp. |
|
Sets an event to recur hourly.
Definition at line 442 of file recurrence.cpp. |
|
Sets an event to recur hourly.
Definition at line 449 of file recurrence.cpp. |
|
Sets an event to recur daily.
Definition at line 456 of file recurrence.cpp. Referenced by KCal::VCalFormat::VEventToEvent(). |
|
Sets an event to recur daily.
Definition at line 463 of file recurrence.cpp. References QDateTime::setDate(), QDateTime::setTime(), and QDateTime::time(). |
|
Sets an event to recur weekly.
Definition at line 471 of file recurrence.cpp. References QPtrList< int >::clear(), QPtrList< rMonthPos >::clear(), QDateTime::date(), and KCal::IncidenceBase::updated(). Referenced by KCal::VCalFormat::VEventToEvent(). |
|
Sets an event to recur weekly.
Definition at line 501 of file recurrence.cpp. References QPtrList< int >::clear(), QPtrList< rMonthPos >::clear(), QDateTime::setDate(), QDateTime::setTime(), QDateTime::time(), and KCal::IncidenceBase::updated(). |
|
Returns the first day of the week. Monday=1 .. Sunday=7. Definition at line 225 of file recurrence.h. |
|
Returns week day mask (bit 0 = Monday).
Definition at line 408 of file recurrence.cpp. Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Sets an event to recur monthly.
Definition at line 521 of file recurrence.cpp. References QPtrList< int >::clear(), and KCal::IncidenceBase::updated(). Referenced by KCal::VCalFormat::VEventToEvent(). |
|
same as above, but with ending date not number of recurrences.
Definition at line 536 of file recurrence.cpp. References QPtrList< int >::clear(), QDateTime::setDate(), QDateTime::setTime(), QDateTime::time(), and KCal::IncidenceBase::updated(). |
|
Adds a position to the recursMonthlyPos recurrence rule, if it is set.
Definition at line 552 of file recurrence.cpp. Referenced by KCal::VCalFormat::VEventToEvent(). |
|
Adds a position the the recursMonthlyDay list.
Definition at line 602 of file recurrence.cpp. References QPtrList< int >::append(), QDateTime::date(), QPtrList< int >::first(), QPtrList< int >::next(), and KCal::IncidenceBase::updated(). Referenced by setYearlyByDate(), and KCal::VCalFormat::VEventToEvent(). |
|
Returns list of day positions in months.
Definition at line 413 of file recurrence.cpp. Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Returns list of day numbers of a month.
Definition at line 423 of file recurrence.cpp. Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Sets an event to recur yearly.
Definition at line 631 of file recurrence.cpp. Referenced by KCal::ResourceKABC::load(), and KCal::VCalFormat::VEventToEvent(). |
|
Sets an event to recur yearly ending at endDate.
Definition at line 640 of file recurrence.cpp. References QDateTime::setDate(), QDateTime::setTime(), and QDateTime::time(). |
|
Sets an event to recur yearly on a set of months, on the same day of the month as the event start date. The months must be specified by calling addYearlyNum().
Definition at line 649 of file recurrence.cpp. Referenced by setYearlyByDate(). |
|
Sets an event to recur yearly ending at endDate.
Definition at line 654 of file recurrence.cpp. References setYearlyByDate(). |
|
Sets an event to recur yearly of a set of months, on the specified day of the month. The months must be specified by calling addYearlyNum().
Definition at line 659 of file recurrence.cpp. References addMonthlyDay(). |
|
Sets an event to recur yearly ending at endDate.
Definition at line 670 of file recurrence.cpp. References addMonthlyDay(), QDateTime::setDate(), QDateTime::setTime(), and QDateTime::time(). |
|
Adds position of day or month in year. N.B. for recursYearlyPos, addYearlyMonthPos() must also be called to add positions within the month. Definition at line 692 of file recurrence.cpp. References QDateTime::date(), QPtrList< int >::first(), QPtrList< int >::insert(), QPtrList< int >::next(), and KCal::IncidenceBase::updated(). Referenced by KCal::ResourceKABC::load(), and KCal::VCalFormat::VEventToEvent(). |
|
Adds a position to the recursYearlyPos recurrence rule, if it is set. N.B. addYearlyNum() must also be called to add recurrence months. Parameters are the same as for addMonthlyPos(). Definition at line 681 of file recurrence.cpp. |
|
Returns positions of days or months in year.
Definition at line 687 of file recurrence.cpp. Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Returns list of day positions in months, for a recursYearlyPos recurrence rule.
Definition at line 418 of file recurrence.cpp. |
|
Returns how yearly recurrences of February 29th are handled.
Definition at line 297 of file recurrence.h. References Feb29Type. |
|
Sets the default method for handling yearly recurrences of February 29th.
Definition at line 299 of file recurrence.h. References Feb29Type. |
|
Returns the default method for handling yearly recurrences of February 29th.
Definition at line 301 of file recurrence.h. References Feb29Type. |
|
Debug output.
Definition at line 3407 of file recurrence.cpp. References QBitArray::testBit(). |
The documentation for this class was generated from the following files: