• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • KCal
  • Todo
Public Types | Public Member Functions | Protected Member Functions | List of all members
KCal::Todo Class Reference

#include <todo.h>

Inheritance diagram for KCal::Todo:
KCal::Incidence KCal::IncidenceBase KCal::CustomProperties

Public Types

typedef boost::shared_ptr< const Todo > ConstPtr
typedef ListBase< Todo > List
typedef boost::shared_ptr< Todo > Ptr
Public Types inherited from KCal::Incidence
typedef boost::shared_ptr< const Incidence > ConstPtr
typedef ListBase< Incidence > List
typedef boost::shared_ptr< Incidence > Ptr
enum  Secrecy { SecrecyPublic =0 , SecrecyPrivate =1 , SecrecyConfidential =2 }
enum  Status {
  StatusNone , StatusTentative , StatusConfirmed , StatusCompleted ,
  StatusNeedsAction , StatusCanceled , StatusInProcess , StatusDraft ,
  StatusFinal , StatusX
}

Public Member Functions

 Todo ()
 Todo (const Todo &other)
 ~Todo ()
Todo * clone ()
KDateTime completed () const
QString completedStr (bool shortfmt=false) const
KDateTime dtDue (bool first=false) const
KCAL_DEPRECATED QString dtDueDateStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
KCAL_DEPRECATED QString dtDueStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
KCAL_DEPRECATED QString dtDueTimeStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
KDateTime dtRecurrence () const
virtual KDateTime dtStart () const
KDateTime dtStart (bool first) const
KCAL_DEPRECATED QString dtStartDateStr (bool shortfmt, bool first, const KDateTime::Spec &spec=KDateTime::Spec()) const
virtual KCAL_DEPRECATED QString dtStartDateStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
KCAL_DEPRECATED QString dtStartStr (bool shortfmt, bool first, const KDateTime::Spec &spec=KDateTime::Spec()) const
virtual KCAL_DEPRECATED QString dtStartStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
KCAL_DEPRECATED QString dtStartTimeStr (bool shortfmt, bool first, const KDateTime::Spec &spec=KDateTime::Spec()) const
virtual KCAL_DEPRECATED QString dtStartTimeStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
bool hasCompletedDate () const
bool hasDueDate () const
bool hasStartDate () const
bool isCompleted () const
bool isInProgress (bool first) const
bool isNotStarted (bool first) const
bool isOpenEnded () const
bool isOverdue () const
Todo & operator= (const Todo &other)
bool operator== (const Todo &todo) const
int percentComplete () const
virtual bool recursOn (const QDate &date, const KDateTime::Spec &timeSpec) const
void setCompleted (bool completed)
void setCompleted (const KDateTime &completeDate)
void setDtDue (const KDateTime &dtDue, bool first=false)
void setDtRecurrence (const KDateTime &dt)
void setDtStart (const KDateTime &dtStart)
void setHasDueDate (bool hasDueDate)
void setHasStartDate (bool hasStartDate)
void setPercentComplete (int percent)
virtual void shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
QByteArray type () const
Public Member Functions inherited from KCal::Incidence
 Incidence ()
 Incidence (const Incidence &other)
 ~Incidence ()
