# Recurrence

Since: BlackBerry 10.0.0

#include <bb/pim/calendar/Recurrence>

To link against this class, add the following line to your .pro file: LIBS += -lbbpim

The Recurrence class represents recurrence data for calendar events.

This class specifies how an event repeats. An event that happens over and over (for example, every day, or on working days, or every Monday, Wednesday and Friday) has an associated recurrence rule (that is, event.recurrence().isValid() returns true).

A recurrence may be infinite (no end date or number of occurrences specified). A finite recurrence has an end date or a number of occurrences.

This class is modeled after the ActiveSync Recurrence element (http://msdn.microsoft.com/en-us/library/ee219748%28v=EXCHG.80%29.aspx). It can express as many recurrence patterns as the ActiveSync element, but not as many as the iCalendar RRULE element (http://www.kanzaki.com/docs/ical/rrule.html). For example, it's not possible to define a rule for hourly recurrence with this class.

## Overview

### Public Functions Index

Recurrence () | |

Recurrence (const Recurrence &other) | |

~Recurrence () | |

void | addException (const QDateTime &exception) |

void | addOccurrenceDate (const QDateTime &occurrenceDate) |

int | dayInMonth () const |

int | dayInWeek () const |

QDateTime | end () const |

QList< QDateTime > | exceptions () const |

WeekStartDay::Type | firstDay () const |

Frequency::Type | frequency () const |

int | interval () const |

bool | isValid () const |

int | monthInYear () const |

int | numberOfOccurrences () const |

QList< QDateTime > | occurrenceDates () const |

Recurrence & | operator= (const Recurrence &other) |

void | resetExceptions () |

void | resetOccurrenceDates () |

void | setDayInMonth (int dayInMonth) |

void | setDayInWeek (int dayInWeek) |

void | setEnd (const QDateTime &end) |

void | setExceptions (const QList< QDateTime > &exceptions) |

void | setFirstDay (WeekStartDay::Type firstDay) |

void | setFrequency (Frequency::Type frequency) |

void | setInterval (int interval) |

void | setMonthInYear (int monthInYear) |

void | setNumberOfOccurrences (int numberOfOccurrences) |

void | setOccurrenceDates (const QList< QDateTime > &occurrenceDates) |

void | setStart (const QDateTime &start) |

void | setUntil (const QDateTime &until) |

void | setWeekInMonth (int weekInMonth) |

QDateTime | start () const |

QDateTime | until () const |

int | weekInMonth () const |

## Public Functions

Copy constructor.

This function constructs a Recurrence containing exactly the same values as the provided Recurrence.

Parameters | |
---|---|

other |
The Recurrence to be copied. |

BlackBerry 10.0.0

Destructor.

BlackBerry 10.0.0

### void

Adds an exception date to this Recurrence.

This function appends a new exception date to the list of existing exception dates.

Parameters | |
---|---|

exception |
The exception date to add. |

BlackBerry 10.0.0

### void

Adds an occurrence date to this Recurrence.

This function appends a new occurrence date to the list of existing occurrence dates.

Parameters | |
---|---|

occurrenceDate |
The occurrence date to add. |

BlackBerry 10.0.0

### int

Retrieves the day of the month when this Recurrence repeats.

This value is meaningful only when the frequency is monthly on a date or yearly on a date.

The day of the month when this Recurrence repeats.

BlackBerry 10.0.0

### int

Retrieves the days of the week when this Recurrence repeats.

This value is meaningful only when the frequency is weekly, monthly on a week day, or yearly on a week day of a month.

Each week day has a corresponding value: 1 - Sunday 2 - Monday 4 - Tuesday 8 - Wednesday 16 - Thursday 32 - Friday 64 - Saturday 127 - Last day in the month

The values can be OR'ed together to have rules with multiple days. For example, a recurrence that happens on Tuesday and Thursday should have a value of 4 + 16 = 20.

The days of the week when this Recurrence repeats.

BlackBerry 10.0.0

### QDateTime

Retrieves the end time of this Recurrence.

The end time of this Recurrence.

BlackBerry 10.0.0

### QList< QDateTime >

Retrieves the exception dates for this Recurrence.

This function returns the dates of occurrences that were modified (recurrence exceptions) or deleted (recurrence exclusions).

The exception dates for this Recurrence.

BlackBerry 10.0.0

### WeekStartDay::Type

Retrieves the recurrence firstDay of the week of this Recurrence.

The recurrence firstDay specifies the day on which the workweek starts. Valid values are MO, TU, WE, TH, FR, SA and SU. This is significant when a WEEKLY RRULE has an interval greater than 1, and a BYDAY rule part is specified. This is also significant when in a YEARLY RRULE when a BYWEEKNO rule part is specified. The default value is SU. The value is not significant in other types of recurrences. Possible values are: 0 - Sunday (SU) 1 - Monday (MO) 2 - Tuesday (TU) 3 - Wednesday (WE) 4 - Thursday (TH) 5 - Friday (FR) 6 - Saturday (SA)

The recurrence firstDay of the week this Recurrence.

BlackBerry 10.2.0

### Frequency::Type

Retrieves the recurrence frequency of this Recurrence.

daily

weekly

monthly on a day of the week (for example, the first Monday every month)

monthly on a date (for example, the 15th day every month)

yearly on a week day of a month (for example, the second Sunday of May)

yearly on a date (for example, July 1st)

The recurrence frequency of this Recurrence.

BlackBerry 10.0.0

### int

Retrieves the recurrence interval of this Recurrence.

The recurrence interval is the number of times a rule must generate a possible date to produce an occurrence.

A recurrence rule and a start date yield a set of possible dates. For example, a daily event that repeats five times starting at July 23rd 2012 has five possible dates. With the default interval value of one, the occurrences for this event will be the 23rd, 24th, 25th, 26th and 27th. With a value of two, the occurrences will be 24th, 26th, 28th, 30th and 1st of August.

The recurrence interval of this Recurrence.

BlackBerry 10.0.0

### bool

Indicates whether this Recurrence is valid.

This function determines whether the attributes of this Recurrence object have acceptable values.

true if this Recurrence is valid, false otherwise.

BlackBerry 10.0.0

### int

Retrieves the month in the year when this Recurrence repeats.

This value is meaningful only when the frequency is yearly on a date or yearly on a week day of a month.

The month in the year when this Recurrence repeats.

BlackBerry 10.0.0

### int

Retrieves the number of occurrences of this Recurrence.

This function returns the number of repetitions in a finite recurrence.

The number of occurrences of this Recurrence.

BlackBerry 10.0.0

### QList< QDateTime >

Retrieves the dates of the occurrences for this Recurrence.

This function returns the dates of occurrences.

The occurrence dates for this Recurrence.

### Recurrence &

Assignment operator.

This operator copies all values from the provided Recurrence into this Recurrence.

Parameters | |
---|---|

other |
The Recurrence from which to copy all values. |

A reference to this Recurrence.

BlackBerry 10.0.0

### void

Sets the day of the month for this Recurrence.

Parameters | |
---|---|

dayInMonth |
The new day of the month. |

BlackBerry 10.0.0

### void

Sets the day of the week for this Recurrence.

Parameters | |
---|---|

dayInWeek |
The new day of the week. |

BlackBerry 10.0.0

### void

Sets the end time of this Recurrence.

Parameters | |
---|---|

end |
The new end time. |

BlackBerry 10.0.0

### void

Sets the list of exception dates for this Recurrence.

This function replaces the current list of exception dates with the provided list.

Parameters | |
---|---|

exceptions |
The list of exception dates to set. |

BlackBerry 10.0.0

### void

Sets the recurrence firstDay of the week of this Recurrence.

Parameters | |
---|---|

firstDay |
The new firstDay of the week. |

BlackBerry 10.2.0

### void

Sets the recurrence frequency of this Recurrence.

Parameters | |
---|---|

frequency |
The new recurrence frequency. |

BlackBerry 10.0.0

### void

Sets the recurrence interval of this Recurrence.

Parameters | |
---|---|

interval |
The new recurrence interval. |

BlackBerry 10.0.0

### void

Sets the month of the year for this Recurrence.

Parameters | |
---|---|

monthInYear |
The new month of the year. |

BlackBerry 10.0.0

### void

Sets the number of occurrences of this Recurrence.

Parameters | |
---|---|

numberOfOccurrences |
The new number of occurrences. |

BlackBerry 10.0.0

### void

Sets the list of occurrence dates for this Recurrence.

This function replaces the current list of occurrence dates with the provided list.

Parameters | |
---|---|

occurrenceDates |
The list of occurrence dates to set. |

BlackBerry 10.0.0

### void

Sets the start time of this Recurrence.

Parameters | |
---|---|

start |
The new start time. |

BlackBerry 10.0.0

### void

Sets the until date of this Recurrence.

Parameters | |
---|---|

until |
The new until time. |

BlackBerry 10.0.0

### void

Sets the week of the month for this Recurrence.

Parameters | |
---|---|

weekInMonth |
The new week of the month. |

BlackBerry 10.0.0

### QDateTime

Retrieves the start time of this Recurrence.

The start time of this Recurrence.

BlackBerry 10.0.0

### QDateTime

Retrieves the until date of this Recurrence.

This function returns the date when the recurrence ends. A finite recurrence should have an until date or a defined number of occurrences.

The until date of this Recurrence.

BlackBerry 10.0.0

### int

Retrieves the week in the month when this Recurrence repeats.

This value is meaningful only when the frequency is monthly on a week day or yearly on a week day of a month.

For example, the recurrence rule for an event on the second Sunday of May would have a value of 2 in this attribute.

The week in the month when this Recurrence repeats.

BlackBerry 10.0.0