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

KCalCore Library

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

#include <todo.h>

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

Public Types

typedef QVector< Ptr > List
 
typedef QSharedPointer< Todo > Ptr
 
- Public Types inherited from KCalCore::Incidence
typedef QVector< Ptr > List
 
typedef QSharedPointer< Incidence > Ptr
 
enum  RelType { RelTypeParent, RelTypeChild, RelTypeSibling }
 
enum  Secrecy { SecrecyPublic, SecrecyPrivate, SecrecyConfidential }
 
enum  Status {
  StatusNone, StatusTentative, StatusConfirmed, StatusCompleted,
  StatusNeedsAction, StatusCanceled, StatusInProcess, StatusDraft,
  StatusFinal, StatusX
}
 
- Public Types inherited from KCalCore::IncidenceBase
enum  DateTimeRole {
  RoleAlarmStartOffset = 0, RoleAlarmEndOffset, RoleSort, RoleCalendarHashing,
  RoleStartTimeZone, RoleEndTimeZone, RoleEndRecurrenceBase, RoleEnd,
  RoleDisplayEnd, RoleAlarm, RoleRecurrenceStart, RoleDisplayStart,
  RoleDnD
}
 
enum  Field {
  FieldDtStart, FieldDtEnd, FieldLastModified, FieldDescription,
  FieldSummary, FieldLocation, FieldCompleted, FieldPercentComplete,
  FieldDtDue, FieldCategories, FieldRelatedTo, FieldRecurrence,
  FieldAttachment, FieldSecrecy, FieldStatus, FieldTransparency,
  FieldResources, FieldPriority, FieldGeoLatitude, FieldGeoLongitude,
  FieldRecurrenceId, FieldAlarms, FieldSchedulingId, FieldAttendees,
  FieldOrganizer, FieldCreated, FieldRevision, FieldDuration,
  FieldContact, FieldComment, FieldUid, FieldUnknown,
  FieldUrl
}
 
enum  IncidenceType {
  TypeEvent = 0, TypeTodo, TypeJournal, TypeFreeBusy,
  TypeUnknown
}
 
typedef QSharedPointer
< IncidenceBase > 
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)
 
KCALCORE_DEPRECATED void setHasDueDate (bool hasDueDate)
 
KCALCORE_DEPRECATED 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
 
- Public Member Functions inherited from KCalCore::Incidence
 Incidence ()
 
virtual ~Incidence ()
 
void addAlarm (const Alarm::Ptr &alarm)
 
void addAttachment (const Attachment::Ptr &attachment)
 
Alarm::List alarms () const
 
QString altDescription () 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
 
QString customStatus () const
 
void deleteAttachment (const Attachment::Ptr &attachment)
 
void deleteAttachments (const QString &mime)
 
QString description () const
 
bool descriptionIsRich () const
 
virtual KDateTime endDateForStart (const KDateTime &startDt) const
 
float geoLatitude () const
 
float geoLongitude () const
 
bool hasAltDescription () const
 
bool hasEnabledAlarms () const
 
bool hasGeo () const
 
bool hasRecurrenceId () const
 
QString instanceIdentifier () const
 
bool localOnly () const
 
QString location () const
 
bool locationIsRich () const
 
Alarm::Ptr newAlarm ()
 
int priority () const
 
void recreate ()
 
Recurrence * recurrence () const
 
KDateTime recurrenceId () const
 
ushort recurrenceType () const
 
virtual void recurrenceUpdated (Recurrence *recurrence)
 
bool recurs () const
 
bool recursAt (const KDateTime &dt) const
 
QString relatedTo (RelType relType=RelTypeParent) const
 
void removeAlarm (const Alarm::Ptr &alarm)
 
QStringList resources () const
 
int revision () const
 
QString richDescription () const
 
QString richLocation () const
 
QString richSummary () const
 
QString schedulingID () const
 
Secrecy secrecy () const
 
void setAllDay (bool allDay)
 
void setAltDescription (const QString &altdescription)
 
void setCategories (const QStringList &categories)
 
void setCategories (const QString &catStr)
 
void setCreated (const KDateTime &dt)
 
void setCustomStatus (const QString &status)
 
void setDescription (const QString &description, bool isRich)
 
void setDescription (const QString &description)
 
void setGeoLatitude (float geolatitude)
 
void setGeoLongitude (float geolongitude)
 
void setHasGeo (bool hasGeo)
 
void setLastModified (const KDateTime &lm)
 
void setLocalOnly (bool localonly)
 
void setLocation (const QString &location, bool isRich)
 
void setLocation (const QString &location)
 
void setPriority (int priority)
 
void setReadOnly (bool readonly)
 
void setRecurrenceId (const KDateTime &recurrenceId)
 
void setRelatedTo (const QString &uid, RelType relType=RelTypeParent)
 
