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

KCalCore Library

  • kcalcore
todo.h
Go to the documentation of this file.
1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2009 Allen Winter <winter@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
30
31#ifndef KCALCORE_TODO_H
32#define KCALCORE_TODO_H
33
34#include "kcalcore_export.h"
35#include "incidence.h"
36#include "supertrait.h"
37
38namespace KCalCore {
39
44class KCALCORE_EXPORT Todo : public Incidence
45{
46public:
50 typedef QSharedPointer<Todo> Ptr;
51
55 typedef QVector<Ptr> List;
56
60 Todo();
61
66 Todo(const Todo &other);
67
74 Todo(const Incidence &other);
75
79 ~Todo();
80
84 IncidenceType type() const;
85
89 QByteArray typeStr() const;
90
95 Todo *clone() const;
96
106 void setDtDue(const KDateTime &dtDue, bool first = false);
107
117 KDateTime dtDue(bool first = false) const;
118
123 bool hasDueDate() const;
124
130 KCALCORE_DEPRECATED void setHasDueDate(bool hasDueDate);
131
136 bool hasStartDate() const;
137
143 KCALCORE_DEPRECATED void setHasStartDate(bool hasStartDate);
144
148 virtual KDateTime dtStart() const;
149
160 KDateTime dtStart(bool first) const;
161 //TODO_KDE5: Remove (see IncidenceBase)
166 void setDtStart(const KDateTime &dtStart);
167
175 bool isCompleted() const;
176
185 void setCompleted(bool completed);
186
192 int percentComplete() const;
193
203 void setPercentComplete(int percent);
204
211 KDateTime completed() const;
212
219 void setCompleted(const KDateTime &completeDate);
220
227 bool hasCompletedDate() const;
228
241 bool isInProgress(bool first) const;
242
247 bool isOpenEnded() const;
248
260 bool isNotStarted(bool first) const;
261
265 virtual void shiftTimes(const KDateTime::Spec &oldSpec,
266 const KDateTime::Spec &newSpec);
267
271 void setAllDay(bool allDay);
272
278 void setDtRecurrence(const KDateTime &dt);
279
283 KDateTime dtRecurrence() const;
284
294 virtual bool recursOn(const QDate &date,
295 const KDateTime::Spec &timeSpec) const;
296
302 bool isOverdue() const;
303
307 KDateTime dateTime(DateTimeRole role) const;
308
312 void setDateTime(const KDateTime &dateTime, DateTimeRole role);
313
317 QLatin1String mimeType() const;
318
322 QLatin1String iconName(const KDateTime &recurrenceId = KDateTime()) const;
323
327 static QLatin1String todoMimeType();
328
329protected:
334 virtual bool equals(const IncidenceBase &todo) const;
335
339 virtual IncidenceBase &assign(const IncidenceBase &other);
340
344 virtual void virtual_hook(int id, void *data);
345
346private:
350 bool accept(Visitor &v, IncidenceBase::Ptr incidence);
351
358 Todo &operator=(const Todo &other);
359
360 // For polymorfic serialization
361 void serialize(QDataStream &out);
362 void deserialize(QDataStream &in);
363
364 //@cond PRIVATE
365 class Private;
366 Private *const d;
367 //@endcond
368};
369
370} // namespace KCalCore
371
372//@cond PRIVATE
373Q_DECLARE_TYPEINFO(KCalCore::Todo::Ptr, Q_MOVABLE_TYPE);
374Q_DECLARE_METATYPE(KCalCore::Todo::Ptr)
375
376namespace KPIMUtils {
377// super class trait specialization
378template <> struct SuperClass<KCalCore::Todo> : public SuperClassTrait<KCalCore::Incidence> {};
379}
380//@endcond
381
382#endif
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes.
Definition incidencebase.h:110
KCalCore::IncidenceBase::allDay
bool allDay() const
Returns true or false depending on whether the incidence is all-day.
Definition incidencebase.cpp:326
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition incidencebase.h:121
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition incidencebase.h:115
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition incidencebase.h:133
KCalCore::Incidence::recurrenceId
KDateTime recurrenceId() const
Returns the incidence recurrenceId.
Definition incidence.cpp:1039
KCalCore::Incidence::Incidence
Incidence()
Constructs an empty incidence.
Definition incidence.cpp:182
KCalCore::Todo::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition todo.cpp:577
KCalCore::Todo::setPercentComplete
void setPercentComplete(int percent)
Sets what percentage of the to-do is completed.
Definition todo.cpp:331
KCalCore::Todo::Todo
Todo()
Constructs an empty to-do.
KCalCore::Todo::dtDue
KDateTime dtDue(bool first=false) const
Returns the todo due datetime.
Definition todo.cpp:180
KCalCore::Todo::hasDueDate
bool hasDueDate() const
Returns if the todo has a due datetime.
Definition todo.cpp:203
KCalCore::Todo::setDateTime
void setDateTime(const KDateTime &dateTime, DateTimeRole role)
Sets the date/time corresponding to the specified DateTimeRole.
Definition todo.cpp:563
KCalCore::Todo::List
QVector< Ptr > List
List of to-dos.
Definition todo.h:55
KCalCore::Todo::setDtStart
void setDtStart(const KDateTime &dtStart)
Sets the start datetime of the todo.
Definition todo.cpp:278
KCalCore::Todo::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Shift the times of the incidence so that they appear at the same clock time as before but in a new ti...
Definition todo.cpp:406
KCalCore::Todo::isCompleted
bool isCompleted() const
Returns if the todo is 100% completed.
Definition todo.cpp:283
KCalCore::Todo::dtRecurrence
KDateTime dtRecurrence() const
Returns the due date/time of the current occurrence if recurrent.
Definition todo.cpp:428
KCalCore::Todo::isNotStarted
bool isNotStarted(bool first) const
Returns true, if the to-do has yet to be started (no start date and 0% completed); otherwise return f...
Definition todo.cpp:384
KCalCore::Todo::type
IncidenceType type() const
Returns the incidence type.
KCalCore::Todo::clone
Todo * clone() const
Returns an exact copy of this todo.
KCalCore::Todo::Ptr
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
Definition todo.h:50
KCalCore::Todo::todoMimeType
static QLatin1String todoMimeType()
Returns the Akonadi specific sub MIME type of a KCalCore::Todo.
Definition todo.cpp:596
KCalCore::Todo::hasStartDate
bool hasStartDate() const
Returns if the todo has a start datetime.
Definition todo.cpp:227
KCalCore::Todo::setCompleted
void setCompleted(bool completed)
Sets completed state.
Definition todo.cpp:288
KCalCore::Todo::iconName
QLatin1String iconName(const KDateTime &recurrenceId=KDateTime()) const
Returns the name of the icon that best represents this incidence.
Definition todo.cpp:601
KCalCore::Todo::isOverdue
bool isOverdue() const
Returns true if this todo is overdue (e.g.
Definition todo.cpp:442
KCalCore::Todo::dateTime
KDateTime dateTime(DateTimeRole role) const
Returns a date/time corresponding to the specified DateTimeRole.
Definition todo.cpp:514
KCalCore::Todo::isOpenEnded
bool isOpenEnded() const
Returns true, if the to-do is open-ended (no due date); false otherwise.
Definition todo.cpp:375
KCalCore::Todo::setAllDay
void setAllDay(bool allDay)
Sets whether the incidence is all-day, i.e.
Definition todo.cpp:454
KCalCore::Todo::assign
virtual IncidenceBase & assign(const IncidenceBase &other)
Provides polymorfic assignment.
KCalCore::Todo::dtStart
virtual KDateTime dtStart() const
Returns an incidence's starting date/time as a KDateTime.
Definition todo.cpp:260
KCalCore::Todo::isInProgress
bool isInProgress(bool first) const
Returns true, if the to-do is in-progress (started, or >0% completed); otherwise return false.
Definition todo.cpp:348
KCalCore::Todo::Todo
Todo(const Incidence &other)
Costructs a todo out of an incidence This constructs allows to make it easy to create a todo from an ...
KCalCore::Todo::equals
virtual bool equals(const IncidenceBase &todo) const
Compare this with todo for equality.
KCalCore::Todo::setDtRecurrence
void setDtRecurrence(const KDateTime &dt)
Sets the due date/time of the current occurrence if recurrent.
Definition todo.cpp:422
KCalCore::Todo::~Todo
~Todo()
Destroys a to-do.
KCalCore::Todo::setHasStartDate
KCALCORE_DEPRECATED void setHasStartDate(bool hasStartDate)
Sets if the todo has a start datetime.
Definition todo.cpp:232
KCalCore::Todo::typeStr
QByteArray typeStr() const
Prints the type of incidence as a string.
KCalCore::Todo::setDtDue
void setDtDue(const KDateTime &dtDue, bool first=false)
Sets due date and time.
KCalCore::Todo::percentComplete
int percentComplete() const
Returns what percentage of the to-do is completed.
Definition todo.cpp:326
KCalCore::Todo::mimeType
QLatin1String mimeType() const
Returns the Akonadi specific sub MIME type of a KCalCore::IncidenceBase item, e.g.
Definition todo.cpp:591
KCalCore::Todo::hasCompletedDate
bool hasCompletedDate() const
Returns if the to-do has a completion datetime.
Definition todo.cpp:321
KCalCore::Todo::setHasDueDate
KCALCORE_DEPRECATED void setHasDueDate(bool hasDueDate)
Sets if the todo has a due datetime.
Definition todo.cpp:208
KCalCore::Todo::Todo
Todo(const Todo &other)
Copy constructor.
KCalCore::Todo::recursOn
virtual bool recursOn(const QDate &date, const KDateTime::Spec &timeSpec) const
Returns true if the date specified is one on which the to-do will recur.
Definition todo.cpp:433
KCalCore::Todo::completed
KDateTime completed() const
Returns the to-do was completion datetime.
Definition todo.cpp:301
KCalCore::Visitor
This class provides the interface for a visitor of calendar components.
Definition visitor.h:44
incidence.h
This file is part of the API for handling calendar data and defines the Incidence class.
KCalCore
TODO: KDE5:
Definition alarm.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 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-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