summaryrefslogtreecommitdiffabout
path: root/libkcal/todo.h
Unidiff
Diffstat (limited to 'libkcal/todo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 41f5841..137b252 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -1,122 +1,134 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef TODO_H 20#ifndef TODO_H
21#define TODO_H 21#define TODO_H
22// 22//
23// Todo component, representing a VTODO object 23// Todo component, representing a VTODO object
24// 24//
25 25
26#include "incidence.h" 26#include "incidence.h"
27 27
28namespace KCal { 28namespace KCal {
29 29
30/** 30/**
31 This class provides a Todo in the sense of RFC2445. 31 This class provides a Todo in the sense of RFC2445.
32*/ 32*/
33class Todo : public Incidence 33class Todo : public Incidence
34{ 34{
35 public: 35 public:
36 Todo(); 36 Todo();
37 Todo(const Todo &); 37 Todo(const Todo &);
38 ~Todo(); 38 ~Todo();
39 typedef ListBase<Todo> List; 39 typedef ListBase<Todo> List;
40 QCString type() const { return "Todo"; } 40 QCString type() const { return "Todo"; }
41 41
42 /** Return an exact copy of this todo. */ 42 /** Return an exact copy of this todo. */
43 Incidence *clone(); 43 Incidence *clone();
44 QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; 44 QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const;
45 45
46 /** for setting the todo's due date/time with a QDateTime. */ 46 /** for setting the todo's due date/time with a QDateTime. */
47 void setDtDue(const QDateTime &dtDue); 47 void setDtDue(const QDateTime &dtDue);
48 /** returns an event's Due date/time as a QDateTime. */ 48 /** returns an event's Due date/time as a QDateTime. */
49 QDateTime dtDue() const; 49 QDateTime dtDue() const;
50 /** returns an event's due time as a string formatted according to the 50 /** returns an event's due time as a string formatted according to the
51 users locale settings */ 51 users locale settings */
52 QString dtDueTimeStr() const; 52 QString dtDueTimeStr() const;
53 /** returns an event's due date as a string formatted according to the 53 /** returns an event's due date as a string formatted according to the
54 users locale settings */ 54 users locale settings */
55 QString dtDueDateStr(bool shortfmt=true) const; 55 QString dtDueDateStr(bool shortfmt=true) const;
56 /** returns an event's due date and time as a string formatted according 56 /** returns an event's due date and time as a string formatted according
57 to the users locale settings */ 57 to the users locale settings */
58 QString dtDueStr(bool shortfmt=true) const; 58 QString dtDueStr(bool shortfmt=true) const;
59 59
60 /** returns TRUE or FALSE depending on whether the todo has a due date */ 60 /** returns TRUE or FALSE depending on whether the todo has a due date */
61 bool hasDueDate() const; 61 bool hasDueDate() const;
62 /** sets the event's hasDueDate value. */ 62 /** sets the event's hasDueDate value. */
63 void setHasDueDate(bool f); 63 void setHasDueDate(bool f);
64 64
65 /*
66 Looks for a subtodo (including itself ) which is not complete and is
67 - overdue, or
68 - due today.
69 It returns 0 for nothing found,
70 1 for found a todo which is due today and no overdue found
71 2 for found a overdue todo
72 */
73 int hasDueSubTodo( bool checkSubtodos = true );
74 /* same as above, but a specific date can be specified*/
75 int hasDueSubTodoForDate( const QDate & date, bool checkSubtodos );
76
65 77
66 /** sets the event's status to the string specified. The string 78 /** sets the event's status to the string specified. The string
67 * must be a recognized value for the status field, i.e. a string 79 * must be a recognized value for the status field, i.e. a string
68 * equivalent of the possible status enumerations previously described. */ 80 * equivalent of the possible status enumerations previously described. */
69// void setStatus(const QString &statStr); 81// void setStatus(const QString &statStr);
70 /** sets the event's status to the value specified. See the enumeration 82 /** sets the event's status to the value specified. See the enumeration
71 * above for possible values. */ 83 * above for possible values. */
72// void setStatus(int); 84// void setStatus(int);
73 /** return the event's status. */ 85 /** return the event's status. */
74// int status() const; 86// int status() const;
75 /** return the event's status in string format. */ 87 /** return the event's status in string format. */
76// QString statusStr() const; 88// QString statusStr() const;
77 89
78 /** return, if this todo is completed */ 90 /** return, if this todo is completed */
79 bool isCompleted() const; 91 bool isCompleted() const;
80 /** set completed state of this todo */ 92 /** set completed state of this todo */
81 void setCompleted(bool); 93 void setCompleted(bool);
82 94
83 /** 95 /**
84 Return how many percent of the task are completed. Returns a value 96 Return how many percent of the task are completed. Returns a value
85 between 0 and 100. 97 between 0 and 100.
86 */ 98 */
87 int percentComplete() const; 99 int percentComplete() const;
88 /** 100 /**
89 Set how many percent of the task are completed. Valid values are in the 101 Set how many percent of the task are completed. Valid values are in the
90 range from 0 to 100. 102 range from 0 to 100.
91 */ 103 */
92 void setPercentComplete(int); 104 void setPercentComplete(int);
93 105
94 /** return date and time when todo was completed */ 106 /** return date and time when todo was completed */
95 QDateTime completed() const; 107 QDateTime completed() const;
96 QString completedStr(bool shortF = true) const; 108 QString completedStr(bool shortF = true) const;
97 /** set date and time of completion */ 109 /** set date and time of completion */
98 void setCompleted(const QDateTime &completed); 110 void setCompleted(const QDateTime &completed);
99 111
100 /** Return true, if todo has a date associated with completion */ 112 /** Return true, if todo has a date associated with completion */
101 bool hasCompletedDate() const; 113 bool hasCompletedDate() const;
102 bool contains ( Todo*); 114 bool contains ( Todo*);
103 115
104 private: 116 private:
105 bool accept(Visitor &v) { return v.visit(this); } 117 bool accept(Visitor &v) { return v.visit(this); }
106 118
107 QDateTime mDtDue; // due date of todo 119 QDateTime mDtDue; // due date of todo
108 120
109 bool mHasDueDate; // if todo has associated due date 121 bool mHasDueDate; // if todo has associated due date
110 122
111// int mStatus; // confirmed/delegated/tentative/etc 123// int mStatus; // confirmed/delegated/tentative/etc
112 124
113 QDateTime mCompleted; 125 QDateTime mCompleted;
114 bool mHasCompletedDate; 126 bool mHasCompletedDate;
115 127
116 int mPercentComplete; 128 int mPercentComplete;
117}; 129};
118 130
119 bool operator==( const Todo&, const Todo& ); 131 bool operator==( const Todo&, const Todo& );
120} 132}
121 133
122#endif 134#endif