void setResources (const QStringList &resources)
 
void setRevision (int rev)
 
void setSchedulingID (const QString &sid, const QString &uid=QString())
 
void setSecrecy (Secrecy secrecy)
 
void setStatus (Status status)
 
void setSummary (const QString &summary, bool isRich)
 
void setSummary (const QString &summary)
 
void setThisAndFuture (bool thisAndFuture)
 
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 summary () const
 
bool summaryIsRich () const
 
bool supportsGroupwareCommunication () const
 
bool thisAndFuture () const
 
QString writeAttachmentToTempFile (const Attachment::Ptr &attachment) const
 
- Public Member Functions inherited from KCalCore::IncidenceBase
 IncidenceBase ()
 
virtual ~IncidenceBase ()
 
void addAttendee (const Attendee::Ptr &attendee, bool doUpdate=true)
 
void addComment (const QString &comment)
 
void addContact (const QString &contact)
 
bool allDay () const
 
Attendee::Ptr attendeeByMail (const QString &email) const
 
Attendee::Ptr attendeeByMails (const QStringList &emails, const QString &email=QString()) const
 
Attendee::Ptr attendeeByUid (const QString &uid) const
 
int attendeeCount () const
 
Attendee::List attendees () const
 
void clearAttendees ()
 
void clearComments ()
 
void clearContacts ()
 
QStringList comments () const
 
QStringList contacts () const
 
void deleteAttendee (const Attendee::Ptr &attendee, bool doUpdate=true)
 
QSet< IncidenceBase::Field > dirtyFields () const
 
Duration duration () const
 
void endUpdates ()
 
bool hasDuration () const
 
bool isReadOnly () const
 
KDateTime lastModified () const
 
bool operator!= (const IncidenceBase &ib) const
 
IncidenceBase & operator= (const IncidenceBase &other)
 
bool operator== (const IncidenceBase &ib) const
 
Person::Ptr organizer () const
 
void registerObserver (IncidenceObserver *observer)
 
bool removeComment (const QString &comment)
 
bool removeContact (const QString &contact)
 
void resetDirtyFields ()
 
void setAllDay (bool allDay)
 
void setDirtyFields (const QSet< IncidenceBase::Field > &)
 
virtual void setDuration (const Duration &duration)
 
void setHasDuration (bool hasDuration)
 
void setOrganizer (const Person::Ptr &organizer)
 
void setOrganizer (const QString &organizer)
 
void setUid (const QString &uid)
 
void setUrl (const QUrl &url)
 
void startUpdates ()
 
QString uid () const
 
void unRegisterObserver (IncidenceObserver *observer)
 
void update ()
 
void updated ()
 
KUrl uri () const
 
QUrl url () const
 
- Public Member Functions inherited from KCalCore::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
 
QString nonKDECustomPropertyParameters (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, const QString &parameters=QString())
 

Static Public Member Functions

static QLatin1String todoMimeType ()
 
- Static Public Member Functions inherited from KCalCore::Incidence
static QStringList mimeTypes ()
 
- Static Public Member Functions inherited from KCalCore::IncidenceBase
static quint32 magicSerializationIdentifier ()
 
- Static Public Member Functions inherited from KCalCore::CustomProperties
static QByteArray customPropertyName (const QByteArray &app, const QByteArray &key)
 

Protected Member Functions

virtual IncidenceBase & assign (const IncidenceBase &other)
 
virtual bool equals (const IncidenceBase &todo) const
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KCalCore::Incidence
 Incidence (const Incidence &other)
 
void deserialize (QDataStream &in)
 
void serialize (QDataStream &out)
 
- Protected Member Functions inherited from KCalCore::IncidenceBase
 IncidenceBase (const IncidenceBase &ib)
 
virtual void customPropertyUpdate ()
 
virtual void customPropertyUpdated ()
 
void setFieldDirty (IncidenceBase::Field field)
 

Additional Inherited Members

- Protected Types inherited from KCalCore::IncidenceBase
enum  VirtualHook { SerializerHook, DeserializerHook }
 
- Protected Attributes inherited from KCalCore::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

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

List of to-dos.

Definition at line 55 of file todo.h.

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

A shared pointer to a Todo object.

Definition at line 50 of file todo.h.

Constructor & Destructor Documentation

KCalCore::Todo::Todo ( )

Constructs an empty to-do.

KCalCore::Todo::Todo ( const Todo &  other)

Copy constructor.

Parameters
otheris the to-do to copy.
KCalCore::Todo::~Todo ( )

Destroys a to-do.

Member Function Documentation

virtual IncidenceBase& KCalCore::Todo::assign ( const IncidenceBase &  other)
protectedvirtual

Provides polymorfic assignment.

Parameters
otheris the IncidenceBase to assign.