void addAlarm (Alarm *alarm)
void addAttachment (Attachment *attachment)
void addRelation (Incidence *incidence)
const Alarm::List & alarms () const
Attachment::List attachments () const
Attachment::List attachments (const QString &mime) const
QStringList categories () const
QString categoriesStr () const
void clearAlarms ()
void clearAttachments ()
void clearRecurrence ()
void clearTempFiles ()
KDateTime created () const
void deleteAttachment (Attachment *attachment)
void deleteAttachments (const QString &mime)
QString description () const
bool descriptionIsRich () const
virtual KDateTime dtEnd () const
virtual KDateTime endDateForStart (const KDateTime &startDt) const
float & geoLatitude () const
float & geoLongitude () const
bool hasGeo () const
bool isAlarmEnabled () const
QString location () const
bool locationIsRich () const
Alarm * newAlarm ()
Incidence & operator= (const Incidence &other)
bool operator== (const Incidence &incidence) const
int priority () const
void recreate ()
Recurrence * recurrence () const
ushort recurrenceType () const
virtual void recurrenceUpdated (Recurrence *recurrence)
bool recurs () const
bool recursAt (const KDateTime &dt) const
Incidence * relatedTo () const
QString relatedToUid () const
Incidence::List relations () const
void removeAlarm (Alarm *alarm)
void removeRelation (Incidence *incidence)
QStringList resources () const
int revision () const
QString richDescription () const
QString richLocation () const
QString richSummary () const
QString schedulingID () const
Secrecy secrecy () const
QString secrecyStr () const
void setAllDay (bool allDay)
void setCategories (const QString &catStr)
void setCategories (const QStringList &categories)
void setCreated (const KDateTime &dt)
void setCustomStatus (const QString &status)
void setDescription (const QString &description)
void setDescription (const QString &description, bool isRich)
void setGeoLatitude (float geolatitude)
void setGeoLongitude (float geolongitude)
void setHasGeo (bool hasGeo)
void setLocation (const QString &location)
void setLocation (const QString &location, bool isRich)
void setPriority (int priority)
void setReadOnly (bool readonly)
void setRelatedTo (Incidence *incidence)
void setRelatedToUid (const QString &uid)
void setResources (const QStringList &resources)
void setRevision (int rev)
void setSchedulingID (const QString &sid)
void setSecrecy (Secrecy secrecy)
void setStatus (Status status)
void setSummary (const QString &summary)
void setSummary (const QString &summary, bool isRich)
virtual QList< KDateTime > startDateTimesForDate (const QDate &date, const KDateTime::Spec &timeSpec=KDateTime::LocalZone) const
virtual QList< KDateTime > startDateTimesForDateTime (const KDateTime &datetime) const
Status status () const
QString statusStr () const
QString summary () const
bool summaryIsRich () const
QString writeAttachmentToTempFile (Attachment *attachment) const
Public Member Functions inherited from KCal::IncidenceBase
 IncidenceBase ()
 IncidenceBase (const IncidenceBase &ib)
virtual ~IncidenceBase ()
void addAttendee (Attendee *attendee, bool doUpdate=true)
void addComment (const QString &comment)
bool allDay () const
Attendee * attendeeByMail (const QString &email) const
Attendee * attendeeByMails (const QStringList &emails, const QString &email=QString()) const
Attendee * attendeeByUid (const QString &uid) const
int attendeeCount () const
const Attendee::List & attendees () const
void clearAttendees ()
void clearComments ()
QStringList comments () const
Duration duration () const
void endUpdates ()
bool hasDuration () const
bool isReadOnly () const
KDateTime lastModified () const
IncidenceBase & operator= (const IncidenceBase &other)
bool operator== (const IncidenceBase &ib) const
Person organizer () const
void registerObserver (IncidenceObserver *observer)
bool removeComment (const QString &comment)
void setAllDay (bool allDay)
virtual void setDuration (const Duration &duration)
void setHasDuration (bool hasDuration)
void setLastModified (const KDateTime &lm)
void setOrganizer (const Person &organizer)
void setOrganizer (const QString &organizer)
void setUid (const QString &uid)
void startUpdates ()
QString uid () const
void unRegisterObserver (IncidenceObserver *observer)
void updated ()
KUrl uri () const
Public Member Functions inherited from KCal::CustomProperties
 CustomProperties ()
 CustomProperties (const CustomProperties &other)
virtual ~CustomProperties ()
QMap< QByteArray, QString > customProperties () const
QString customProperty (const QByteArray &app, const QByteArray &key) const
QString nonKDECustomProperty (const QByteArray &name) const
CustomProperties & operator= (const CustomProperties &other)
bool operator== (const CustomProperties &properties) const
void removeCustomProperty (const QByteArray &app, const QByteArray &key)
void removeNonKDECustomProperty (const QByteArray &name)
void setCustomProperties (const QMap< QByteArray, QString > &properties)
void setCustomProperty (const QByteArray &app, const QByteArray &key, const QString &value)
void setNonKDECustomProperty (const QByteArray &name, const QString &value)

Protected Member Functions

virtual KDateTime endDateRecurrenceBase () const
Protected Member Functions inherited from KCal::IncidenceBase
virtual void customPropertyUpdated ()

Additional Inherited Members

Static Public Member Functions inherited from KCal::Incidence
static QStringList secrecyList ()
static QString secrecyName (Secrecy secrecy)
static QString statusName (Status status)
Static Public Member Functions inherited from KCal::CustomProperties
static QByteArray customPropertyName (const QByteArray &app, const QByteArray &key)
Protected Attributes inherited from KCal::IncidenceBase
bool mReadOnly

Detailed Description

Provides a To-do in the sense of RFC2445.

Definition at line 44 of file todo.h.

Member Typedef Documentation

◆ ConstPtr

typedef boost::shared_ptr<const Todo> KCal::Todo::ConstPtr

A shared pointer to a non-mutable Todo object.

Definition at line 60 of file todo.h.

◆ List

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

List of to-dos.

Definition at line 50 of file todo.h.

◆ Ptr

typedef boost::shared_ptr<Todo> KCal::Todo::Ptr

A shared pointer to a Todo object.

Definition at line 55 of file todo.h.

Constructor & Destructor Documentation

◆ Todo() [1/2]

KCal::Todo::Todo ( )

Constructs an empty to-do.

◆ Todo() [2/2]

KCal::Todo::Todo ( const Todo & other)

Copy constructor.

Parameters
otheris the to-do to copy.

◆ ~Todo()

KCal::Todo::~Todo ( )

Destroys a to-do.

Member Function Documentation

◆ clone()

Todo * KCal::Todo::clone ( )
virtual

IncidenceBase::typeStr() Returns an exact copy of this todo. The returned object is owned by the caller.

Implements KCal::Incidence.

◆ completed()

KDateTime Todo::completed ( ) const

Returns date and time when todo was completed.

Definition at line 432 of file todo.cpp.

◆ completedStr()

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
shortfmtIf set, use short date format; else use long format.

Definition at line 441 of file todo.cpp.

◆ dtDue()

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

Returns due date and time.

Parameters
firstIf 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 181 of file todo.cpp.

◆ dtDueDateStr()

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
shortfmtIf set, use short date format; else use long format.
specIf set, return the date in the given spec, else use the todo's current spec.
Deprecated
use IncidenceFormatter::dateToString()

Definition at line 210 of file todo.cpp.

◆ dtDueStr()

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
shortfmtIf set, use short date format; else use long format.
specIf set, return the date/time in the given spec, else use the todo's current spec.
Deprecated
use IncidenceFormatter::dateTimeToString()

Definition at line 229 of file todo.cpp.

◆ dtDueTimeStr()

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
shortfmtIf set, use short date format; else use long format.
specIf set, return the time in the given spec, else use the todo's current spec.
Deprecated
use IncidenceFormatter::timeToString()

Definition at line 193 of file todo.cpp.

◆ dtRecurrence()

KDateTime Todo::dtRecurrence ( ) const

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

Definition at line 557 of file todo.cpp.

◆ dtStart() [1/2]

KDateTime Todo::dtStart ( ) const
virtual

IncidenceBase::dtStart()

Reimplemented from KCal::IncidenceBase.

Definition at line 289 of file todo.cpp.

◆ dtStart() [2/2]

KDateTime Todo::dtStart ( bool first) const

Returns the start date of the todo.

Parameters
firstIf true, the start date of the todo will be returned; also, 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 294 of file todo.cpp.

◆ dtStartDateStr() [1/2]

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
shortfmtIf set, use short date format; else use long format.
firstIf true, the start date of the todo will be returned; also, 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().
specIf set, returns the date in the given spec, else use the todo's current spec.
Deprecated
use IncidenceFormatter::dateToString()

Definition at line 341 of file todo.cpp.

◆ dtStartDateStr() [2/2]

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

IncidenceBase::dtStartDateStr()

Reimplemented from KCal::IncidenceBase.

Definition at line 360 of file todo.cpp.

◆ dtStartStr() [1/2]

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
shortfmtIf set, use short date format; else use long format.
firstIf true, the start date of the todo will be returned; also, 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().
specIf set, returns the date and time in the given spec, else use the todo's current spec.
Deprecated
use IncidenceFormatter::dateTimeToString()

Definition at line 365 of file todo.cpp.

◆ dtStartStr() [2/2]

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

IncidenceBase::dtStartStr()

Reimplemented from KCal::IncidenceBase.

Definition at line 388 of file todo.cpp.

◆ dtStartTimeStr() [1/2]

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
shortfmtIf set, use short date format; else use long format.
firstIf true, the start date of the todo will be returned; also, 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().
specIf set, returns the time in the given spec, else use the todo's current spec.
Deprecated
use IncidenceFormatter::timeToString()

Definition at line 319 of file todo.cpp.

◆ dtStartTimeStr() [2/2]

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

IncidenceBase::dtStartTimeStr()

Reimplemented from KCal::IncidenceBase.

Definition at line 336 of file todo.cpp.

◆ endDateRecurrenceBase()

KDateTime Todo::endDateRecurrenceBase ( ) const
protectedvirtual

Returns the end date/time of the base incidence.

Reimplemented from KCal::Incidence.

Definition at line 583 of file todo.cpp.

◆ hasCompletedDate()

bool Todo::hasCompletedDate ( ) const

Returns true, if the to-do has a date associated with completion, otherwise return false.

Definition at line 458 of file todo.cpp.

◆ hasDueDate()

