libkcal

KCal::Todo Class Reference

This class provides a Todo in the sense of RFC2445. More...

#include <todo.h>

Inheritance diagram for KCal::Todo:

List of all members.


Public Types

typedef ListBase< TodoList

Public Member Functions

Todoclone ()
QDateTime completed () const
QString completedStr () const
QDateTime dtDue (bool first=false) const
QString dtDueDateStr (bool shortfmt=true) const
QString dtDueStr () const
QString dtDueTimeStr () const
QDateTime dtRecurrence () const
QDateTime dtStart (bool first=false) const
QString dtStartDateStr (bool shortfmt=true, bool first=false) const
QString dtStartStr (bool first=false) const
QString dtStartTimeStr (bool first=false) const
bool hasCompletedDate () const
bool hasDueDate () const
bool hasStartDate () const
bool isCompleted () const
bool isOverdue () const
Todooperator= (const Todo &)
bool operator== (const Todo &) const
int percentComplete () const
virtual bool recursOn (const QDate &date) const
void setCompleted (const QDateTime &completed)
void setCompleted (bool completed)
void setDtDue (const QDateTime &dtDue, bool first=false)
void setDtRecurrence (const QDateTime &dt)
void setDtStart (const QDateTime &dtStart)
void setHasDueDate (bool hasDueDate)
void setHasStartDate (bool hasStartDate)
void setPercentComplete (int)
 Todo (const Todo &)
 Todo ()
QCString type () const
 ~Todo ()

Protected Member Functions

virtual QDateTime endDateRecurrenceBase () const

Detailed Description

This class provides a Todo in the sense of RFC2445.

Definition at line 31 of file todo.h.


Member Typedef Documentation

Reimplemented from KCal::Incidence.

Definition at line 34 of file todo.h.


Constructor & Destructor Documentation

Todo::Todo (  ) 

Definition at line 30 of file todo.cpp.

Todo::Todo ( const Todo t  ) 

Definition at line 39 of file todo.cpp.

Todo::~Todo (  ) 

Definition at line 50 of file todo.cpp.


Member Function Documentation

Todo * Todo::clone (  )  [virtual]

Returns an exact copy of this todo.

The returned object is owned by the caller.

Implements KCal::Incidence.

Definition at line 54 of file todo.cpp.

QDateTime Todo::completed (  )  const

Returns date and time when todo was completed.

Definition at line 225 of file todo.cpp.

QString Todo::completedStr (  )  const

Returns string contaiting date and time when the todo was completed formatted according to the users locale settings.

Definition at line 233 of file todo.cpp.

QDateTime Todo::dtDue ( bool  first = false  )  const

Returns due date and time.

Parameters:
first If true and the todo recurs, the due date of the first occurrence will be returned.If false and recurrent, the date of the current occurrence will be returned. If non-recurrent, the normal due date will be returned.

Definition at line 117 of file todo.cpp.

QString Todo::dtDueDateStr ( bool  shortfmt = true  )  const

Returns due date as string formatted according to the users locale settings.

Parameters:
shortfmt If set to true, use short date format, if set to false use long format.

Definition at line 130 of file todo.cpp.

QString Todo::dtDueStr (  )  const

Returns due date and time as string formatted according to the users locale settings.

Definition at line 136 of file todo.cpp.

QString Todo::dtDueTimeStr (  )  const

Returns due time as string formatted according to the users locale settings.

Definition at line 125 of file todo.cpp.

QDateTime Todo::dtRecurrence (  )  const

Returns the due date/time of the current occurrence if recurrent.

Definition at line 270 of file todo.cpp.

QDateTime Todo::dtStart ( bool  first = false  )  const

Returns the startdate of the todo.

Parameters:
first If true, the startdate of the todo will be returned. If the todo recurs, the startdate of the first occurrence will be returned. If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence().

Definition at line 174 of file todo.cpp.

QString Todo::dtStartDateStr ( bool  shortfmt = true,
bool  first = false 
) const

Returns an todo's starting date as a string formatted according to the users locale settings.

Parameters:
shortfmt If true, use short date format, if set to false use long format.
first If true, the startdate of the todo will be returned. If the todo recurs, the startdate of the first occurrence will be returned. If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence().

Definition at line 197 of file todo.cpp.

QString Todo::dtStartStr ( bool  first = false  )  const

Returns an todo's starting date and time as a string formatted according to the users locale settings.

Parameters:
first If true, the startdate of the todo will be returned. If the todo recurs, the startdate of the first occurrence will be returned. If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence().

Definition at line 202 of file todo.cpp.

QString Todo::dtStartTimeStr ( bool  first = false  )  const

Returns an todo's starting time as a string formatted according to the users locale settings.

Parameters:
first If true, the startdate of the todo will be returned. If the todo recurs, the startdate of the first occurrence will be returned. If false and the todo recurs, the relative startdate will be returned, based on the date returned by dtRecurrence().

Definition at line 192 of file todo.cpp.

virtual QDateTime KCal::Todo::endDateRecurrenceBase (  )  const [inline, protected, virtual]

Return the end date/time of the base incidence.

Reimplemented from KCal::Incidence.

Definition at line 217 of file todo.h.

bool Todo::hasCompletedDate (  )  const

Returns true, if todo has a date associated with completion, otherwise return false.

Definition at line 248 of file todo.cpp.

bool Todo::hasDueDate (  )  const

Returns true if the todo has a due date, otherwise return false.

Definition at line 141 of file todo.cpp.

bool Todo::hasStartDate (  )  const

Returns true if the todo has a start date, otherwise return false.

Definition at line 154 of file todo.cpp.

bool Todo::isCompleted (  )  const

Returns true if the todo is 100% completed, otherwise return false.

Definition at line 207 of file todo.cpp.

bool Todo::isOverdue (  )  const

Returns true if this todo is overdue (e.g.

due date is lower than today and not completed), else false.

Definition at line 313 of file todo.cpp.

Todo & Todo::operator= ( const Todo t  ) 

Definition at line 60 of file todo.cpp.

bool Todo::operator== ( const Todo t2  )  const

Definition at line 73 of file todo.cpp.

int Todo::percentComplete (  )  const

Returns how many percent of the task are completed.

Returns a value between 0 and 100.

Definition at line 253 of file todo.cpp.

bool Todo::recursOn ( const QDate date  )  const [virtual]

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

Todo's are a special case, hence the overload. It adds an extra check, which make it return false if there's an occurrence between the recurstart and today.

Reimplemented from KCal::Incidence.

Definition at line 275 of file todo.cpp.

void Todo::setCompleted ( const QDateTime completed  ) 

Set date and time of completion.

Definition at line 238 of file todo.cpp.

void Todo::setCompleted ( bool  completed  ) 

Set completed state.

Parameters:
completed If true set completed state to 100%, if false set completed state to 0%.

Definition at line 213 of file todo.cpp.

void Todo::setDtDue ( const QDateTime dtDue,
bool  first = false 
)

Sets due date and time.

Parameters:
dtDue The due date/time.
first Set the date of the first occurrence (if the todo is recurrent).

Definition at line 85 of file todo.cpp.

void Todo::setDtRecurrence ( const QDateTime dt  ) 

Sets the due date/time of the current occurrence if recurrent.

Definition at line 265 of file todo.cpp.

void Todo::setDtStart ( const QDateTime dtStart  )  [virtual]

Sets the startdate of the todo.

Reimplemented from KCal::Incidence.

Definition at line 182 of file todo.cpp.

void Todo::setHasDueDate ( bool  hasDueDate  ) 

Set if the todo has a due date.

Parameters:
hasDueDate true if todo has a due date, otherwise false

Definition at line 146 of file todo.cpp.

void Todo::setHasStartDate ( bool  hasStartDate  ) 

Set if the todo has a start date.

Parameters:
hasStartDate true if todo has a start date, otherwise false

Definition at line 159 of file todo.cpp.

void Todo::setPercentComplete ( int  v  ) 

Set how many percent of the task are completed.

Valid values are in the range from 0 to 100.

Definition at line 258 of file todo.cpp.

QCString KCal::Todo::type (  )  const [inline, virtual]

Implements KCal::IncidenceBase.

Definition at line 42 of file todo.h.


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