KDE PIM / Developers / API Docs / libkcal

KCal::Recurrence Class Reference

This class represents a recurrence rule for a calendar incidence. More...

#include <recurrence.h>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Static Public Attributes

Protected Types

Protected Member Functions

Classes


Detailed Description

This class represents a recurrence rule for a calendar incidence.


Member Enumeration Documentation

anonymous enum
 

enumeration for describing how an event recurs, if at all.

enum KCal::Recurrence::Feb29Type
 

Enumeration for specifying what date yearly recurrences of February 29th occur in non-leap years.


Member Function Documentation

QDateTime KCal::Recurrence::recurStart  )  const [inline]
 

Return the start of the recurrence.

void KCal::Recurrence::setRecurStart const QDateTime &  start  ) 
 

Set start of recurrence, as a date and time.

void KCal::Recurrence::setRecurStart const QDate &  start  ) 
 

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.

void KCal::Recurrence::setFloats bool  f  ) 
 

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().

bool KCal::Recurrence::doesFloat  )  const [inline]
 

Returns whether the recurrence has no time, just a date.

void KCal::Recurrence::setRecurReadOnly bool  readOnly  )  [inline]
 

Set if recurrence is read-only or can be changed.

bool KCal::Recurrence::recurReadOnly  )  const [inline]
 

Returns true if the recurrence is read-only, or false if it can be changed.

void KCal::Recurrence::setCompatVersion int  version = 0  ) 
 

Set the calendar file version for backwards compatibility.

Parameters:
version is the KOrganizer/libkcal version, e.g. 220 for KDE 2.2.0. Specify version = 0 to cancel compatibility mode.

ushort KCal::Recurrence::doesRecur  )  const
 

Returns the event's recurrence status.

See the enumeration at the top of this file for possible values.

bool KCal::Recurrence::recursOnPure const QDate &  qd  )  const
 

Returns true if the date specified is one on which the event will recur.

bool KCal::Recurrence::recursAtPure const QDateTime &   )  const
 

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.

void KCal::Recurrence::unsetRecurs  ) 
 

Turns off recurrence for the event.

QValueList<QTime> KCal::Recurrence::recurTimesOn const QDate &  date  )  const
 

Returns a list of the times on the specified date at which the recurrence will occur.

Parameters:
date the date for which to find the recurrence times.

QDate KCal::Recurrence::getNextDate const QDate &  preDate,
bool *  last = 0
const
 

Returns the date of the next recurrence, after the specified date.

Parameters:
preDate the date after which to find the recurrence.
last if non-null, *last is set to true if the next recurrence is the last recurrence, else false. Reply = date of next recurrence, or invalid date if none.

QDateTime KCal::Recurrence::getNextDateTime const QDateTime &  preDateTime,
bool *  last = 0
const
 

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.

Parameters:
preDateTime the date/time after which to find the recurrence.
last if non-null, *last is set to true if the next recurrence is the last recurrence, else false. Reply = date/time of next recurrence, or invalid date if none.

QDate KCal::Recurrence::getPreviousDate const QDate &  afterDate,
bool *  last = 0
const
 

Returns the date of the last previous recurrence, before the specified date.

Parameters:
afterDate the date before which to find the recurrence.
last if non-null, *last is set to true if the previous recurrence is the last recurrence, else false. Reply = date of previous recurrence, or invalid date if none.

QDateTime KCal::Recurrence::getPreviousDateTime const QDateTime &  afterDateTime,
bool *  last = 0
const
 

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.

Parameters:
afterDateTime the date/time before which to find the recurrence.
last if non-null, *last is set to true if the previous recurrence is the last recurrence, else false. Reply = date/time of previous recurrence, or invalid date if none.

int KCal::Recurrence::frequency  )  const
 

Returns frequency of recurrence, in terms of the recurrence time period type.

void KCal::Recurrence::setFrequency int  freq  ) 
 

Sets the frequency of recurrence, in terms of the recurrence time period type.

int KCal::Recurrence::duration  )  const
 

Returns -1 if the event recurs infinitely, 0 if the end date is set, otherwise the total number of recurrences, including the initial occurrence.

void KCal::Recurrence::setDuration int  duration  ) 
 

Sets the total number of times the event is to occur, including both the first and last.

int KCal::Recurrence::durationTo const QDate &   )  const
 

Returns the number of recurrences up to and including the date specified.

int KCal::Recurrence::durationTo const QDateTime &   )  const
 

Returns the number of recurrences up to and including the date/time specified.

QDate KCal::Recurrence::endDate bool *  result = 0  )  const
 

Returns the date of the last recurrence.

An invalid date is returned if the recurrence has no end.

Parameters:
result if non-null, *result is updated to true if successful, or false if there is no recurrence.

QDateTime KCal::Recurrence::endDateTime bool *  result = 0  )  const
 

Returns the date and time of the last recurrence.

An invalid date is returned if the recurrence has no end.

Parameters:
result if non-null, *result is updated to true if successful, or false if there is no recurrence.

QString KCal::Recurrence::endDateStr bool  shortfmt = true  )  const
 

Returns a string representing the recurrence end date in the format according to the user's locale settings.

void KCal::Recurrence::setEndDate const QDate &  endDate  ) 
 

Sets the date of the last recurrence.

The end time is set to the recurrence start time.

Parameters:
endDate the ending date after which to stop recurring.

void KCal::Recurrence::setEndDateTime const QDateTime &  endDateTime  ) 
 

Sets the date and time of the last recurrence.

Parameters:
endDateTime the ending date/time after which to stop recurring.

void KCal::Recurrence::setMinutely int  _rFreq,
int  duration
 

Sets an event to recur minutely.

Parameters:
_rFreq the frequency to recur, e.g. 2 is every other minute
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setMinutely int  _rFreq,
const QDateTime &  endDateTime
 

Sets an event to recur minutely.

Parameters:
_rFreq the frequency to recur, e.g. 2 is every other minute
endDateTime the ending date/time after which to stop recurring

void KCal::Recurrence::setHourly int  _rFreq,
int  duration
 

Sets an event to recur hourly.

Parameters:
_rFreq the frequency to recur, e.g. 2 is every other hour
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setHourly int  _rFreq,
const QDateTime &  endDateTime
 

Sets an event to recur hourly.

Parameters:
_rFreq the frequency to recur, e.g. 2 is every other hour
endDateTime the ending date/time after which to stop recurring

void KCal::Recurrence::setDaily int  _rFreq,
int  duration
 

Sets an event to recur daily.

Parameters:
_rFreq the frequency to recur, e.g. 2 is every other day
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setDaily int  _rFreq,
const QDate &  endDate
 

Sets an event to recur daily.

Parameters:
_rFreq the frequency to recur, e.g. 2 is every other day
endDate the ending date after which to stop recurring

void KCal::Recurrence::setWeekly int  _rFreq,
const QBitArray &  _rDays,
int  duration,
int  weekStart = 1
 

Sets an event to recur weekly.

Parameters:
_rFreq the frequency to recur, e.g. every other week etc.
_rDays a 7 bit array indicating which days on which to recur (bit 0 = Monday).
duration the number of times the event is to occur, or -1 to recur indefinitely.
weekStart the first day of the week (Monday=1 .. Sunday=7, default is Monday).

void KCal::Recurrence::setWeekly int  _rFreq,
const QBitArray &  _rDays,
const QDate &  endDate,
int  weekStart = 1
 

Sets an event to recur weekly.

Parameters:
_rFreq the frequency to recur, e.g. every other week etc.
_rDays a 7 bit array indicating which days on which to recur (bit 0 = Monday).
endDate the date on which to stop recurring.
weekStart the first day of the week (Monday=1 .. Sunday=7, default is Monday).

int KCal::Recurrence::weekStart  )  const [inline]
 

Returns the first day of the week.

Monday=1 .. Sunday=7.

const QBitArray& KCal::Recurrence::days  )  const
 

Returns week day mask (bit 0 = Monday).

void KCal::Recurrence::setMonthly short  type,
int  _rFreq,
int  duration
 

Sets an event to recur monthly.

Parameters:
type rMonthlyPos or rMonthlyDay
_rFreq the frequency to recur, e.g. 3 for every third month.
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setMonthly short  type,
int  _rFreq,
const QDate &  endDate
 

same as above, but with ending date not number of recurrences

void KCal::Recurrence::addMonthlyPos short  _rPos,
const QBitArray &  _rDays
 

Adds a position to the recursMonthlyPos recurrence rule, if it is set.

Parameters:
_rPos the position in the month for the recurrence, with valid values being 1-5 (5 weeks max in a month).
_rDays the days for the position to recur on (bit 0 = Monday). Example: _rPos = 2, and bits 0 and 2 are set in _rDays: the rule is to repeat every 2nd Monday and Wednesday in the month.

void KCal::Recurrence::addMonthlyDay short  _rDay  ) 
 

Adds a position to the recursMonthlyDay list.

Parameters:
_rDay the date in the month to recur.

const QPtrList<rMonthPos>& KCal::Recurrence::monthPositions  )  const
 

Returns list of day positions in months.

const QPtrList<int>& KCal::Recurrence::monthDays  )  const
 

Returns list of day numbers of a month.

void KCal::Recurrence::setYearly int  type,
int  freq,
int  duration
 

Sets an event to recur yearly.

Parameters:
type rYearlyMonth, rYearlyPos or rYearlyDay
freq the frequency to recur, e.g. 3 for every third year.
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setYearly int  type,
int  freq,
const QDate &  endDate
 

Sets an event to recur yearly ending at endDate.

void KCal::Recurrence::setYearlyByDate Feb29Type  type,
int  freq,
int  duration
 

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().

Parameters:
type the way recurrences of February 29th are to be handled in non-leap years.
freq the frequency to recur, e.g. 3 for every third year.
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setYearlyByDate Feb29Type  type,
int  freq,
const QDate &  endDate
 

Sets an event to recur yearly ending at endDate.

void KCal::Recurrence::setYearlyByDate int  day,
Feb29Type  type,
int  freq,
int  duration
 

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().

Parameters:
day the day of the month for the event
type the way recurrences of February 29th are to be handled in non-leap years.
freq the frequency to recur, e.g. 3 for every third year.
duration the number of times the event is to occur, or -1 to recur indefinitely.

void KCal::Recurrence::setYearlyByDate int  day,
Feb29Type  type,
int  freq,
const QDate &  endDate
 

Sets an event to recur yearly ending at endDate.

void KCal::Recurrence::addYearlyNum short  _rNum  ) 
 

Adds position of day or month in year.

N.B. for recursYearlyPos, addYearlyMonthPos() must also be called to add positions within the month.

void KCal::Recurrence::addYearlyMonthPos short  _rPos,
const QBitArray &  _rDays
 

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().

const QPtrList<int>& KCal::Recurrence::yearNums  )  const
 

Returns positions of days or months in year.

const QPtrList<rMonthPos>& KCal::Recurrence::yearMonthPositions  )  const
 

Returns list of day positions in months, for a recursYearlyPos recurrence rule.

Feb29Type KCal::Recurrence::feb29YearlyType  )  const [inline]
 

Returns how yearly recurrences of February 29th are handled.

static void KCal::Recurrence::setFeb29YearlyTypeDefault Feb29Type  t  )  [inline, static]
 

Sets the default method for handling yearly recurrences of February 29th.

static Feb29Type KCal::Recurrence::setFeb29YearlyTypeDefault  )  [inline, static]
 

Returns the default method for handling yearly recurrences of February 29th.

int KCal::Recurrence::countMonthlyPosDays  )  const
 

Returns the number of days in the month which recur.

Reply = -1 if the number varies from month to month.

void KCal::Recurrence::getMonthlyPosDays QValueList< int > &  list,
int  daysInMonth,
int  startDayOfWeek
const
 

Returns the days in a specified month which recur, in numerical order.

Parameters:
list receives the list of days which recur
daysInMonth number of days in this month
startDayOfWeek day of week for the first day in this month.

bool KCal::Recurrence::getMonthlyDayDays QValueList< int > &  list,
int  daysInMonth
const
 

Returns the days in a specified month which recur, in numerical order.

Parameters:
list receives the list of days which recur
daysInMonth number of days in this month Reply = true if day numbers varies from month to month.

bool KCal::Recurrence::getYearlyMonthMonths int  day,
QValueList< int > &  list,
QValueList< int > &  leaplist
const
 

Get the months which recur, in numerical order, for both leap years and non-leap years.

N.B. If February 29th recurs on March 1st in non-leap years, February (not March) is included in the non-leap year month list.

Parameters:
day 
list receives the list of months which recur in non-leap years
leaplist receives the list of months which recur in leap years Reply = true if February 29th also recurs.

void KCal::Recurrence::dump  )  const
 

Debug output.


Member Data Documentation

const QDate KCal::Recurrence::MAX_DATE [static]
 

Upper date limit for recurrences.


The documentation for this class was generated from the following file: