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 
26 namespace KCal {
27 
31 class 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 the base class common to all calendar components.
Definition: incidence.h:48
This class provides a Todo in the sense of RFC2445.
Definition: todo.h:32
virtual TQDateTime endDateRecurrenceBase() const
Return the end date/time of the base incidence.
Definition: todo.h:222
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38