• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KCalCore Library

  • KCalCore
  • Todo
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
KCalCore::Todo Class Reference

#include <todo.h>

Inheritance diagram for KCalCore::Todo:
Inheritance graph
[legend]

List of all members.

Public Types

typedef QVector< Ptr > List
typedef QSharedPointer< Todo > Ptr

Public Member Functions

 Todo ()
 Todo (const Todo &other)
 ~Todo ()
Todo * clone () const
KDateTime completed () const
KDateTime dateTime (DateTimeRole role) const
KDateTime dtDue (bool first=false) const
KDateTime dtRecurrence () const
virtual KDateTime dtStart () const
KDateTime dtStart (bool first) const
bool hasCompletedDate () const
bool hasDueDate () const
bool hasStartDate () const
QLatin1String iconName (const KDateTime &recurrenceId=KDateTime()) const
bool isCompleted () const
bool isInProgress (bool first) const
bool isNotStarted (bool first) const
bool isOpenEnded () const
bool isOverdue () const
QLatin1String mimeType () const
int percentComplete () const
virtual bool recursOn (const QDate &date, const KDateTime::Spec &timeSpec) const
void setAllDay (bool allDay)
void setCompleted (bool completed)
void setCompleted (const KDateTime &completeDate)
void setDateTime (const KDateTime &dateTime, DateTimeRole role)
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)
IncidenceType type () const
QByteArray typeStr () const

Static Public Member Functions

static QLatin1String todoMimeType ()

Protected Member Functions

virtual IncidenceBase & assign (const IncidenceBase &other)
virtual bool equals (const IncidenceBase &todo) const
virtual void virtual_hook (int id, void *data)

Detailed Description

Provides a To-do in the sense of RFC2445.

Definition at line 44 of file todo.h.


Member Typedef Documentation

typedef QVector<Ptr> KCalCore::Todo::List

List of to-dos.

Reimplemented from KCalCore::Incidence.

Definition at line 55 of file todo.h.

typedef QSharedPointer<Todo> KCalCore::Todo::Ptr

A shared pointer to a Todo object.

Reimplemented from KCalCore::Incidence.

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

Todo::Todo ( const Todo &  other)

Copy constructor.

Parameters:
otheris the to-do to copy.

Definition at line 91 of file todo.cpp.

Todo::~Todo ( )

Destroys a to-do.

Definition at line 97 of file todo.cpp.


Member Function Documentation

IncidenceBase & Todo::assign ( const IncidenceBase &  other) [protected, virtual]

Provides polymorfic assignment.

Parameters:
otheris the IncidenceBase to assign.

Reimplemented from KCalCore::Incidence.

Definition at line 107 of file todo.cpp.

Todo * Todo::clone ( ) const [virtual]

Returns an exact copy of this todo.

The returned object is owned by the caller.

Implements KCalCore::Incidence.

Definition at line 102 of file todo.cpp.

KDateTime Todo::completed ( ) const

Returns date and time when todo was completed.

Definition at line 283 of file todo.cpp.

KDateTime Todo::dateTime ( DateTimeRole  role) const [virtual]

Returns a date/time corresponding to the specified DateTimeRole.

Parameters:
roleis a DateTimeRole.

Implements KCalCore::IncidenceBase.

Definition at line 497 of file todo.cpp.

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

KDateTime Todo::dtRecurrence ( ) const

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

Definition at line 411 of file todo.cpp.

KDateTime Todo::dtStart ( ) const [virtual]

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

See also:
setDtStart().

Reimplemented from KCalCore::IncidenceBase.

Definition at line 232 of file todo.cpp.

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

bool Todo::equals ( const IncidenceBase &  todo) const [protected, virtual]

Compare this with todo for equality.

Parameters:
todois the to-do to compare.

Reimplemented from KCalCore::Incidence.

Definition at line 117 of file todo.cpp.

bool Todo::hasCompletedDate ( ) const

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

Definition at line 304 of file todo.cpp.

bool Todo::hasDueDate ( ) const

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

Definition at line 191 of file todo.cpp.

bool Todo::hasStartDate ( ) const

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

Definition at line 207 of file todo.cpp.

QLatin1String Todo::iconName ( const KDateTime &  recurrenceId = KDateTime()) const [virtual]

Implements KCalCore::Incidence.

Definition at line 566 of file todo.cpp.

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

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)

Definition at line 331 of file todo.cpp.

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()

Definition at line 367 of file todo.cpp.

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)

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

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

Definition at line 425 of file todo.cpp.

QLatin1String Todo::mimeType ( ) const [virtual]

Returns the Akonadi specific sub MIME type of a KCalCore::IncidenceBase item, e.g.

getting "application/x-vnd.akonadi.calendar.event" for a KCalCore::Event.

Implements KCalCore::IncidenceBase.

Definition at line 556 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 309 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:
dateis the date to check.
timeSpecis the

Reimplemented from KCalCore::Incidence.

Definition at line 416 of file todo.cpp.

void Todo::setAllDay ( bool  allDay)

Sets whether the incidence is all-day, i.e.

has a date but no time attached to it.

Parameters:
allDaysets whether the incidence is all-day.
See also:
allDay()
.

Reimplemented from KCalCore::Incidence.

Definition at line 437 of file todo.cpp.

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

void Todo::setCompleted ( const KDateTime &  completeDate)

Sets date and time of completion.

Parameters:
completeDateis the to-do completion date.

Definition at line 292 of file todo.cpp.

void Todo::setDateTime ( const KDateTime &  dateTime,
DateTimeRole  role 
) [virtual]

Sets the date/time corresponding to the specified DateTimeRole.

Parameters:
dateTimeis KDateTime value to set.
roleis a DateTimeRole.

Implements KCalCore::IncidenceBase.

Definition at line 543 of file todo.cpp.

void 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.

Definition at line 144 of file todo.cpp.

void Todo::setDtRecurrence ( const KDateTime &  dt)

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

Parameters:
dtis the

Definition at line 405 of file todo.cpp.

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

Sets the start date of the todo.

Parameters:
dtStartis the to-do start date.

Reimplemented from KCalCore::Incidence.

Definition at line 251 of file todo.cpp.

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

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

Definition at line 314 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:
oldSpecthe time specification which provides the clock times
newSpecthe new time specification

Reimplemented from KCalCore::Incidence.

Definition at line 389 of file todo.cpp.

QLatin1String Todo::todoMimeType ( ) [static]

Returns the Akonadi specific sub MIME type of a KCalCore::Todo.

Definition at line 561 of file todo.cpp.

Incidence::IncidenceType Todo::type ( ) const [virtual]

Returns the incidence type.

Implements KCalCore::IncidenceBase.

Definition at line 135 of file todo.cpp.

QByteArray Todo::typeStr ( ) const [virtual]

Prints the type of incidence as a string.

Implements KCalCore::IncidenceBase.

Definition at line 140 of file todo.cpp.

void Todo::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Standard trick to add virtuals later.

Parameters:
idis any integer unique to this class which we will use to identify the method to be called.
datais a pointer to some glob of data, typically a struct.

Implements KCalCore::IncidenceBase.

Definition at line 549 of file todo.cpp.


The documentation for this class was generated from the following files:
  • todo.h
  • todo.cpp

KCalCore Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.6.1
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