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

KCal Library

KCal::Todo

KCal::Todo Class Reference

#include <todo.h>

Inheritance diagram for KCal::Todo:

Inheritance graph
[legend]

List of all members.


Detailed Description

Provides a To-do in the sense of RFC2445.

Definition at line 41 of file todo.h.


Public Types

typedef ListBase< Todo > List

Public Member Functions

 Todo ()
 Todo (const Todo &other)
 ~Todo ()
QByteArray type () const
Todo * clone ()
void setDtDue (const KDateTime &dtDue, bool first=false)
KDateTime dtDue (bool first=false) const
QString dtDueTimeStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
QString dtDueDateStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
QString dtDueStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
bool hasDueDate () const
void setHasDueDate (bool hasDueDate)
bool hasStartDate () const
void setHasStartDate (bool hasStartDate)
virtual KDateTime dtStart () const
KDateTime dtStart (bool first) const
void setDtStart (const KDateTime &dtStart)
QString dtStartTimeStr (bool shortfmt, bool first, const KDateTime::Spec &spec=KDateTime::Spec()) const
virtual QString dtStartTimeStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
QString dtStartDateStr (bool shortfmt, bool first, const KDateTime::Spec &spec=KDateTime::Spec()) const
virtual QString dtStartDateStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
QString dtStartStr (bool shortfmt, bool first, const KDateTime::Spec &spec=KDateTime::Spec()) const
virtual QString dtStartStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
bool isCompleted () const
void setCompleted (bool completed)
int percentComplete () const
void setPercentComplete (int percent)
KDateTime completed () const
QString completedStr (bool shortfmt=false) const
void setCompleted (const KDateTime &completeDate)
bool hasCompletedDate () const
virtual void shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
void setDtRecurrence (const KDateTime &dt)
KDateTime dtRecurrence () const
virtual bool recursOn (const QDate &date, const KDateTime::Spec &timeSpec) const
bool isOverdue () const
bool operator== (const Todo &todo) const

Protected Member Functions

virtual KDateTime endDateRecurrenceBase () const

Member Typedef Documentation

typedef ListBase<Todo> KCal::Todo::List

List of to-dos.

Reimplemented from KCal::Incidence.

Definition at line 47 of file todo.h.


Constructor & Destructor Documentation

Todo::Todo (  ) 

Constructs an empty to-do.

Private class that helps to provide binary compatibility between releases.

Definition at line 81 of file todo.cpp.

Todo::Todo ( const Todo &  other  ) 

Copy constructor.

Parameters:
other is the to-do to copy.

Definition at line 86 of file todo.cpp.

Todo::~Todo (  ) 

Destroys a to-do.

Definition at line 91 of file todo.cpp.


Member Function Documentation

QByteArray Todo::type (  )  const [virtual]

Prints the type of Incidence as a string.

Implements KCal::IncidenceBase.

Definition at line 113 of file todo.cpp.

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 96 of file todo.cpp.

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

Sets due date and time.

Parameters:
dtDue The due date/time.
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 118 of file todo.cpp.

KDateTime 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 151 of file todo.cpp.

