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

KCal Library

  • kcal
todo.h
Go to the documentation of this file.
1/*
2 This file is part of the kcal 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 KCAL_TODO_H
32#define KCAL_TODO_H
33
34#include "incidence.h"
35#include <kpimutils/supertrait.h>
36#include <QtCore/QByteArray>
37
38namespace KCal {
39
44class KCAL_DEPRECATED_EXPORT Todo : public Incidence
45{
46 public:
50 typedef ListBase<Todo> List;
51
55 typedef boost::shared_ptr<Todo> Ptr;
56
60 typedef boost::shared_ptr<const Todo> ConstPtr;
61
65 Todo();
66
71 Todo( const Todo &other );
72
76 ~Todo();
77
82 QByteArray type() const;
83
88 //KDE5: QString typeStr() const;
89
94 Todo *clone();
95
105 void setDtDue( const KDateTime &dtDue, bool first = false );
106
115 KDateTime dtDue( bool first = false ) const;
116
127 KCAL_DEPRECATED QString dtDueTimeStr(
128 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
129
140 KCAL_DEPRECATED QString dtDueDateStr(
141 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
142
153 KCAL_DEPRECATED QString dtDueStr(
154 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
155
159 bool hasDueDate() const;
160
166 void setHasDueDate( bool hasDueDate );
167
171 bool hasStartDate() const;
172
178 void setHasStartDate( bool hasStartDate );
179
184 virtual KDateTime dtStart() const;
185
194 KDateTime dtStart( bool first ) const;
195
201 void setDtStart( const KDateTime &dtStart );
202
218 KCAL_DEPRECATED QString dtStartTimeStr(
219 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
220
225 virtual KCAL_DEPRECATED QString dtStartTimeStr(
226 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
227
243 KCAL_DEPRECATED QString dtStartDateStr(
244 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
245
250 virtual KCAL_DEPRECATED QString dtStartDateStr(
251 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
252
268 KCAL_DEPRECATED QString dtStartStr(
269 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
270
275 virtual KCAL_DEPRECATED QString dtStartStr(
276 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
277
283 bool isCompleted() const;
284
293 void setCompleted( bool completed );
294
299 int percentComplete() const;
300
310 void setPercentComplete( int percent );
311
315 KDateTime completed() const;
316
323 QString completedStr( bool shortfmt = false ) const;
324
330 void setCompleted( const KDateTime &completeDate );
331
336 bool hasCompletedDate() const;
337
351 bool isInProgress( bool first ) const;
352
358 bool isOpenEnded() const;
359
372 bool isNotStarted( bool first ) const;
373
378 virtual void shiftTimes( const KDateTime::Spec &oldSpec,
379 const KDateTime::Spec &newSpec );
380
386 void setDtRecurrence( const KDateTime &dt );
387
391 KDateTime dtRecurrence() const;
392
402 virtual bool recursOn( const QDate &date,
403 const KDateTime::Spec &timeSpec ) const;
404
410 bool isOverdue() const;
411
416 Todo &operator=( const Todo &other );
417
422 bool operator==( const Todo &todo ) const;
423
424 protected:
428 virtual KDateTime endDateRecurrenceBase() const;
429
430 private:
435 bool accept( Visitor &v ) { return v.visit( this ); }
436
437 //@cond PRIVATE
438 class Private;
439 Private *const d;
440 //@endcond
441};
442
443}
444
445//@cond PRIVATE
446// super class trait specialization
447namespace KPIMUtils {
448 template <> struct SuperClass<KCal::Todo> : public SuperClassTrait<KCal::Incidence>{};
449}
450//@endcond
451
452#endif
KCal::IncidenceBase::Visitor
This class provides the interface for a visitor of calendar components.
Definition incidencebase.h:113
KCal::IncidenceBase::Visitor::visit
virtual bool visit(Event *event)
Reimplement this function in your concrete subclass of IncidenceBase::Visitor to perform actions on a...
Definition incidencebase.cpp:513
KCal::Incidence::Incidence
Incidence()
Constructs an empty incidence.
Definition incidence.cpp:141
KCal::ListBase
This class provides a template for lists of pointers.
Definition listbase.h:45
KCal::Todo::setPercentComplete
void setPercentComplete(int percent)
Sets what percentage of the to-do is completed.
Definition todo.cpp:468
KCal::Todo::~Todo
~Todo()
Destroys a to-do.
KCal::Todo::dtStartTimeStr
KCAL_DEPRECATED QString 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.
Definition todo.cpp:319
KCal::Todo::dtDue
KDateTime dtDue(bool first=false) const
Returns due date and time.
Definition todo.cpp:181
KCal::Todo::hasDueDate
bool hasDueDate() const
Returns true if the todo has a due date, otherwise return false.
Definition todo.cpp:252
KCal::Todo::setDtDue
void setDtDue(const KDateTime &dtDue, bool first=false)
Sets due date and time.
KCal::Todo::endDateRecurrenceBase
virtual KDateTime endDateRecurrenceBase() const
Returns the end date/time of the base incidence.
Definition todo.cpp:583
KCal::Todo::setDtStart
void setDtStart(const KDateTime &dtStart)
Sets the start date of the todo.
Definition todo.cpp:308
KCal::Todo::operator=
Todo & operator=(const Todo &other)
Assignment operator.
KCal::Todo::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Definition todo.cpp:536
KCal::Todo::isCompleted
bool isCompleted() const
Returns true if the todo is 100% completed, otherwise return false.
Definition todo.cpp:411
KCal::Todo::dtRecurrence
KDateTime dtRecurrence() const
Returns the due date/time of the current occurrence if recurrent.
Definition todo.cpp:557
KCal::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:514
KCal::Todo::completedStr
QString completedStr(bool shortfmt=false) const
Returns string contaiting date and time when the todo was completed formatted according to the user's...
Definition todo.cpp:441
KCal::Todo::dtDueDateStr
KCAL_DEPRECATED QString dtDueDateStr(bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
Returns due date as string formatted according to the user's locale settings.
Definition todo.cpp:210
KCal::Todo::hasStartDate
bool hasStartDate() const
Returns true if the todo has a start date, otherwise return false.
Definition todo.cpp:266
KCal::Todo::setCompleted
void setCompleted(bool completed)
Sets completed state.
Definition todo.cpp:420
KCal::Todo::isOverdue
bool isOverdue() const
Returns true if this todo is overdue (e.g.
Definition todo.cpp:571
KCal::Todo::ConstPtr
boost::shared_ptr< const Todo > ConstPtr
A shared pointer to a non-mutable Todo object.
Definition todo.h:60
KCal::Todo::isOpenEnded
bool isOpenEnded() const
Returns true, if the to-do is open-ended (no due date); false otherwise.
Definition todo.cpp:505
KCal::Todo::dtStartStr
KCAL_DEPRECATED QString 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...
Definition todo.cpp:365
KCal::Todo::dtDueStr
KCAL_DEPRECATED QString 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.
Definition todo.cpp:229
KCal::Todo::dtStart
virtual KDateTime dtStart() const
Definition todo.cpp:289
KCal::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:478
KCal::Todo::dtDueTimeStr
KCAL_DEPRECATED QString dtDueTimeStr(bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const
Returns due time as string formatted according to the user's locale settings.
Definition todo.cpp:193
KCal::Todo::operator==
bool operator==(const Todo &todo) const
Compare this with todo for equality.
KCal::Todo::Todo
Todo()
Constructs an empty to-do.
KCal::Todo::dtStartDateStr
KCAL_DEPRECATED QString 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.
Definition todo.cpp:341
KCal::Todo::setDtRecurrence
void setDtRecurrence(const KDateTime &dt)
Sets the due date/time of the current occurrence if recurrent.
Definition todo.cpp:552
KCal::Todo::setHasStartDate
void setHasStartDate(bool hasStartDate)
Sets if the todo has a start date.
Definition todo.cpp:271
KCal::Todo::Todo
Todo(const Todo &other)
Copy constructor.
KCal::Todo::List
ListBase< Todo > List
List of to-dos.
Definition todo.h:50
KCal::Todo::percentComplete
int percentComplete() const
Returns what percentage of the to-do is completed.
Definition todo.cpp:463
KCal::Todo::type
QByteArray type() const
KCal::Todo::hasCompletedDate
bool hasCompletedDate() const
Returns true, if the to-do has a date associated with completion, otherwise return false.
Definition todo.cpp:458
KCal::Todo::Ptr
boost::shared_ptr< Todo > Ptr
A shared pointer to a Todo object.
Definition todo.h:55
KCal::Todo::setHasDueDate
void setHasDueDate(bool hasDueDate)
Sets if the todo has a due date.
Definition todo.cpp:257
KCal::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:562
KCal::Todo::completed
KDateTime completed() const
Returns date and time when todo was completed.
Definition todo.cpp:432
KCal::Todo::clone
Todo * clone()
incidence.h
This file is part of the API for handling calendar data and defines the Incidence class.
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.

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