summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/otodo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/otodo.h147
1 files changed, 76 insertions, 71 deletions
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h
index 61add04..04dd269 100644
--- a/libopie2/opiepim/otodo.h
+++ b/libopie2/opiepim/otodo.h
@@ -1,34 +1,40 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org> 3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7_;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11- . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of 16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more 19..}^=.= = ; Library General Public License for more
20++= -. .` .: details. 20++= -. .` .: details.
21 : = ...= . :.=- 21: = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU 22-. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29#ifndef OPIE_TODO_EVENT_H
30#define OPIE_TODO_EVENT_H
31 29
30#ifndef OTODOEVENT_H
31#define OTODOEVENT_H
32 32
33/* OPIE */
34#include <opie2/opimrecord.h>
35#include <qpe/recordfields.h>
36#include <qpe/palmtopuidgen.h>
37
38/* QT */
33#include <qarray.h> 39#include <qarray.h>
34#include <qmap.h> 40#include <qmap.h>
@@ -38,11 +44,6 @@
38#include <qvaluelist.h> 44#include <qvaluelist.h>
39 45
40#include <qpe/recordfields.h> 46namespace Opie
41#include <qpe/palmtopuidgen.h> 47{
42
43#include <opie2/opimrecord.h>
44
45
46namespace Opie {
47 48
48class OPimState; 49class OPimState;
@@ -50,6 +51,7 @@ class ORecur;
50class OPimMaintainer; 51class OPimMaintainer;
51class OPimNotifyManager; 52class OPimNotifyManager;
52class OTodo : public OPimRecord { 53class OTodo : public OPimRecord
53public: 54{
55 public:
54 typedef QValueList<OTodo> ValueList; 56 typedef QValueList<OTodo> ValueList;
55 enum RecordFields { 57 enum RecordFields {
@@ -75,7 +77,7 @@ public:
75 CompletedDate 77 CompletedDate
76 }; 78 };
77 public: 79 public:
78 // priorities from Very low to very high 80 // priorities from Very low to very high
79 enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow }; 81 enum TaskPriority { VeryHigh = 1, High, Normal, Low, VeryLow };
80 82
81 /* Constructs a new ToDoEvent 83 /* Constructs a new ToDoEvent
@@ -102,5 +104,5 @@ public:
102 const QString& description = QString::null, 104 const QString& description = QString::null,
103 ushort progress = 0, 105 ushort progress = 0,
104 bool hasDate = false, QDate date = QDate::currentDate(), 106 bool hasDate = false, QDate date = QDate::currentDate(),
105 int uid = 0 /* empty */ ); 107 int uid = 0 /* empty */ );
106 108
@@ -108,5 +110,5 @@ public:
108 * 110 *
109 */ 111 */
110 OTodo(const OTodo & ); 112 OTodo( const OTodo & );
111 113
112 /** 114 /**
@@ -124,11 +126,11 @@ public:
124 */ 126 */
125 bool hasDueDate() const; 127 bool hasDueDate() const;
126 bool hasStartDate()const; 128 bool hasStartDate() const;
127 bool hasCompletedDate()const; 129 bool hasCompletedDate() const;
128 130
129 /** 131 /**
130 * What is the priority? 132 * What is the priority?
131 */ 133 */
132 int priority()const ; 134 int priority() const ;
133 135
134 /** 136 /**
@@ -140,50 +142,50 @@ public:
140 * The due Date 142 * The due Date
141 */ 143 */
142 QDate dueDate()const; 144 QDate dueDate() const;
143 145
144 /** 146 /**
145 * When did it start? 147 * When did it start?
146 */ 148 */
147 QDate startDate()const; 149 QDate startDate() const;
148 150
149 /** 151 /**
150 * When was it completed? 152 * When was it completed?
151 */ 153 */
152 QDate completedDate()const; 154 QDate completedDate() const;
153 155
154 /** 156 /**
155 * does it have a state? 157 * does it have a state?
156 */ 158 */
157 bool hasState()const; 159 bool hasState() const;
158 160
159 /** 161 /**
160 * What is the state of this OTodo? 162 * What is the state of this OTodo?
161 */ 163 */
162 OPimState state()const; 164 OPimState state() const;
163 165
164 /** 166 /**
165 * has recurrence? 167 * has recurrence?
166 */ 168 */
167 bool hasRecurrence()const; 169 bool hasRecurrence() const;
168 170
169 /** 171 /**
170 * the recurrance of this 172 * the recurrance of this
171 */ 173 */
172 ORecur recurrence()const; 174 ORecur recurrence() const;
173 175
174 /** 176 /**
175 * does this OTodo have a maintainer? 177 * does this OTodo have a maintainer?
176 */ 178 */
177 bool hasMaintainer()const; 179 bool hasMaintainer() const;
178 180
179 /** 181 /**
180 * the Maintainer of this OTodo 182 * the Maintainer of this OTodo
181 */ 183 */
182 OPimMaintainer maintainer()const; 184 OPimMaintainer maintainer() const;
183 185
184 /** 186 /**
185 * The description of the todo 187 * The description of the todo
186 */ 188 */
187 QString description()const; 189 QString description() const;
188 190
189 /** 191 /**
@@ -198,5 +200,5 @@ public:
198 QString toRichText() const; 200 QString toRichText() const;
199 201
200 bool hasNotifiers()const; 202 bool hasNotifiers() const;
201 /* 203 /*
202 * FIXME check if the sharing is still fine!! -zecke 204 * FIXME check if the sharing is still fine!! -zecke
@@ -211,12 +213,12 @@ public:
211 * 213 *
212 */ 214 */
213 const OPimNotifyManager &notifiers()const; 215 const OPimNotifyManager &notifiers() const;
214 216
215 /** 217 /**
216 * reimplementations 218 * reimplementations
217 */ 219 */
218 QString type()const; 220 QString type() const;
219 QString toShortText()const; 221 QString toShortText() const;
220 QString recordField(int id )const; 222 QString recordField( int id ) const;
221 223
222 /** 224 /**
@@ -224,10 +226,10 @@ public:
224 * to ToDoEvent RecordFields enum 226 * to ToDoEvent RecordFields enum
225 */ 227 */
226 QMap<int, QString> toMap()const; 228 QMap<int, QString> toMap() const;
227 229
228 /** 230 /**
229 * Set if this Todo is completed 231 * Set if this Todo is completed
230 */ 232 */
231 void setCompleted(bool completed ); 233 void setCompleted( bool completed );
232 234
233 /** 235 /**
@@ -243,5 +245,5 @@ public:
243 * Set the priority of the Todo 245 * Set the priority of the Todo
244 */ 246 */
245 void setPriority(int priority ); 247 void setPriority( int priority );
246 248
247 /** 249 /**
@@ -267,6 +269,6 @@ public:
267 void setRecurrence( const ORecur& ); 269 void setRecurrence( const ORecur& );
268 270
269 void setDescription(const QString& ); 271 void setDescription( const QString& );
270 void setSummary(const QString& ); 272 void setSummary( const QString& );
271 273
272 /** 274 /**
@@ -274,5 +276,5 @@ public:
274 * @param state State what the todo should take 276 * @param state State what the todo should take
275 */ 277 */
276 void setState( const OPimState& state); 278 void setState( const OPimState& state );
277 279
278 /** 280 /**
@@ -284,17 +286,17 @@ public:
284 286
285 287
286 virtual bool match( const QRegExp &r )const; 288 virtual bool match( const QRegExp &r ) const;
287 289
288 bool operator<(const OTodo &toDoEvent )const; 290 bool operator<( const OTodo &toDoEvent ) const;
289 bool operator<=(const OTodo &toDoEvent )const; 291 bool operator<=( const OTodo &toDoEvent ) const;
290 bool operator!=(const OTodo &toDoEvent )const; 292 bool operator!=( const OTodo &toDoEvent ) const;
291 bool operator>(const OTodo &toDoEvent )const; 293 bool operator>( const OTodo &toDoEvent ) const;
292 bool operator>=(const OTodo &toDoEvent)const; 294 bool operator>=( const OTodo &toDoEvent ) const;
293 bool operator==(const OTodo &toDoEvent )const; 295 bool operator==( const OTodo &toDoEvent ) const;
294 OTodo &operator=(const OTodo &toDoEvent ); 296 OTodo &operator=( const OTodo &toDoEvent );
295 297
296 static int rtti(); 298 static int rtti();
297 299
298 private: 300 private:
299 class OTodoPrivate; 301 class OTodoPrivate;
300 struct OTodoData; 302 struct OTodoData;
@@ -307,6 +309,9 @@ public:
307 309
308}; 310};
309inline bool OTodo::operator!=(const OTodo &toDoEvent )const { 311
310 return !(*this == toDoEvent); 312
313inline bool OTodo::operator!=( const OTodo &toDoEvent ) const
314{
315 return !( *this == toDoEvent );
311} 316}
312 317