QString Todo::dtDueTimeStr ( bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const

Returns due time as string formatted according to the user's locale settings.

Parameters:
shortfmt If set, use short date format; else use long format.
spec If set, return the time in the given spec, else use the todo's current spec.

Definition at line 160 of file todo.cpp.

QString Todo::dtDueDateStr ( bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const

Returns due date as string formatted according to the user's locale settings.

Parameters:
shortfmt If set, use short date format; else use long format.
spec If set, return the date in the given spec, else use the todo's current spec.

Definition at line 176 of file todo.cpp.

QString Todo::dtDueStr ( bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const

Returns due date and time as string formatted according to the user's locale settings.

Parameters:
shortfmt If set, use short date format; else use long format.
spec If set, return the date/time in the given spec, else use the todo's current spec.

Definition at line 196 of file todo.cpp.

bool Todo::hasDueDate (  )  const

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

Definition at line 216 of file todo.cpp.

void Todo::setHasDueDate ( bool  hasDueDate  ) 

Sets if the todo has a due date.

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

Definition at line 221 of file todo.cpp.

bool Todo::hasStartDate (  )  const

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

Definition at line 230 of file todo.cpp.

void Todo::setHasStartDate ( bool  hasStartDate  ) 

Sets if the todo has a start date.

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

Definition at line 235 of file todo.cpp.

KDateTime Todo::dtStart (  )  const [virtual]

Returns an incidence's starting date/time as a KDateTime.

See also:
setDtStart().

Reimplemented from KCal::IncidenceBase.

Definition at line 253 of file todo.cpp.

KDateTime Todo::dtStart ( bool  first  )  const

Returns the start date of the todo.

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

Definition at line 258 of file todo.cpp.

void Todo::setDtStart ( const KDateTime &  dtStart  )  [virtual]

Sets the start date of the todo.

Parameters:
dtStart is the to-do start date.

Reimplemented from KCal::Incidence.

Definition at line 267 of file todo.cpp.

QString Todo::dtStartTimeStr ( bool  shortfmt,
bool  first,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const

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

Parameters:
shortfmt If set, use short date format; else use long format.
first If true, the start date of the todo will be returned. If the todo recurs, the start date of the first occurrence will be returned. If false and the todo recurs, the relative start date will be returned, based on the date returned by dtRecurrence().
spec If set, returns the time in the given spec, else use the todo's current spec.

Definition at line 277 of file todo.cpp.

QString Todo::dtStartTimeStr ( bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const [virtual]

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

Parameters:
shortfmt If set to true, use short date format, if set to false use long format.
spec If set, return the time in the given spec, else use the incidence's current spec.

Reimplemented from KCal::IncidenceBase.

Definition at line 293 of file todo.cpp.

QString Todo::dtStartDateStr ( bool  shortfmt,
bool  first,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const

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

Parameters:
shortfmt If set, use short date format; else use long format.
first If true, the start date of the todo will be returned. If the todo recurs, the start date of the first occurrence will be returned. If false and the todo recurs, the relative start date will be returned, based on the date returned by dtRecurrence().
spec If set, returns the date in the given spec, else use the todo's current spec.

Definition at line 298 of file todo.cpp.

QString Todo::dtStartDateStr ( bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const [virtual]

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

Parameters:
shortfmt If set to true, use short date format, if set to false use long format.
spec If set, return the date in the given spec, else use the incidence's current spec.

Reimplemented from KCal::IncidenceBase.

Definition at line 318 of file todo.cpp.

QString Todo::dtStartStr ( bool  shortfmt,
bool  first,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const

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

Parameters:
shortfmt If set, use short date format; else use long format.
first If true, the start date of the todo will be returned. If the todo recurs, the start date of the first occurrence will be returned. If false and the todo recurs, the relative start date will be returned, based on the date returned by dtRecurrence().
spec If set, returns the date and time in the given spec, else use the todo's current spec.

Definition at line 323 of file todo.cpp.

QString Todo::dtStartStr ( bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
) const [virtual]

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

Parameters:
shortfmt If set to true, use short date format, if set to false use long format.
spec If set, return the date and time in the given spec, else use the incidence's current spec.

Reimplemented from KCal::IncidenceBase.

Definition at line 343 of file todo.cpp.

bool Todo::isCompleted (  )  const

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

See also:
setCompleted(), percentComplete()

Definition at line 348 of file todo.cpp.

void Todo::setCompleted ( bool  completed  ) 

Sets completed state.

Parameters:
completed If true set completed state to 100%, if false set completed state to 0%.
See also:
isCompleted(), percentComplete()

Definition at line 357 of file todo.cpp.

int Todo::percentComplete (  )  const

Returns what percentage of the to-do is completed.

Returns a value between 0 and 100.

Definition at line 400 of file todo.cpp.

void Todo::setPercentComplete ( int  percent  ) 

Sets what percentage of the to-do is completed.

Valid values are in the range from 0 to 100.

Parameters:
percent is the completion percentage, which as integer value between 0 and 100, inclusive.
See also:
isCompleted(), setCompleted()

Definition at line 405 of file todo.cpp.

KDateTime Todo::completed (  )  const

Returns date and time when todo was completed.

Definition at line 369 of file todo.cpp.

QString Todo::completedStr ( bool  shortfmt = false  )  const

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

Parameters:
shortfmt If set, use short date format; else use long format.

Definition at line 378 of file todo.cpp.

void Todo::setCompleted ( const KDateTime &  completeDate  ) 

Sets date and time of completion.

Parameters:
completeDate is the to-do completion date.

Definition at line 385 of file todo.cpp.

bool Todo::hasCompletedDate (  )  const

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

Definition at line 395 of file todo.cpp.

void Todo::shiftTimes ( const KDateTime::Spec &  oldSpec,
const KDateTime::Spec &  newSpec 
) [virtual]

Shift the times of the incidence 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 incidence time zone.

For example, shifting an incidence 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 incidence start) to 14:00 Paris time.

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

Reimplemented from KCal::Incidence.

Definition at line 415 of file todo.cpp.

void Todo::setDtRecurrence ( const KDateTime &  dt  ) 

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

Parameters:
dt is the

Definition at line 431 of file todo.cpp.

KDateTime Todo::dtRecurrence (  )  const

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

Definition at line 436 of file todo.cpp.

bool Todo::recursOn ( const QDate &  date,
const KDateTime::Spec &  timeSpec 
) const [virtual]

Returns true if the date specified is one on which the to-do will recur.

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

Parameters:
date is the date to check.
timeSpec is the

Reimplemented from KCal::Incidence.

Definition at line 441 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 450 of file todo.cpp.

bool Todo::operator== ( const Todo &  todo  )  const

Compare this with todo for equality.

Parameters:
todo is the to-do to compare.

Definition at line 101 of file todo.cpp.

KDateTime Todo::endDateRecurrenceBase (  )  const [protected, virtual]

Returns the end date/time of the base incidence.

Reimplemented from KCal::Incidence.

Definition at line 458 of file todo.cpp.


The documentation for this class was generated from the following files:
  • todo.h
  • todo.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"
  • 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.5
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