libkcal

todo.h
1/*
2 This file is part of libkcal.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21#ifndef KCAL_TODO_H
22#define KCAL_TODO_H
23
24#include "incidence.h"
25
26namespace KCal {
27
31class LIBKCAL_EXPORT Todo : public Incidence
32{
33 public:
34 typedef ListBase<Todo> List;
35
36 Todo();
37 Todo( const Todo & );
38 ~Todo();
39 Todo& operator=( const Todo& );
40 bool operator==( const Todo& ) const;
41
42 TQCString type() const { return "Todo"; }
43
48 Todo *clone();
49
56 void setDtDue(const TQDateTime &dtDue, bool first = false);
65 TQDateTime dtDue( bool first = false ) const;
71 TDE_DEPRECATED TQString dtDueTimeStr() const;
72
81 TDE_DEPRECATED TQString dtDueDateStr( bool shortfmt = true ) const;
82
88 TDE_DEPRECATED TQString dtDueStr() const;
89
93 bool hasDueDate() const;
99 void setHasDueDate( bool hasDueDate );
100
104 bool hasStartDate() const;
110 void setHasStartDate( bool hasStartDate );
111
119 TQDateTime dtStart( bool first = false ) const;
120
124 void setDtStart( const TQDateTime &dtStart );
125
133 TQString dtStartTimeStr( bool first = false ) const;
143 TQString dtStartDateStr( bool shortfmt = true, bool first = false ) const;
151 TQString dtStartStr( bool first = false ) const;
152
156 bool isCompleted() const;
163 void setCompleted( bool completed );
164
169 int percentComplete() const;
174 void setPercentComplete( int );
175
179 TQDateTime completed() const;
184 TQString completedStr() const;
188 void setCompleted( const TQDateTime &completed );
189
194 bool hasCompletedDate() const;
195
199 void setDtRecurrence( const TQDateTime &dt );
200
204 TQDateTime dtRecurrence() const;
205
212 virtual bool recursOn( const TQDate &date ) const;
213
218 bool isOverdue() const;
219
220 protected:
222 virtual TQDateTime endDateRecurrenceBase() const { return dtDue(); }
223
224 private:
225 bool accept(Visitor &v) { return v.visit( this ); }
226
234 bool recurTodo();
235
236 TQDateTime mDtDue; // due date of todo
237 // (first occurrence if recurrent)
238 TQDateTime mDtRecurrence; // due date of recurrence
239
240 bool mHasDueDate; // if todo has associated due date
241 bool mHasStartDate; // if todo has associated start date
242
243 TQDateTime mCompleted;
244 bool mHasCompletedDate;
245
246 int mPercentComplete;
247
248 class Private;
249 Private *d;
250};
251
252}
253
254#endif
This class provides a template for lists of pointers.
Definition listbase.h:34
virtual TQDateTime endDateRecurrenceBase() const
Return the end date/time of the base incidence.
Definition todo.h:222
TQDateTime dtRecurrence() const
Returns the due date/time of the current occurrence if recurrent.
Definition todo.cpp:284
bool hasDueDate() const
Returns true if the todo has a due date, otherwise return false.
Definition todo.cpp:144
TQString completedStr() const
Returns string contaiting date and time when the todo was completed formatted according to the users ...
Definition todo.cpp:243
TQString dtStartStr(bool first=false) const
Returns an todo's starting date and time as a string formatted according to the users locale settings...
Definition todo.cpp:212
bool isCompleted() const
Returns true if the todo is 100% completed, otherwise return false.
Definition todo.cpp:217
void setDtRecurrence(const TQDateTime &dt)
Sets the due date/time of the current occurrence if recurrent.
Definition todo.cpp:279
TDE_DEPRECATED TQString dtDueTimeStr() const
Returns due time as string formatted according to the users locale settings.
Definition todo.cpp:128
TDE_DEPRECATED TQString dtDueDateStr(bool shortfmt=true) const
Returns due date as string formatted according to the users locale settings.
Definition todo.cpp:133
bool hasStartDate() const
Returns true if the todo has a start date, otherwise return false.
Definition todo.cpp:157
Todo * clone()
Returns an exact copy of this todo.
Definition todo.cpp:54
void setDtDue(const TQDateTime &dtDue, bool first=false)
Sets due date and time.
Definition todo.cpp:85
void setCompleted(bool completed)
Set completed state.
Definition todo.cpp:223
bool isOverdue() const
Returns true if this todo is overdue (e.g.
Definition todo.cpp:328
TQDateTime dtStart(bool first=false) const
Returns the startdate of the todo.
Definition todo.cpp:177
TQDateTime completed() const
Returns date and time when todo was completed.
Definition todo.cpp:235
virtual bool recursOn(const TQDate &date) const
Returns true if the date specified is one on which the todo will recur.
Definition todo.cpp:289
TQString dtStartDateStr(bool shortfmt=true, bool first=false) const
Returns an todo's starting date as a string formatted according to the users locale settings.
Definition todo.cpp:207
void setHasStartDate(bool hasStartDate)
Set if the todo has a start date.
Definition todo.cpp:162
TDE_DEPRECATED TQString dtDueStr() const
Returns due date and time as string formatted according to the users locale settings.
Definition todo.cpp:139
void setDtStart(const TQDateTime &dtStart)
Sets the startdate of the todo.
Definition todo.cpp:192
int percentComplete() const
Returns how many percent of the task are completed.
Definition todo.cpp:263
bool hasCompletedDate() const
Returns true, if todo has a date associated with completion, otherwise return false.
Definition todo.cpp:258
TQString dtStartTimeStr(bool first=false) const
Returns an todo's starting time as a string formatted according to the users locale settings.
Definition todo.cpp:202
TQDateTime dtDue(bool first=false) const
Returns due date and time.
Definition todo.cpp:117
void setHasDueDate(bool hasDueDate)
Set if the todo has a due date.
Definition todo.cpp:149
void setPercentComplete(int)
Set how many percent of the task are completed.
Definition todo.cpp:268
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition alarm.h:38