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.

See also:

CalendarEvent


Overview

Public Functions Index

Recurrence ()
Recurrence (const Recurrence &other)
~Recurrence ()
voidaddException (const QDateTime &exception)
voidaddOccurrenceDate (const QDateTime &occurrenceDate)
intdayInMonth () const
intdayInWeek () const
QDateTimeend () const
QList< QDateTime >exceptions () const
WeekStartDay::TypefirstDay () const
Frequency::Typefrequency () const
intinterval () const
boolisValid () const
intmonthInYear () const
intnumberOfOccurrences () const
QList< QDateTime >occurrenceDates () const
Recurrence &operator= (const Recurrence &other)
voidresetExceptions ()
voidresetOccurrenceDates ()
voidsetDayInMonth (int dayInMonth)
voidsetDayInWeek (int dayInWeek)
voidsetEnd (const QDateTime &end)
voidsetExceptions (const QList< QDateTime > &exceptions)
voidsetFirstDay (WeekStartDay::Type firstDay)
voidsetFrequency (Frequency::Type frequency)
voidsetInterval (int interval)
voidsetMonthInYear (int monthInYear)
voidsetNumberOfOccurrences (int numberOfOccurrences)
voidsetOccurrenceDates (const QList< QDateTime > &occurrenceDates)
voidsetStart (const QDateTime &start)
voidsetUntil (const QDateTime &until)
voidsetWeekInMonth (int weekInMonth)
QDateTimestart () const
QDateTimeuntil () const
intweekInMonth () const

Public Functions

Recurrence ()

Constructs a new Recurrence.

Since:

BlackBerry 10.0.0

Recurrence (

Copy constructor.

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

Parameters
other

The Recurrence to be copied.

Since:

BlackBerry 10.0.0

~Recurrence ()

Destructor.

Since:

BlackBerry 10.0.0

void addException (

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.

Since:

BlackBerry 10.0.0

void addOccurrenceDate (

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.

Since:

BlackBerry 10.0.0

int dayInMonth ()

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.

Return:

The day of the month when this Recurrence repeats.

Since:

BlackBerry 10.0.0

int dayInWeek ()

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.

Return:

The days of the week when this Recurrence repeats.

Since:

BlackBerry 10.0.0

QDateTime end ()

Retrieves the end time of this Recurrence.

Return:

The end time of this Recurrence.

Since:

BlackBerry 10.0.0

QList< QDateTime > exceptions ()

Retrieves the exception dates for this Recurrence.

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

Return:

The exception dates for this Recurrence.

Since:

BlackBerry 10.0.0

WeekStartDay::Type firstDay ()

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)

Return:

The recurrence firstDay of the week this Recurrence.

Since:

BlackBerry 10.2.0

Frequency::Type frequency ()

Retrieves the recurrence frequency of this Recurrence.

The frequency is represented by a Frequency object. This object indicates the type of recurrence, and can be one of the following:
  • 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)

Return:

The recurrence frequency of this Recurrence.

Since:

BlackBerry 10.0.0

int interval ()

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.

Return:

The recurrence interval of this Recurrence.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this Recurrence is valid.

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

Return:

true if this Recurrence is valid, false otherwise.

Since:

BlackBerry 10.0.0

int monthInYear ()

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.

Return:

The month in the year when this Recurrence repeats.

Since:

BlackBerry 10.0.0

int numberOfOccurrences ()

Retrieves the number of occurrences of this Recurrence.

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

Return:

The number of occurrences of this Recurrence.

Since:

BlackBerry 10.0.0

QList< QDateTime > occurrenceDates ()

Retrieves the dates of the occurrences for this Recurrence.

This function returns the dates of occurrences.

Return:

The occurrence dates for this Recurrence.

Recurrence & operator= (

Assignment operator.

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

Parameters
other

The Recurrence from which to copy all values.

Return:

A reference to this Recurrence.

Since:

BlackBerry 10.0.0

void resetExceptions ()

Removes all of the exception dates from this Recurrence.

Since:

BlackBerry 10.0.0

void resetOccurrenceDates ()

Removes all of the occurrence dates from this Recurrence.

Since:

BlackBerry 10.0.0

void setDayInMonth (
  • intdayInMonth)

Sets the day of the month for this Recurrence.

Parameters
dayInMonth

The new day of the month.

Since:

BlackBerry 10.0.0

void setDayInWeek (
  • intdayInWeek)

Sets the day of the week for this Recurrence.

Parameters
dayInWeek

The new day of the week.

Since:

BlackBerry 10.0.0

void setEnd (

Sets the end time of this Recurrence.

Parameters
end

The new end time.

Since:

BlackBerry 10.0.0

void setExceptions (

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.

Since:

BlackBerry 10.0.0

void setFirstDay (

Sets the recurrence firstDay of the week of this Recurrence.

Parameters
firstDay

The new firstDay of the week.

Since:

BlackBerry 10.2.0

void setFrequency (

Sets the recurrence frequency of this Recurrence.

Parameters
frequency

The new recurrence frequency.

Since:

BlackBerry 10.0.0

void setInterval (
  • intinterval)

Sets the recurrence interval of this Recurrence.

Parameters
interval

The new recurrence interval.

Since:

BlackBerry 10.0.0

void setMonthInYear (
  • intmonthInYear)

Sets the month of the year for this Recurrence.

Parameters
monthInYear

The new month of the year.

Since:

BlackBerry 10.0.0

void setNumberOfOccurrences (
  • intnumberOfOccurrences)

Sets the number of occurrences of this Recurrence.

Parameters
numberOfOccurrences

The new number of occurrences.

Since:

BlackBerry 10.0.0

void setOccurrenceDates (

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.

Since:

BlackBerry 10.0.0

void setStart (

Sets the start time of this Recurrence.

Parameters
start

The new start time.

Since:

BlackBerry 10.0.0

void setUntil (

Sets the until date of this Recurrence.

Parameters
until

The new until time.

Since:

BlackBerry 10.0.0

void setWeekInMonth (
  • intweekInMonth)

Sets the week of the month for this Recurrence.

Parameters
weekInMonth

The new week of the month.

Since:

BlackBerry 10.0.0

QDateTime start ()

Retrieves the start time of this Recurrence.

Return:

The start time of this Recurrence.

Since:

BlackBerry 10.0.0

QDateTime until ()

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.

Return:

The until date of this Recurrence.

Since:

BlackBerry 10.0.0

int weekInMonth ()

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.

Return:

The week in the month when this Recurrence repeats.

Since:

BlackBerry 10.0.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus