libkcal

KCal::RecurrenceRule Class Reference

#include <recurrencerule.h>

List of all members.


Detailed Description

This class represents a recurrence rule for a calendar incidence.

Definition at line 66 of file recurrencerule.h.


Public Types

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

Public Member Functions

 RecurrenceRule ()
 RecurrenceRule (const RecurrenceRule &)
 ~RecurrenceRule ()
bool operator== (const RecurrenceRule &) const
bool operator!= (const RecurrenceRule &r) const
RecurrenceRuleoperator= (const RecurrenceRule &)
void setReadOnly (bool readOnly)
bool isReadOnly () const
bool doesRecur () const
void setRecurrenceType (PeriodType period)
PeriodType recurrenceType () const
void clear ()
uint frequency () const
void setFrequency (int freq)
QDateTime startDt () const
void setStartDt (const QDateTime &start)
bool doesFloat () const
void setFloats (bool floats)
QDateTime endDt (bool *result=0) const
void setEndDt (const QDateTime &endDateTime)
int duration () const
void setDuration (int duration)
int durationTo (const QDateTime &) const
int durationTo (const QDate &date) const
bool recursOn (const QDate &qd) const
bool recursAt (const QDateTime &) const
bool dateMatchesRules (const QDateTime &qdt) const
TimeList recurTimesOn (const QDate &date) const
QDateTime getNextDate (const QDateTime &preDateTime) const
QDateTime getPreviousDate (const QDateTime &afterDateTime) const
void setBySeconds (const QValueList< int > bySeconds)
void setByMinutes (const QValueList< int > byMinutes)
void setByHours (const QValueList< int > byHours)
void setByDays (const QValueList< WDayPos > byDays)
void setByMonthDays (const QValueList< int > byMonthDays)
void setByYearDays (const QValueList< int > byYearDays)
void setByWeekNumbers (const QValueList< int > byWeekNumbers)
void setByMonths (const QValueList< int > byMonths)
void setBySetPos (const QValueList< int > bySetPos)
void setWeekStart (short weekStart)
const QValueList< int > & bySeconds () const
const QValueList< int > & byMinutes () const
const QValueList< int > & byHours () const
const QValueList< WDayPos > & byDays () const
const QValueList< int > & byMonthDays () const
const QValueList< int > & byYearDays () const
const QValueList< int > & byWeekNumbers () const
const QValueList< int > & byMonths () const
const QValueList< int > & bySetPos () const
short weekStart () const
void setDirty ()
void addObserver (Observer *observer)
void removeObserver (Observer *observer)
void dump () const

Public Attributes

QString mRRule

Classes

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

Member Enumeration Documentation

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

Definition at line 77 of file recurrencerule.h.


Member Function Documentation

void KCal::RecurrenceRule::setReadOnly ( bool  readOnly  )  [inline]

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

Definition at line 111 of file recurrencerule.h.

bool KCal::RecurrenceRule::isReadOnly (  )  const [inline]

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

Definition at line 113 of file recurrencerule.h.

bool KCal::RecurrenceRule::doesRecur (  )  const [inline]

Returns the event's recurrence status.

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

Definition at line 118 of file recurrencerule.h.

void RecurrenceRule::clear (  ) 

Turns off recurrence for the event.

Definition at line 607 of file recurrencerule.cpp.

uint KCal::RecurrenceRule::frequency (  )  const [inline]

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

Definition at line 126 of file recurrencerule.h.

void RecurrenceRule::setFrequency ( int  freq  ) 

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

Definition at line 645 of file recurrencerule.cpp.

QDateTime KCal::RecurrenceRule::startDt (  )  const [inline]

Return the start of the recurrence.

Definition at line 132 of file recurrencerule.h.

void RecurrenceRule::setStartDt ( const QDateTime &  start  ) 

Set start of recurrence, as a date and time.

Definition at line 638 of file recurrencerule.cpp.

bool KCal::RecurrenceRule::doesFloat (  )  const [inline]

Returns whether the start date has no time associated.

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

Definition at line 138 of file recurrencerule.h.

void RecurrenceRule::setFloats ( bool  floats  ) 

Sets whether the dtstart is a floating time (i.e.

has no time attached)

Definition at line 600 of file recurrencerule.cpp.

QDateTime 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.

Definition at line 562 of file recurrencerule.cpp.

void RecurrenceRule::setEndDt ( const QDateTime &  endDateTime  ) 

Sets the date and time of the last recurrence.

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

Definition at line 585 of file recurrencerule.cpp.

int KCal::RecurrenceRule::duration (  )  const [inline]

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 158 of file recurrencerule.h.

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 593 of file recurrencerule.cpp.

int RecurrenceRule::durationTo ( const QDateTime &   )  const

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

Definition at line 1030 of file recurrencerule.cpp.

int KCal::RecurrenceRule::durationTo ( const QDate &  date  )  const [inline]

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

Definition at line 167 of file recurrencerule.h.

bool RecurrenceRule::recursOn ( const QDate &  qd  )  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.

Definition at line 948 of file recurrencerule.cpp.

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

Definition at line 987 of file recurrencerule.cpp.

bool RecurrenceRule::dateMatchesRules ( const QDateTime &  qdt  )  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

Definition at line 938 of file recurrencerule.cpp.

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

Definition at line 1010 of file recurrencerule.cpp.

QDateTime RecurrenceRule::getNextDate ( const QDateTime &  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 1108 of file recurrencerule.cpp.

QDateTime RecurrenceRule::getPreviousDate ( const QDateTime &  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 1050 of file recurrencerule.cpp.

void RecurrenceRule::addObserver ( Observer 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 540 of file recurrencerule.cpp.

void RecurrenceRule::removeObserver ( Observer 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 546 of file recurrencerule.cpp.

void RecurrenceRule::dump (  )  const

Debug output.

Definition at line 1369 of file recurrencerule.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys