#include <recurrencerule.h>

Classes

class  WDayPos
 

Public Types

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

Public Member Functions

 RecurrenceRule (const 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)
 
TQDateTime startDt () const
 
void setStartDt (const TQDateTime &start)
 
bool doesFloat () const
 
void setFloats (bool floats)
 
TQDateTime endDt (bool *result=0) const
 
void setEndDt (const TQDateTime &endDateTime)
 
int duration () const
 
void setDuration (int duration)
 
int durationTo (const TQDateTime &) const
 
int durationTo (const TQDate &date) const
 
bool recursOn (const TQDate &qd) const
 
bool recursAt (const TQDateTime &) const
 
bool dateMatchesRules (const TQDateTime &qdt) const
 
TimeList recurTimesOn (const TQDate &date) const
 
DateTimeList timesInInterval (const TQDateTime &start, const TQDateTime &end) const
 
TQDateTime getNextDate (const TQDateTime &preDateTime) const
 
TQDateTime getPreviousDate (const TQDateTime &afterDateTime) const
 
void setBySeconds (const TQValueList< int > bySeconds)
 
void setByMinutes (const TQValueList< int > byMinutes)
 
void setByHours (const TQValueList< int > byHours)
 
void setByDays (const TQValueList< WDayPos > byDays)
 
void setByMonthDays (const TQValueList< int > byMonthDays)
 
void setByYearDays (const TQValueList< int > byYearDays)
 
void setByWeekNumbers (const TQValueList< int > byWeekNumbers)
 
void setByMonths (const TQValueList< int > byMonths)
 
void setBySetPos (const TQValueList< int > bySetPos)
 
void setWeekStart (short weekStart)
 
const TQValueList< int > & bySeconds () const
 
const TQValueList< int > & byMinutes () const
 
const TQValueList< int > & byHours () const
 
const TQValueList< WDayPos > & byDays () const
 
const TQValueList< int > & byMonthDays () const
 
const TQValueList< int > & byYearDays () const
 
const TQValueList< int > & byWeekNumbers () const
 
const TQValueList< int > & byMonths () const
 
const TQValueList< int > & bySetPos () const
 
short weekStart () const
 
void setDirty ()
 
void addObserver (Observer *observer)
 
void removeObserver (Observer *observer)
 
void dump () const
 

Public Attributes

TQString mRRule
 

Detailed Description

This class represents a recurrence rule for a calendar incidence.

Definition at line 169 of file recurrencerule.h.

Member Enumeration Documentation

◆ PeriodType

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

Definition at line 180 of file recurrencerule.h.

Member Function Documentation

◆ addObserver()

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
observerthe Recurrence::Observer-derived object, which will be installed as an observer of this object.

Definition at line 542 of file recurrencerule.cpp.

◆ clear()

void RecurrenceRule::clear ( )

Turns off recurrence for the event.

Definition at line 603 of file recurrencerule.cpp.

◆ dateMatchesRules()

bool RecurrenceRule::dateMatchesRules ( const TQDateTime &  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 954 of file recurrencerule.cpp.

◆ doesFloat()

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

◆ doesRecur()

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

◆ dump()

void RecurrenceRule::dump ( ) const

Debug output.

Definition at line 1590 of file recurrencerule.cpp.

◆ duration()

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

◆ durationTo() [1/2]

int KCal::RecurrenceRule::durationTo ( const TQDate &  date) const
inline

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

Definition at line 270 of file recurrencerule.h.

◆ durationTo() [2/2]

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

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

Definition at line 1144 of file recurrencerule.cpp.

◆ endDt()

TQDateTime 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
resultif non-null, *result is updated to true if successful, or false if there is no recurrence.

Definition at line 563 of file recurrencerule.cpp.

◆ frequency()

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

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

Definition at line 229 of file recurrencerule.h.

◆ getNextDate()

TQDateTime RecurrenceRule::getNextDate ( const TQDateTime &  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
preDateTimethe date/time after which to find the recurrence.
Returns
date/time of next recurrence, or invalid date if none.

Definition at line 1222 of file recurrencerule.cpp.

◆ getPreviousDate()

TQDateTime RecurrenceRule::getPreviousDate ( const TQDateTime &  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
afterDateTimethe date/time before which to find the recurrence.
Returns
date/time of previous recurrence, or invalid date if none.

Definition at line 1164 of file recurrencerule.cpp.

◆ isReadOnly()

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

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

Definition at line 216 of file recurrencerule.h.

◆ recursAt()

bool RecurrenceRule::recursAt ( const TQDateTime &  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.

Definition at line 1095 of file recurrencerule.cpp.

◆ recursOn()

bool RecurrenceRule::recursOn ( const TQDate &  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 964 of file recurrencerule.cpp.

◆ recurTimesOn()

TimeList RecurrenceRule::recurTimesOn ( const TQDate &  date) const

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

Parameters
datethe date for which to find the recurrence times.

Definition at line 1128 of file recurrencerule.cpp.

◆ removeObserver()

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
observerthe Recurrence::Observer-derived object to be removed from the list of observers of this object.

Definition at line 548 of file recurrencerule.cpp.

◆ setDuration()

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

◆ setEndDt()

void RecurrenceRule::setEndDt ( const TQDateTime &  endDateTime)

Sets the date and time of the last recurrence.

Parameters
endDateTimethe ending date/time after which to stop recurring.

Definition at line 581 of file recurrencerule.cpp.

◆ setFloats()

void RecurrenceRule::setFloats ( bool  floats)

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

has no time attached)

Definition at line 596 of file recurrencerule.cpp.

◆ setFrequency()

void RecurrenceRule::setFrequency ( int  freq)

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

Definition at line 641 of file recurrencerule.cpp.

◆ setReadOnly()

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

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

Definition at line 214 of file recurrencerule.h.

◆ setStartDt()

void RecurrenceRule::setStartDt ( const TQDateTime &  start)

Set start of recurrence, as a date and time.

Definition at line 634 of file recurrencerule.cpp.

◆ startDt()

TQDateTime KCal::RecurrenceRule::startDt ( ) const
inline

Return the start of the recurrence.

Definition at line 235 of file recurrencerule.h.

◆ timesInInterval()

DateTimeList RecurrenceRule::timesInInterval ( const TQDateTime &  start,
const TQDateTime &  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
startinclusive start of interval
endinclusive end of interval
Returns
list of date/time values

Definition at line 1273 of file recurrencerule.cpp.


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