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 } |
enumeration for describing how an event recurs, if at all. More... | |
Public Member Functions | |
Recurrence (Incidence *parent, int compatVersion=0) | |
Recurrence (const Recurrence &, Incidence *parent) | |
QDateTime | recurStart () const |
Return the start of the recurrence. | |
int | recurExDatesCount () const |
Returns the number of exception dates for the recurrence. | |
void | setRecurStart (const QDateTime &start) |
Set start of recurrence, as a date and time. | |
void | setRecurStart (const QDate &start) |
Set start of recurrence, as a date with no time. | |
void | setFloats (bool f) |
Set whether the recurrence has no time, just a date. | |
void | setRecurReadOnly (bool readOnly) |
Set if recurrence is read-only or can be changed. | |
void | setRecurExDatesCount (int count) |
Set number of exception dates. | |
void | setCompatVersion (int version=0) |
ushort | doesRecur () const |
Returns the event's recurrence status. | |
bool | recursOnPure (const QDate &qd) const |
Returns true if the date specified is one on which the event will recur. | |
bool | recursAtPure (const QDateTime &) const |
Returns true if the date/time specified is one at which the event will recur. | |
void | unsetRecurs () |
Turns off recurrence for the event. | |
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 |
Returns frequency of recurrence, in terms of the recurrence time period type. | |
int | duration () const |
Returns the total number of recurrences, including the initial occurrence. | |
void | setDuration (int duration) |
Sets the total number of times the event is to occur, including both the first and last. | |
int | durationTo (const QDate &) const |
Returns the number of recurrences up to and including the date specified. | |
int | durationTo (const QDateTime &) const |
Returns the number of recurrences up to and including the date/time specified. | |
QDate | endDate () const |
Returns the date of the last recurrence. | |
QDateTime | endDateTime () const |
Returns the date and time of the last recurrence. | |
QString | endDateStr (bool shortfmt=true) const |
Returns a string representing the recurrence end date in the format according to the user's locale settings. | |
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 |
Returns the first day of the week. | |
const QBitArray & | days () const |
Returns week day mask (bit 0 = Monday). | |
void | setMonthly (short type, int _rFreq, int duration) |
void | setMonthly (short type, int _rFreq, const QDate &endDate) |
same as above, but with ending date not number of recurrences | |
void | addMonthlyPos (short _rPos, const QBitArray &_rDays) |
void | addMonthlyDay (short _rDay) |
const QPtrList< rMonthPos > & | monthPositions () const |
Returns list of day positions in months. | |
const QPtrList< int > & | monthDays () const |
Returns list of day numbers of a month. | |
void | setYearly (int type, int freq, int duration) |
void | setYearly (int type, int freq, const QDate &endDate) |
Sets an event to recur yearly ending at endDate. | |
void | addYearlyNum (short _rNum) |
Adds position of day or month in year. | |
void | addYearlyMonthPos (short _rPos, const QBitArray &_rDays) |
Adds a position to the recursYearlyPos recurrence rule, if it is set. | |
const QPtrList< int > & | yearNums () const |
Returns positions of days or months in year. | |
const QPtrList< rMonthPos > & | yearMonthPositions () const |
Returns list of day positions in months, for a recursYearlyPos recurrence rule. | |
Protected Types | |
enum | PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE } |
Protected Member Functions | |
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, 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 |
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 |
int | getFirstDayInWeek (int startDay, bool useWeekStart=true) const |
int | getLastDayInWeek (int endDay, bool useWeekStart=true) const |
QDate | getFirstDateInMonth (const QDate &earliestDate) const |
QDate | getLastDateInMonth (const QDate &latestDate) const |
QDate | getFirstDateInYear (const QDate &earliestDate) const |
QDate | getLastDateInYear (const QDate &latestDate) const |
Friends | |
struct | MonthlyData |
struct | YearlyMonthData |
struct | YearlyPosData |
struct | YearlyDayData |
Detailed Description
This class represents a recurrence rule for a calendar incidence.
Definition at line 36 of file recurrence.h.
Member Enumeration Documentation
|
enumeration for describing how an event recurs, if at all.
Definition at line 40 of file recurrence.h. |
Member Function Documentation
|
Return the start of the recurrence.
Definition at line 56 of file recurrence.h. |
|
Returns the number of exception dates for the recurrence.
Definition at line 58 of file recurrence.h. |
|
Set start of recurrence, as a date and time.
Referenced by 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. |
|
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(). |
|
Set if recurrence is read-only or can be changed.
Definition at line 72 of file recurrence.h. Referenced by KCal::Incidence::setReadOnly(). |
|
Set number of exception dates.
Definition at line 74 of file recurrence.h. Referenced by KCal::Incidence::addExDate(), and KCal::Incidence::setExDates(). |
|
Returns the event's recurrence status. See the enumeration at the top of this file for possible values. Referenced by KCal::VCalFormat::eventToVEvent(), KCal::CalFilter::filterEvent(), and KCal::CalendarLocal::insertEvent(). |
|
Returns true if the date specified is one on which the event will recur.
Referenced by KCal::Incidence::recursOn(). |
|
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. |
|
Turns off recurrence for the event.
|
|
Returns frequency of recurrence, in terms of the recurrence time period type.
Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Returns the total number of recurrences, including the initial occurrence.
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.
|
|
Returns the number of recurrences up to and including the date specified.
|
|
Returns the number of recurrences up to and including the date/time specified.
|
|
Returns the date of the last recurrence. An invalid date is returned if the recurrence has no end. Note: for some recurrence types, endDate() can involve significant calculation. Referenced by KCal::VCalFormat::eventToVEvent(), and KCal::CalendarLocal::rawEvents(). |
|
Returns the date and time of the last recurrence. An invalid date is returned if the recurrence has no end. Note: for some recurrence types, endDateTime() can involve significant calculation. |
|
Returns a string representing the recurrence end date in the format according to the user's locale settings.
|
|
Returns the first day of the week. Monday=1 .. Sunday=7. Definition at line 199 of file recurrence.h. |
|
Returns week day mask (bit 0 = Monday).
Referenced by KCal::VCalFormat::eventToVEvent(). |
|
same as above, but with ending date not number of recurrences
|
|
Returns list of day positions in months.
Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Returns list of day numbers of a month.
Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Sets an event to recur yearly ending at endDate.
|
|
Adds position of day or month in year. N.B. for recursYearlyPos, addYearlyMonthPos() must also be called to add positions within the month. Referenced by 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(). |
|
Returns positions of days or months in year.
Referenced by KCal::VCalFormat::eventToVEvent(). |
|
Returns list of day positions in months, for a recursYearlyPos recurrence rule.
|
The documentation for this class was generated from the following file: