libkcal
KCal::Recurrence Class Reference
#include <recurrence.h>
Detailed Description
This class represents a recurrence rule for a calendar incidence.It manages all recurrence rules, recurrence date/times, exception rules and exception date times that can appear inside calendar items. Each recurrence rule and exception rule is represented as an object of type RecurrenceRule.
For the simple case where at most one recurrence rule is present, this class provides shortcut methods to set the type: setMinutely() setHourly() setDaily() setWeekly() setMonthly() setYearly() to set/get general information about the recurrence: setEndDate() setEndDateTime() duration() durationTo() setDuration() frequency() setFrequency() and to set/get specific information about the recurrence within the interval: days() monthDays() monthPositions() yearDays() yearDates() yearMonths() yearPositions() addMonthlyPos() addMonthlyDate() addYearlyDay() addYearlyDate() addYearlyPos() addYearlyMonth() These are all available so that you don't have to work on the RecurrenceRule objects themselves. In other words, in that simple situation the interface stays almost the same compared to the old Recurrence class, which allowed only one recurrence rule.
As soon as your recurrence consists of multiple recurrence rules or exception rules, you cannot use the methods mentioned above any more (since each rule will have a different type and different settings). If you still call any of them, the set*ly methods will remove all rules and add one rule with the specified type. The add* and the other set* methods will change only the first recurrence rule, but leave the others untouched.
Definition at line 89 of file 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, rOther = 0x000A, rMax = 0x00FF } |
Public Member Functions | |
Recurrence (const Recurrence &) | |
bool | operator== (const Recurrence &) const |
bool | operator!= (const Recurrence &r) const |
QDateTime | startDateTime () const |
QDate | startDate () const |
void | setStartDateTime (const QDateTime &start) |
void | setStartDate (const QDate &start) |
bool | doesFloat () const |
void | setFloats (bool floats) |
void | setRecurReadOnly (bool readOnly) |
bool | recurReadOnly () const |
bool | doesRecur () const |
ushort | recurrenceType () const |
bool | recursOn (const QDate &qd) const |
bool | recursAt (const QDateTime &) const |
void | unsetRecurs () |
void | clear () |
QValueList< QTime > | recurTimesOn (const QDate &date) const |
QDateTime | getNextDateTime (const QDateTime &preDateTime) const |
QDateTime | getPreviousDateTime (const QDateTime &afterDateTime) const |
int | frequency () const |
void | setFrequency (int freq) |
int | duration () const |
void | setDuration (int duration) |
int | durationTo (const QDateTime &) const |
int | durationTo (const QDate &date) const |
QDateTime | endDateTime () const |
QDate | endDate () const |
void | setEndDate (const QDate &endDate) |
void | setEndDateTime (const QDateTime &endDateTime) |
void | setMinutely (int freq) |
void | setHourly (int freq) |
void | setDaily (int freq) |
void | setWeekly (int freq, int weekStart=1) |
void | setWeekly (int freq, const QBitArray &days, int weekStart=1) |
void | addWeeklyDays (const QBitArray &days) |
int | weekStart () const |
QBitArray | days () const |
void | setMonthly (int freq) |
void | addMonthlyPos (short pos, const QBitArray &days) |
void | addMonthlyPos (short pos, ushort day) |
void | addMonthlyDate (short day) |
QValueList< RecurrenceRule::WDayPos > | monthPositions () const |
QValueList< int > | monthDays () const |
void | setYearly (int freq) |
void | addYearlyDay (int day) |
void | addYearlyDate (int date) |
void | addYearlyMonth (short _rNum) |
void | addYearlyPos (short pos, const QBitArray &days) |
QValueList< int > | yearDays () const |
QValueList< int > | yearDates () const |
QValueList< int > | yearMonths () const |
QValueList< RecurrenceRule::WDayPos > | yearPositions () const |
void | dump () const |
RecurrenceRule::List | rRules () const |
void | addRRule (RecurrenceRule *rrule) |
void | removeRRule (RecurrenceRule *rrule) |
RecurrenceRule::List | exRules () const |
void | addExRule (RecurrenceRule *exrule) |
void | removeExRule (RecurrenceRule *exrule) |
DateTimeList | rDateTimes () const |
DateList | rDates () const |
void | setRDateTimes (const DateTimeList &rdates) |
void | setRDates (const DateList &rdates) |
void | addRDateTime (const QDateTime &rdate) |
void | addRDate (const QDate &rdate) |
DateTimeList | exDateTimes () const |
DateList | exDates () const |
void | setExDateTimes (const DateTimeList &exdates) |
void | setExDates (const DateList &exdates) |
void | addExDateTime (const QDateTime &exdate) |
void | addExDate (const QDate &exdate) |
RecurrenceRule * | defaultRRule (bool create=false) const |
RecurrenceRule * | defaultRRuleConst () const |
void | updated () |
void | addObserver (Observer *observer) |
void | removeObserver (Observer *observer) |
void | recurrenceChanged (RecurrenceRule *) |
Static Public Member Functions | |
static ushort | recurrenceType (const RecurrenceRule *rrule) |
Static Public Attributes | |
static const QDate | MAX_DATE |
Protected Member Functions | |
RecurrenceRule * | setNewRecurrenceType (RecurrenceRule::PeriodType type, int freq) |
Member Enumeration Documentation
|
enumeration for describing how an event recurs, if at all.
Definition at line 100 of file recurrence.h. |
Member Function Documentation
|
Adds a date (e.g. the 15th of each month) to the monthly day recurrence list.
Definition at line 659 of file recurrence.cpp. |
|
Adds a position (e.g. first monday) to the monthly recurrence rule.
Definition at line 617 of file recurrence.cpp. |
|
Installs an observer. Whenever some setting of this recurrence object is changed, the recurrenceUpdated( Recurrence* ) method of each observer will be called to inform it of changes.
Definition at line 114 of file recurrence.cpp. |
|
Adds days to the weekly day recurrence list.
Definition at line 606 of file recurrence.cpp. |
|
Adds date within a yearly recurrence. The month(s) for the recurrence can be specified with addYearlyMonth(), otherwise the month of the start date is used. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration.
Definition at line 695 of file recurrence.cpp. |
|
Adds day number of year within a yearly recurrence. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration.
Definition at line 681 of file recurrence.cpp. |
|
Adds month in yearly recurrence. You can specify specific day numbers within the months (by calling addYearlyDate()) or specific day positions within the month (by calling addYearlyPos).
Definition at line 708 of file recurrence.cpp. |
|
Adds position within month/year within a yearly recurrence. If months are specified (via addYearlyMonth()), the parameters are understood as position within these months, otherwise within the year. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration.
Definition at line 701 of file recurrence.cpp. |
|
Removes all recurrence and exception rules and dates.
Definition at line 433 of file recurrence.cpp. |
|
Returns week day mask (bit 0 = Monday).
Definition at line 496 of file recurrence.cpp. |
|
Set whether the recurrence has no time, just a date. Floating means -- according to rfc2445 -- that the event has no time associated. N.B. This property is derived by default from whether setStartDateTime() or setStartDate() is called.
Definition at line 132 of file recurrence.h. |
|
Returns whether the event recurs at all.
Definition at line 185 of file recurrence.cpp. |
|
Debug output.
Definition at line 1047 of file recurrence.cpp. |
|
Returns -1 if the event recurs infinitely, 0 if the end date is set, otherwise the total number of recurrences, including the initial occurrence.
Definition at line 397 of file recurrence.cpp. |
|
Returns the number of recurrences up to and including the date specified.
Definition at line 199 of file recurrence.h. |
|
Returns the number of recurrences up to and including the date/time specified.
Definition at line 409 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 373 of file recurrence.cpp. |
|
Returns the date/time of the last recurrence. An invalid date is returned if the recurrence has no end. Definition at line 353 of file recurrence.cpp. |
|
Returns frequency of recurrence, in terms of the recurrence time period type.
Definition at line 467 of file recurrence.cpp. |
|
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 774 of file recurrence.cpp. |
|
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 839 of file recurrence.cpp. |
|
Returns list of day numbers of a month.
Definition at line 517 of file recurrence.cpp. |
|
Returns list of day positions in months.
Definition at line 525 of file recurrence.cpp. |
|
Returns true if the recurrence is read-only, or false if it can be changed.
Definition at line 141 of file recurrence.h. |
|
Returns the recurrence status for a recurrence rule. See the enumeration at the top of this file for possible values. Definition at line 198 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 190 of file recurrence.cpp. |
|
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 330 of file recurrence.cpp. |
|
Returns true if the date specified is one on which the event will recur.
Definition at line 269 of file recurrence.cpp. |
|
Returns a list of the times on the specified date at which the recurrence will occur.
Definition at line 723 of file recurrence.cpp. |
|
Removes an observer that was added with addObserver. If the given object was not an observer, it does nothing.
Definition at line 120 of file recurrence.cpp. |
|
Sets an event to recur daily. By default infinite recurrence is used. The minute and second of the recurrence is taken from the start date (if you need to change them, you will have to modify the defaultRRule's byMinute list manually. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a daily recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 586 of file recurrence.cpp. |
|
Sets the total number of times the event is to occur, including both the first and last.
Definition at line 417 of file recurrence.cpp. |
|
Sets the date of the last recurrence. The end time is set to the recurrence start time.
Definition at line 380 of file recurrence.cpp. |
|
Sets the date and time of the last recurrence.
Definition at line 388 of file recurrence.cpp. |
|
Sets whether the dtstart is a floating time (i.e. has no time attached)
Definition at line 134 of file recurrence.cpp. |
|
Sets the frequency of recurrence, in terms of the recurrence time period type.
Definition at line 476 of file recurrence.cpp. |
|
Sets an event to recur hourly. By default infinite recurrence is used. The minute of the recurrence is taken from the start date (if you need to change it, you will have to modify the defaultRRule's byMinute list manually. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a hourly recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 580 of file recurrence.cpp. |
|
Sets an event to recur minutely. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a minutely recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 574 of file recurrence.cpp. |
|
Sets an event to recur monthly. By default infinite recurrence is used. The date of the monthly recurrence will be taken from the start date unless you explicitly add one or more recurrence dates with addMonthlyDate or a recurrence position in the month (e.g. first monday) using addMonthlyPos. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a monthly recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 611 of file recurrence.cpp. |
|
Set if recurrence is read-only or can be changed.
Definition at line 139 of file recurrence.h. |
|
Set start of recurrence, as a date. Also sets the incidence to floating.
Definition at line 461 of file recurrence.cpp. |
|
Set start of recurrence, as a date and time. Also sets the incidence to non-floating.
Definition at line 446 of file recurrence.cpp. |
|
Sets an event to recur weekly. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a weekly recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 600 of file recurrence.cpp. |
|
Sets an event to recur weekly. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a weekly recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 592 of file recurrence.cpp. |
|
Sets an event to recur yearly. By default, this will recur every year on the same date (e.g. every year on April 15 if the start date was April 15). The day of the year can be specified with addYearlyDay(). The day of the month can be specified with addYearlyByDate If both a month and a day ar specified with addYearlyMonth and addYearlyDay, the day is understood as day number within the month. A position (e.g. 3rd Sunday of year/month, or last Friday of year/month) can be specified with addYearlyPos. Again, if a month is specified, this position is understood as within that month, otherwise within the year. By default infinite recurrence is used. To set an end date use the method setEndDate and to set the number of occurrences use setDuration. This method clears all recurrence rules and adds one rule with a yearly recurrence. All other recurrence components (recurrence date/times, exception date/times and exception rules) are not modified.
Definition at line 673 of file recurrence.cpp. |
|
Return the start date/time of the recurrence.
Definition at line 116 of file recurrence.h. |
|
Return the start date/time of the recurrence (Time for floating incidences will be 0:00).
Definition at line 127 of file recurrence.cpp. |
|
Removes all recurrence rules. Recurrence dates and exceptions are not removed. Definition at line 426 of file recurrence.cpp. |
|
Returns the first day of the week. Uses only the first RRULE if present (i.e. a second RRULE as well as all EXRULES are ignored!
Definition at line 488 of file recurrence.cpp. |
|
Returns the dates within a yearly recurrence.
Definition at line 542 of file recurrence.cpp. |
|
Returns the day numbers within a yearly recurrence.
Definition at line 535 of file recurrence.cpp. |
|
Returns the months within a yearly recurrence.
Definition at line 547 of file recurrence.cpp. |
|
Returns list of day positions in months, for a recursYearlyPos recurrence rule.
Definition at line 554 of file recurrence.cpp. |
Member Data Documentation
|
Upper date limit for recurrences.
Definition at line 432 of file recurrence.h. |
The documentation for this class was generated from the following files: