• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KCal Library

KCal::RecurrenceRule

KCal::RecurrenceRule Class Reference

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

#include <recurrencerule.h>

List of all members.


Classes

class  WDayPos
 structure for describing the n-th weekday of the month/year. More...

Public Types

typedef ListBase< RecurrenceRule > List
enum  PeriodType {
  rNone = 0, rSecondly, rMinutely, rHourly,
  rDaily, rWeekly, rMonthly, rYearly
}

Public Member Functions

void addObserver (RuleObserver *observer)
bool allDay () const
const QList< WDayPos > & byDays () const
const QList< int > & byHours () const
const QList< int > & byMinutes () const
const QList< int > & byMonthDays () const
const QList< int > & byMonths () const
const QList< int > & bySeconds () const
const QList< int > & bySetPos () const
const QList< int > & byWeekNumbers () const
const QList< int > & byYearDays () const
void clear ()
bool dateMatchesRules (const KDateTime &dt) const
void dump () const
int duration () const
int durationTo (const QDate &date) const
int durationTo (const KDateTime &dt) const
KDateTime endDt (bool *result=0) const
uint frequency () const
KDateTime getNextDate (const KDateTime &preDateTime) const
KDateTime getPreviousDate (const KDateTime &afterDateTime) const
bool isReadOnly () const
bool operator!= (const RecurrenceRule &r) const
RecurrenceRule & operator= (const RecurrenceRule &r)
bool operator== (const RecurrenceRule &r) const
 RecurrenceRule (const RecurrenceRule &r)
PeriodType recurrenceType () const
bool recurs () const
bool recursAt (const KDateTime &dt) const
bool recursOn (const QDate &date, const KDateTime::Spec &timeSpec) const
TimeList recurTimesOn (const QDate &date, const KDateTime::Spec &timeSpec) const
void removeObserver (RuleObserver *observer)
QString rrule () const
void setAllDay (bool allDay)
void setByDays (const QList< WDayPos > byDays)
void setByHours (const QList< int > byHours)
void setByMinutes (const QList< int > byMinutes)
void setByMonthDays (const QList< int > byMonthDays)
void setByMonths (const QList< int > byMonths)
void setBySeconds (const QList< int > bySeconds)
void setBySetPos (const QList< int > bySetPos)
void setByWeekNumbers (const QList< int > byWeekNumbers)
void setByYearDays (const QList< int > byYearDays)
void setDirty ()
void setDuration (int duration)
void setEndDt (const KDateTime &endDateTime)
void setFrequency (int freq)
void setReadOnly (bool readOnly)
void setRecurrenceType (PeriodType period)
void setRRule (const QString &rrule)
void setStartDt (const KDateTime &start)
void setWeekStart (short weekStart)
void shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
KDateTime startDt () const
DateTimeList timesInInterval (const KDateTime &start, const KDateTime &end) const
short weekStart () const

Detailed Description

This class represents a recurrence rule for a calendar incidence.

Definition at line 46 of file recurrencerule.h.


Member Enumeration Documentation

enum KCal::RecurrenceRule::PeriodType

enum for describing the frequency how an event recurs, if at all.

Definition at line 59 of file recurrencerule.h.


Member Function Documentation

void RecurrenceRule::addObserver ( RuleObserver *  observer  ) 

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.

Parameters:
observer the Recurrence::Observer-derived object, which will be installed as an observer of this object.

Definition at line 866 of file recurrencerule.cpp.

bool RecurrenceRule::allDay (  )  const

Returns whether the start date has no time associated.

All-Day means -- according to rfc2445 -- that the event has no time associate.

Definition at line 2095 of file recurrencerule.cpp.

void RecurrenceRule::clear (  ) 

Turns off recurrence for the event.

Definition at line 948 of file recurrencerule.cpp.

bool RecurrenceRule::dateMatchesRules ( const KDateTime &  dt  )  const

Returns true if the date matches the rules.

It does not necessarily mean that this is an actual occurrence. In particular, the method does not check if the date is after the end date, or if the frequency interval matches.

Parameters:
dt the date+time to check for matching the rules

Definition at line 1317 of file recurrencerule.cpp.

void RecurrenceRule::dump (  )  const

Debug output.

Definition at line 1959 of file recurrencerule.cpp.

int RecurrenceRule::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.

Definition at line 2065 of file recurrencerule.cpp.

int RecurrenceRule::durationTo ( const QDate &  date  )  const

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

Definition at line 1535 of file recurrencerule.cpp.

int RecurrenceRule::durationTo ( const KDateTime &  dt  )  const

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

Definition at line 1513 of file recurrencerule.cpp.

KDateTime RecurrenceRule::endDt ( 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 or its end date cannot be determined.

Definition at line 889 of file recurrencerule.cpp.

uint RecurrenceRule::frequency (  )  const

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

Definition at line 2060 of file recurrencerule.cpp.

KDateTime RecurrenceRule::getNextDate ( const KDateTime &  preDateTime  )  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.
Returns:
date/time of next recurrence, or invalid date if none.

Definition at line 1606 of file recurrencerule.cpp.

KDateTime RecurrenceRule::getPreviousDate ( const KDateTime &  afterDateTime  )  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.
Returns:
date/time of previous recurrence, or invalid date if none.

Definition at line 1540 of file recurrencerule.cpp.

bool RecurrenceRule::isReadOnly (  )  const

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

Definition at line 2080 of file recurrencerule.cpp.

bool RecurrenceRule::recurs (  )  const

Returns the event's recurrence status.

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

Definition at line 2090 of file recurrencerule.cpp.

bool RecurrenceRule::recursAt ( const KDateTime &  dt  )  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. The start date/time returns true only if it actually matches the rule.

Parameters:
dt the date+time to check for recurrency

Definition at line 1461 of file recurrencerule.cpp.

bool RecurrenceRule::recursOn ( const QDate &  date,
const KDateTime::Spec &  timeSpec 
) const

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

The start date returns true only if it actually matches the rule.

Parameters:
date date to check
timeSpec time specification for date

Definition at line 1328 of file recurrencerule.cpp.

TimeList RecurrenceRule::recurTimesOn ( const QDate &  date,
const KDateTime::Spec &  timeSpec 
) const

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

The returned times should be interpreted in the context of timeSpec.

Parameters:
date the date for which to find the recurrence times
timeSpec time specification for date

Definition at line 1497 of file recurrencerule.cpp.

void RecurrenceRule::removeObserver ( RuleObserver *  observer  ) 

Removes an observer that was added with addObserver.

If the given object was not an observer, it does nothing.

Parameters:
observer the Recurrence::Observer-derived object to be removed from the list of observers of this object.

Definition at line 873 of file recurrencerule.cpp.

void RecurrenceRule::setAllDay ( bool  allDay  ) 

Sets whether the dtstart is all-day (i.e.

has no time attached)

Parameters:
allDay Whether start datetime is all-day

Definition at line 939 of file recurrencerule.cpp.

void RecurrenceRule::setDuration ( int  duration  ) 

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

Definition at line 930 of file recurrencerule.cpp.

void RecurrenceRule::setEndDt ( const KDateTime &  endDateTime  ) 

Sets the date and time of the last recurrence.

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

Definition at line 920 of file recurrencerule.cpp.

void RecurrenceRule::setFrequency ( int  freq  ) 

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

Definition at line 967 of file recurrencerule.cpp.

void RecurrenceRule::setReadOnly ( bool  readOnly  ) 

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

Definition at line 2085 of file recurrencerule.cpp.

void RecurrenceRule::setRRule ( const QString &  rrule  ) 

Set the RRULE string for the rule.

This is merely stored for future reference. The string is not used in any way by the RecurrenceRule.

Parameters:
rrule the RRULE string

Definition at line 2075 of file recurrencerule.cpp.

void RecurrenceRule::setStartDt ( const KDateTime &  start  ) 

Sets the recurrence start date/time.

Note that setting the start date/time does not make the recurrence occur on that date/time, it simply sets a lower limit to when the recurrences take place.

Parameters:
start the recurrence's start date and time

Definition at line 958 of file recurrencerule.cpp.

void RecurrenceRule::shiftTimes ( const KDateTime::Spec &  oldSpec,
const KDateTime::Spec &  newSpec 
)

Shift the times of the rule so that they appear at the same clock time as before but in a new time zone.

The shift is done from a viewing time zone rather than from the actual rule time zone.

For example, shifting a rule whose start time is 09:00 America/New York, using an old viewing time zone (oldSpec) of Europe/London, to a new time zone (newSpec) of Europe/Paris, will result in the time being shifted from 14:00 (which is the London time of the rule start) to 14:00 Paris time.

Parameters:
oldSpec the time specification which provides the clock times
newSpec the new time specification

Definition at line 1066 of file recurrencerule.cpp.

KDateTime RecurrenceRule::startDt (  )  const

Returns the recurrence start date/time.

Note that the recurrence does not necessarily occur on the start date/time. For this to happen, it must actually match the rule.

Definition at line 2050 of file recurrencerule.cpp.

DateTimeList RecurrenceRule::timesInInterval ( const KDateTime &  start,
const KDateTime &  end 
) const

Returns a list of all the times at which the recurrence will occur between two specified times.

There is a (large) maximum limit to the number of times returned. If due to this limit the list is incomplete, this is indicated by the last entry being set to an invalid KDateTime value. If you need further values, call the method again with a start time set to just after the last valid time returned.

Parameters:
start inclusive start of interval
end inclusive end of interval
Returns:
list of date/time values

Definition at line 1669 of file recurrencerule.cpp.


The documentation for this class was generated from the following files:
  • recurrencerule.h
  • recurrencerule.cpp

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal