author | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
commit | 7484344ff5be1f7c54e51715776d0e3cadeb1ed0 (patch) (unidiff) | |
tree | 96f427f7a1fb1c8ca0a6efbd72b51e916cb1651d /libopie2/opiepim/core/opimtodo.h | |
parent | 3302eb30390e6053637929316670da3e8fbe279e (diff) | |
download | opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.zip opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.gz opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.bz2 |
Big PIM API Update Core Part (1/2 of what should be implemented):
OPimRecords:
-Add a so called safeCast using the rtti value
OPimTodo:
-Fix memleak with OPimState
OPimOccurrence:
-New class. Every 'Access' can give occurrences
for a period of time
Move Documentation
Diffstat (limited to 'libopie2/opiepim/core/opimtodo.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimtodo.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libopie2/opiepim/core/opimtodo.h b/libopie2/opiepim/core/opimtodo.h index e17fe6a..f4f9926 100644 --- a/libopie2/opiepim/core/opimtodo.h +++ b/libopie2/opiepim/core/opimtodo.h | |||
@@ -49,53 +49,54 @@ namespace Opie | |||
49 | class OPimState; | 49 | class OPimState; |
50 | class OPimRecurrence; | 50 | class OPimRecurrence; |
51 | class OPimMaintainer; | 51 | class OPimMaintainer; |
52 | class OPimNotifyManager; | 52 | class OPimNotifyManager; |
53 | class OPimTodo : public OPimRecord | 53 | class OPimTodo : public OPimRecord |
54 | { | 54 | { |
55 | public: | 55 | public: |
56 | typedef QValueList<OPimTodo> ValueList; | 56 | typedef QValueList<OPimTodo> ValueList; |
57 | enum RecordFields { | 57 | enum RecordFields { |
58 | Uid = Qtopia::UID_ID, | 58 | Uid = Qtopia::UID_ID, |
59 | Category = Qtopia::CATEGORY_ID, | 59 | Category = Qtopia::CATEGORY_ID, |
60 | HasDate, | 60 | HasDate, |
61 | Completed, | 61 | Completed, |
62 | Description, | 62 | Description, |
63 | Summary, | 63 | Summary, |
64 | Priority, | 64 | Priority, |
65 | DateDay, | 65 | DateDay, |
66 | DateMonth, | 66 | DateMonth, |
67 | DateYear, | 67 | DateYear, |
68 | Progress, | 68 | Progress, |
69 | CrossReference, | 69 | CrossReference, |
70 | State, | 70 | State, |
71 | Recurrence, | 71 | Recurrence, |
72 | Alarms, | 72 | Alarms, |
73 | Reminders, | 73 | Reminders, |
74 | Notifiers, | ||
75 | Maintainer, | 74 | Maintainer, |
76 | StartDate, | 75 | StartDate, |
77 | CompletedDate | 76 | CompletedDate, |
77 | //ADDITIONAL FOR RECORDFIELD | ||
78 | DueDate, | ||
78 | }; | 79 | }; |
79 | public: | 80 | public: |
80 | // priorities from Very low to very high | 81 | // priorities from Very low to very high |
81 | enum TaskPriority { VeryHigh = 1, High, Normal, Low, VeryLow }; | 82 | enum TaskPriority { VeryHigh = 1, High, Normal, Low, VeryLow }; |
82 | 83 | ||
83 | /* Constructs a new ToDoEvent | 84 | /* Constructs a new ToDoEvent |
84 | @param completed Is the TodoEvent completed | 85 | @param completed Is the TodoEvent completed |
85 | @param priority What is the priority of this ToDoEvent | 86 | @param priority What is the priority of this ToDoEvent |
86 | @param category Which category does it belong( uid ) | 87 | @param category Which category does it belong( uid ) |
87 | @param summary A small summary of the todo | 88 | @param summary A small summary of the todo |
88 | @param description What is this ToDoEvent about | 89 | @param description What is this ToDoEvent about |
89 | @param hasDate Does this Event got a deadline | 90 | @param hasDate Does this Event got a deadline |
90 | @param date what is the deadline? | 91 | @param date what is the deadline? |
91 | @param uid what is the UUID of this Event | 92 | @param uid what is the UUID of this Event |
92 | **/ | 93 | **/ |
93 | OPimTodo( bool completed = false, int priority = Normal, | 94 | OPimTodo( bool completed = false, int priority = Normal, |
94 | const QStringList &category = QStringList(), | 95 | const QStringList &category = QStringList(), |
95 | const QString &summary = QString::null , | 96 | const QString &summary = QString::null , |
96 | const QString &description = QString::null, | 97 | const QString &description = QString::null, |
97 | ushort progress = 0, | 98 | ushort progress = 0, |
98 | bool hasDate = false, QDate date = QDate::currentDate(), | 99 | bool hasDate = false, QDate date = QDate::currentDate(), |
99 | int uid = 0 /*empty*/ ); | 100 | int uid = 0 /*empty*/ ); |
100 | 101 | ||
101 | OPimTodo( bool completed, int priority, | 102 | OPimTodo( bool completed, int priority, |
@@ -261,60 +262,64 @@ class OPimTodo : public OPimRecord | |||
261 | */ | 262 | */ |
262 | void setStartDate( const QDate& date ); | 263 | void setStartDate( const QDate& date ); |
263 | 264 | ||
264 | /** | 265 | /** |
265 | * set the completed date | 266 | * set the completed date |
266 | */ | 267 | */ |
267 | void setCompletedDate( const QDate& date ); | 268 | void setCompletedDate( const QDate& date ); |
268 | 269 | ||
269 | void setRecurrence( const OPimRecurrence& ); | 270 | void setRecurrence( const OPimRecurrence& ); |
270 | 271 | ||
271 | void setDescription( const QString& ); | 272 | void setDescription( const QString& ); |
272 | void setSummary( const QString& ); | 273 | void setSummary( const QString& ); |
273 | 274 | ||
274 | /** | 275 | /** |
275 | * set the state of a Todo | 276 | * set the state of a Todo |
276 | * @param state State what the todo should take | 277 | * @param state State what the todo should take |
277 | */ | 278 | */ |
278 | void setState( const OPimState& state ); | 279 | void setState( const OPimState& state ); |
279 | 280 | ||
280 | /** | 281 | /** |
281 | * set the Maintainer Mode | 282 | * set the Maintainer Mode |
282 | */ | 283 | */ |
283 | void setMaintainer( const OPimMaintainer& ); | 284 | void setMaintainer( const OPimMaintainer& ); |
284 | 285 | ||
285 | bool isOverdue(); | 286 | bool isOverdue()const; |
286 | 287 | ||
287 | 288 | ||
288 | virtual bool match( const QRegExp &r ) const; | 289 | virtual bool match( const QRegExp &r ) const; |
289 | 290 | ||
290 | bool operator<( const OPimTodo &toDoEvent ) const; | 291 | bool operator<( const OPimTodo &toDoEvent ) const; |
291 | bool operator<=( const OPimTodo &toDoEvent ) const; | 292 | bool operator<=( const OPimTodo &toDoEvent ) const; |
292 | bool operator!=( const OPimTodo &toDoEvent ) const; | 293 | bool operator!=( const OPimTodo &toDoEvent ) const; |
293 | bool operator>( const OPimTodo &toDoEvent ) const; | 294 | bool operator>( const OPimTodo &toDoEvent ) const; |
294 | bool operator>=( const OPimTodo &toDoEvent ) const; | 295 | bool operator>=( const OPimTodo &toDoEvent ) const; |
295 | bool operator==( const OPimTodo &toDoEvent ) const; | 296 | bool operator==( const OPimTodo &toDoEvent ) const; |
296 | OPimTodo &operator=( const OPimTodo &toDoEvent ); | 297 | OPimTodo &operator=( const OPimTodo &toDoEvent ); |
297 | 298 | ||
299 | //@{ | ||
298 | int rtti() const; | 300 | int rtti() const; |
301 | static OPimTodo* safeCast( const OPimRecord* ); | ||
302 | //@} | ||
303 | |||
299 | 304 | ||
300 | private: | 305 | private: |
301 | class OPimTodoPrivate; | 306 | class OPimTodoPrivate; |
302 | struct OPimTodoData; | 307 | struct OPimTodoData; |
303 | 308 | ||
304 | void deref(); | 309 | void deref(); |
305 | inline void changeOrModify(); | 310 | inline void changeOrModify(); |
306 | void copy( OPimTodoData* src, OPimTodoData* dest ); | 311 | void copy( OPimTodoData* src, OPimTodoData* dest ); |
307 | OPimTodoPrivate *d; | 312 | OPimTodoPrivate *d; |
308 | OPimTodoData *data; | 313 | OPimTodoData *data; |
309 | 314 | ||
310 | }; | 315 | }; |
311 | 316 | ||
312 | 317 | ||
313 | inline bool OPimTodo::operator!=( const OPimTodo &toDoEvent ) const | 318 | inline bool OPimTodo::operator!=( const OPimTodo &toDoEvent ) const |
314 | { | 319 | { |
315 | return !( *this == toDoEvent ); | 320 | return !( *this == toDoEvent ); |
316 | } | 321 | } |
317 | 322 | ||
318 | } | 323 | } |
319 | 324 | ||
320 | #endif | 325 | #endif |