libkcal

KCal::RecurrenceRule Class Reference

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

#include <recurrencerule.h>

List of all members.


Classes

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

Public Types

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

Public Member Functions

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

Public Attributes

QString mRRule

Detailed Description

This class represents a recurrence rule for a calendar incidence.

Definition at line 66 of file recurrencerule.h.


Member Typedef Documentation


Member Enumeration Documentation

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

Enumerator:
rNone 
rSecondly 
rMinutely 
rHourly 
rDaily 
rWeekly 
rMonthly 
rYearly 

Definition at line 77 of file recurrencerule.h.


Constructor & Destructor Documentation

RecurrenceRule::RecurrenceRule (  ) 

Definition at line 478 of file recurrencerule.cpp.

RecurrenceRule::RecurrenceRule ( const RecurrenceRule r  ) 

Definition at line 485 of file recurrencerule.cpp.

RecurrenceRule::~RecurrenceRule (  ) 

Definition at line 511 of file recurrencerule.cpp.


Member Function Documentation

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.

const QValueList<WDayPos>& KCal::RecurrenceRule::byDays (  )  const [inline]

Definition at line 225 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::byHours (  )  const [inline]

Definition at line 223 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::byMinutes (  )  const [inline]

Definition at line 222 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::byMonthDays (  )  const [inline]

Definition at line 226 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::byMonths (  )  const [inline]

Definition at line 229 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::bySeconds (  )  const [inline]

Definition at line 221 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::bySetPos (  )  const [inline]

Definition at line 230 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::byWeekNumbers (  )  const [inline]

Definition at line 228 of file recurrencerule.h.

const QValueList<int>& KCal::RecurrenceRule::byYearDays (  )  const [inline]

Definition at line 227 of file recurrencerule.h.

void RecurrenceRule::clear (  ) 

Turns off recurrence for the event.

Definition at line 601 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 932 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.

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::dump (  )  const

Debug output.

Definition at line 1372 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.

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.

int RecurrenceRule::durationTo ( const QDateTime dt  )  const

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

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

Definition at line 1024 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 561 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.

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

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::operator!= ( const RecurrenceRule r  )  const [inline]

Definition at line 104 of file recurrencerule.h.

RecurrenceRule& KCal::RecurrenceRule::operator= ( const RecurrenceRule  ) 

bool RecurrenceRule::operator== ( const RecurrenceRule r  )  const

Definition at line 515 of file recurrencerule.cpp.

PeriodType KCal::RecurrenceRule::recurrenceType (  )  const [inline]

Definition at line 120 of file recurrencerule.h.

bool RecurrenceRule::recursAt ( const QDateTime qd  )  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 981 of file recurrencerule.cpp.

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 942 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 1004 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::setByDays ( const QValueList< WDayPos byDays  ) 

Definition at line 668 of file recurrencerule.cpp.

void RecurrenceRule::setByHours ( const QValueList< int >  byHours  ) 

Definition at line 660 of file recurrencerule.cpp.

void RecurrenceRule::setByMinutes ( const QValueList< int >  byMinutes  ) 

Definition at line 653 of file recurrencerule.cpp.

void RecurrenceRule::setByMonthDays ( const QValueList< int >  byMonthDays  ) 

Definition at line 675 of file recurrencerule.cpp.

void RecurrenceRule::setByMonths ( const QValueList< int >  byMonths  ) 

Definition at line 696 of file recurrencerule.cpp.

void RecurrenceRule::setBySeconds ( const QValueList< int >  bySeconds  ) 

Definition at line 646 of file recurrencerule.cpp.

void RecurrenceRule::setBySetPos ( const QValueList< int >  bySetPos  ) 

Definition at line 703 of file recurrencerule.cpp.

void RecurrenceRule::setByWeekNumbers ( const QValueList< int >  byWeekNumbers  ) 

Definition at line 689 of file recurrencerule.cpp.

void RecurrenceRule::setByYearDays ( const QValueList< int >  byYearDays  ) 

Definition at line 682 of file recurrencerule.cpp.

void RecurrenceRule::setDirty (  ) 

Definition at line 619 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 587 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 579 of file recurrencerule.cpp.

void RecurrenceRule::setFloats ( bool  floats  ) 

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

has no time attached)

Definition at line 594 of file recurrencerule.cpp.

void RecurrenceRule::setFrequency ( int  freq  ) 

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

Definition at line 639 of file recurrencerule.cpp.

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.

void RecurrenceRule::setRecurrenceType ( PeriodType  period  ) 

Definition at line 554 of file recurrencerule.cpp.

void RecurrenceRule::setStartDt ( const QDateTime start  ) 

Set start of recurrence, as a date and time.

Definition at line 632 of file recurrencerule.cpp.

void RecurrenceRule::setWeekStart ( short  weekStart  ) 

Definition at line 710 of file recurrencerule.cpp.

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

Return the start of the recurrence.

Definition at line 132 of file recurrencerule.h.

short KCal::RecurrenceRule::weekStart (  )  const [inline]

Definition at line 231 of file recurrencerule.h.


Member Data Documentation


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