Reimplemented from KCalCore::Incidence.

Todo* KCalCore::Todo::clone ( ) const
virtual

Returns an exact copy of this todo.

The returned object is owned by the caller.

Returns
A pointer to a Todo containing an exact copy of this object.

Implements KCalCore::Incidence.

KDateTime Todo::completed ( ) const

Returns the to-do was completion datetime.

Returns
A KDateTime for the completeion datetime of the to-do.
See also
hasCompletedDate()

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

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

Returns the todo due datetime.

Parameters
firstIf true and the todo recurs, the due datetime of the first occurrence will be returned. If false and recurrent, the datetime of the current occurrence will be returned. If non-recurrent, the normal due datetime will be returned.
Returns
A KDateTime containing the todo due datetime.

Definition at line 174 of file todo.cpp.

KDateTime Todo::dtRecurrence ( ) const

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

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

KDateTime Todo::dtStart ( bool  first) const

Returns the start datetime of the todo.

Parameters
firstIf true, the start datetime of the todo will be returned; also, if the todo recurs, the start datetime of the first occurrence will be returned. If false and the todo recurs, the relative start datetime will be returned, based on the datetime returned by dtRecurrence().
Returns
A KDateTime for the start datetime of the todo.

Definition at line 259 of file todo.cpp.

virtual bool KCalCore::Todo::equals ( const IncidenceBase &  todo) const
protectedvirtual

Compare this with todo for equality.

Parameters
todois the to-do to compare.

Reimplemented from KCalCore::Incidence.

bool Todo::hasCompletedDate ( ) const

Returns if the to-do has a completion datetime.

Returns
true if the to-do has a date associated with completion; false otherwise.
See also
setCompleted(), completed()

Definition at line 315 of file todo.cpp.

bool Todo::hasDueDate ( ) const

Returns if the todo has a due datetime.

Returns
true if the todo has a due datetime; false otherwise.

Definition at line 197 of file todo.cpp.

bool Todo::hasStartDate ( ) const

Returns if the todo has a start datetime.

Returns
true if the todo has a start datetime; false otherwise.

Definition at line 221 of file todo.cpp.

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

Returns the name of the icon that best represents this incidence.

Parameters
recurrenceIdSome recurring incidences might use a different icon, for example, completed to-do occurrences. Use this parameter to identify the specific occurrence in a recurring serie.

Implements KCalCore::Incidence.

Definition at line 595 of file todo.cpp.

bool Todo::isCompleted ( ) const

Returns if the todo is 100% completed.

Returns
true if the todo is 100% completed; false otherwise.
See also
isOverdue, isInProgress(), isOpenEnded(), isNotStarted(bool), setCompleted(), percentComplete()

Definition at line 277 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 342 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 378 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 369 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 436 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 585 of file todo.cpp.

int Todo::percentComplete ( ) const

Returns what percentage of the to-do is completed.

Returns
The percentage complete of the to-do as an integer between 0 and 100, inclusive.
See also
setPercentComplete(), isCompleted()

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

void Todo::setAllDay ( bool  allDay)

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

void Todo::setCompleted ( const KDateTime &  completeDate)

Sets date and time of completion.

Parameters
completeDateis the to-do completion date.
See also
completed(), hasCompletedDate()

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

void KCalCore::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.
void Todo::setDtRecurrence ( const KDateTime &  dt)

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

Parameters
dtis the

Definition at line 416 of file todo.cpp.

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

Sets the start datetime of the todo.

Parameters
dtStartis the to-do start datetime.

Reimplemented from KCalCore::Incidence.

Definition at line 272 of file todo.cpp.

void Todo::setHasDueDate ( bool  hasDueDate)

Sets if the todo has a due datetime.

Parameters
hasDueDatetrue if todo has a due datetime, otherwise false
Deprecated:
Use setDtDue( KDateTime() )

Definition at line 202 of file todo.cpp.

void Todo::setHasStartDate ( bool  hasStartDate)

Sets if the todo has a start datetime.

Parameters
hasStartDatetrue if todo has a start datetime, otherwise false.
Deprecated:
Use setDtStart( KDateTime() )

Definition at line 226 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 325 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 400 of file todo.cpp.

QLatin1String Todo::todoMimeType ( )
static

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

Definition at line 590 of file todo.cpp.

IncidenceType KCalCore::Todo::type ( ) const
virtual

Returns the incidence type.

Implements KCalCore::IncidenceBase.

QByteArray KCalCore::Todo::typeStr ( ) const
virtual

Prints the type of incidence as a string.

Implements KCalCore::IncidenceBase.

void Todo::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

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. TODO_KDE5: change from int to VirtualHook type.

Implements KCalCore::IncidenceBase.

Definition at line 571 of file todo.cpp.


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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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