bool Todo::hasDueDate ( ) const

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

Definition at line 252 of file todo.cpp.

◆ hasStartDate()

bool Todo::hasStartDate ( ) const

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

Definition at line 266 of file todo.cpp.

◆ isCompleted()

bool Todo::isCompleted ( ) const

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

See also
isOverdue, isInProgress(), isOpenEnded(), isNotStarted(bool), setCompleted(), percentComplete()

Definition at line 411 of file todo.cpp.

◆ isInProgress()

bool Todo::isInProgress ( bool first) const

Returns true, if the to-do is in-progress (started, or >0% completed); otherwise return false.

If the to-do is overdue, then it is not considered to be in-progress.

Parameters
firstIf true, the start and due dates of the todo will be used; also, if the todo recurs, the start date and due date of the first occurrence will be used. If false and the todo recurs, the relative start and due dates will be used, based on the date returned by dtRecurrence().
See also
isOverdue(), isCompleted(), isOpenEnded(), isNotStarted(bool)
Since
4.4

Definition at line 478 of file todo.cpp.

◆ isNotStarted()

bool Todo::isNotStarted ( bool first) const

Returns true, if the to-do has yet to be started (no start date and 0% completed); otherwise return false.

Parameters
firstIf true, the start date of the todo will be used; also, if the todo recurs, the start date of the first occurrence will be used. If false and the todo recurs, the relative start date will be used, based on the date returned by dtRecurrence().
See also
isOverdue(), isCompleted(), isInProgress(), isOpenEnded()
Since
4.4

Definition at line 514 of file todo.cpp.

◆ isOpenEnded()

bool Todo::isOpenEnded ( ) const

Returns true, if the to-do is open-ended (no due date); false otherwise.

See also
isOverdue(), isCompleted(), isInProgress(), isNotStarted(bool)
Since
4.4

Definition at line 505 of file todo.cpp.

◆ isOverdue()

bool Todo::isOverdue ( ) const

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

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

See also
isCompleted(), isInProgress(), isOpenEnded(), isNotStarted(bool)

Definition at line 571 of file todo.cpp.

◆ operator=()

Todo & KCal::Todo::operator= ( const Todo & other)

Assignment operator.

Parameters
otheris the to-do to assign.

◆ operator==()

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

Compare this with todo for equality.

Parameters
todois the to-do to compare.

◆ percentComplete()

int Todo::percentComplete ( ) const

Returns what percentage of the to-do is completed.

Returns a value between 0 and 100.

Definition at line 463 of file todo.cpp.

◆ recursOn()

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
dateis the date to check.
timeSpecis the

Reimplemented from KCal::Incidence.

Definition at line 562 of file todo.cpp.

◆ setCompleted() [1/2]

void Todo::setCompleted ( bool completed)

Sets completed state.

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

Definition at line 420 of file todo.cpp.

◆ setCompleted() [2/2]

void Todo::setCompleted ( const KDateTime & completeDate)

Sets date and time of completion.

Parameters
completeDateis the to-do completion date.

Definition at line 448 of file todo.cpp.

◆ setDtDue()

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

Sets due date and time.

Parameters
dtDueThe due date/time.
firstIf 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.

◆ setDtRecurrence()

void Todo::setDtRecurrence ( const KDateTime & dt)

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

Parameters
dtis the

Definition at line 552 of file todo.cpp.

◆ setDtStart()

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

Sets the start date of the todo.

Parameters
dtStartis the to-do start date.

Reimplemented from KCal::Incidence.

Definition at line 308 of file todo.cpp.

◆ setHasDueDate()

void Todo::setHasDueDate ( bool hasDueDate)

Sets if the todo has a due date.

Parameters
hasDueDatetrue if todo has a due date, otherwise false

Definition at line 257 of file todo.cpp.

◆ setHasStartDate()

void Todo::setHasStartDate ( bool hasStartDate)

Sets if the todo has a start date.

Parameters
hasStartDatetrue if todo has a start date, otherwise false

Definition at line 271 of file todo.cpp.

◆ setPercentComplete()

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
percentis the completion percentage, which as integer value between 0 and 100, inclusive.
See also
isCompleted(), setCompleted()

Definition at line 468 of file todo.cpp.

◆ shiftTimes()

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

IncidenceBase::shiftTimes()

Reimplemented from KCal::Incidence.

Definition at line 536 of file todo.cpp.

◆ type()

QByteArray KCal::Todo::type ( ) const
virtual

IncidenceBase::type()

Implements KCal::IncidenceBase.


The documentation for this class was generated from the following files:
  • todo.h
  • todo.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Thu Jul 24 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal