summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.cpp
authorzecke <zecke>2002-11-30 11:28:47 (UTC)
committer zecke <zecke>2002-11-30 11:28:47 (UTC)
commit9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d (patch) (unidiff)
tree896dd858dc2ec2f0b7e1b265cae66ccceecc82da /libopie2/opiepim/otodo.cpp
parent599c58c6ab2ab936890cbbfa4e6299493c141f8a (diff)
downloadopie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.zip
opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.tar.gz
opie-9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d.tar.bz2
More infrastructure
ORecur has now the nextOccurence function exceptions We've now Notifers like Alarms and DatebookEntries we may add to execute applications... AppName replaced with service cause it is a service Add rtti to OPimRecord as a static function This is used inside the BackEnd classes to static_cast... added removeAllCompleted to the todobackends... add a common Opie PIM mainwindow which takes care of some simple scripting enchangements.. much more
Diffstat (limited to 'libopie2/opiepim/otodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/otodo.cpp72
1 files changed, 35 insertions, 37 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index 6fcf9f6..ece624a 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -16,4 +16,5 @@
16#include "orecur.h" 16#include "orecur.h"
17#include "opimmaintainer.h" 17#include "opimmaintainer.h"
18#include "opimnotifymanager.h"
18 19
19#include "otodo.h" 20#include "otodo.h"
@@ -32,9 +33,10 @@ struct OTodo::OTodoData : public QShared {
32 QMap<QString, QString> extra; 33 QMap<QString, QString> extra;
33 ushort prog; 34 ushort prog;
34 bool hasAlarmDateTime :1;
35 QDateTime alarmDateTime;
36 OPimState state; 35 OPimState state;
37 ORecur recur; 36 ORecur recur;
38 OPimMaintainer maintainer; 37 OPimMaintainer maintainer;
38 QDate start;
39 QDate completed;
40 OPimNotifyManager notifiers;
39}; 41};
40 42
@@ -74,6 +76,4 @@ OTodo::OTodo(bool completed, int priority,
74 data->prog = progress; 76 data->prog = progress;
75 data->desc = Qtopia::simplifyMultiLineSpace(description ); 77 data->desc = Qtopia::simplifyMultiLineSpace(description );
76 data->hasAlarmDateTime = false;
77
78} 78}
79OTodo::OTodo(bool completed, int priority, 79OTodo::OTodo(bool completed, int priority,
@@ -97,6 +97,4 @@ OTodo::OTodo(bool completed, int priority,
97 data->prog = progress; 97 data->prog = progress;
98 data->desc = Qtopia::simplifyMultiLineSpace(description ); 98 data->desc = Qtopia::simplifyMultiLineSpace(description );
99 data->hasAlarmDateTime = false;
100
101} 99}
102bool OTodo::match( const QRegExp &regExp )const 100bool OTodo::match( const QRegExp &regExp )const
@@ -121,7 +119,9 @@ bool OTodo::hasDueDate() const
121 return data->hasDate; 119 return data->hasDate;
122} 120}
123bool OTodo::hasAlarmDateTime() const 121bool OTodo::hasStartDate()const {
124{ 122 return data->start.isValid();
125 return data->hasAlarmDateTime; 123}
124bool OTodo::hasCompletedDate()const {
125 return data->completed.isValid();
126} 126}
127int OTodo::priority()const 127int OTodo::priority()const
@@ -141,10 +141,10 @@ QDate OTodo::dueDate()const
141 return data->date; 141 return data->date;
142} 142}
143 143QDate OTodo::startDate()const {
144QDateTime OTodo::alarmDateTime() const 144 return data->start;
145{ 145}
146 return data->alarmDateTime; 146QDate OTodo::completedDate()const {
147 return data->completed;
147} 148}
148
149QString OTodo::description()const 149QString OTodo::description()const
150{ 150{
@@ -170,9 +170,4 @@ void OTodo::setHasDueDate( bool hasDate )
170 data->hasDate = hasDate; 170 data->hasDate = hasDate;
171} 171}
172void OTodo::setHasAlarmDateTime( bool hasAlarmDateTime )
173{
174 changeOrModify();
175 data->hasAlarmDateTime = hasAlarmDateTime;
176}
177void OTodo::setDescription(const QString &desc ) 172void OTodo::setDescription(const QString &desc )
178{ 173{
@@ -191,13 +186,16 @@ void OTodo::setPriority(int prio )
191 data->priority = prio; 186 data->priority = prio;
192} 187}
193void OTodo::setDueDate( QDate date ) 188void OTodo::setDueDate( const QDate& date )
194{ 189{
195 changeOrModify(); 190 changeOrModify();
196 data->date = date; 191 data->date = date;
197} 192}
198void OTodo::setAlarmDateTime( const QDateTime& alarm ) 193void OTodo::setStartDate( const QDate& date ) {
199{
200 changeOrModify(); 194 changeOrModify();
201 data->alarmDateTime = alarm; 195 data->start = date;
196}
197void OTodo::setCompletedDate( const QDate& date ) {
198 changeOrModify();
199 data->completed = date;
202} 200}
203void OTodo::setState( const OPimState& state ) { 201void OTodo::setState( const OPimState& state ) {
@@ -255,9 +253,4 @@ QString OTodo::toRichText() const
255 text += "<br>"; 253 text += "<br>";
256 } 254 }
257 if (hasAlarmDateTime() ){
258 text += "<b>" + QObject::tr( "Alarmed Notification:") + " </b>";
259 text += alarmDateTime().toString();
260 text += "<br>";
261 }
262 255
263 text += "<b>" + QObject::tr( "Category:") + "</b> "; 256 text += "<b>" + QObject::tr( "Category:") + "</b> ";
@@ -267,4 +260,7 @@ QString OTodo::toRichText() const
267 return text; 260 return text;
268} 261}
262OPimNotifyManager& OTodo::notifiers() {
263 return data->notifiers;
264}
269 265
270bool OTodo::operator<( const OTodo &toDoEvent )const{ 266bool OTodo::operator<( const OTodo &toDoEvent )const{
@@ -328,8 +324,4 @@ bool OTodo::operator==(const OTodo &toDoEvent )const
328 if ( data->sum != toDoEvent.data->sum ) return false; 324 if ( data->sum != toDoEvent.data->sum ) return false;
329 if ( data->desc != toDoEvent.data->desc ) return false; 325 if ( data->desc != toDoEvent.data->desc ) return false;
330 if ( data->hasAlarmDateTime != toDoEvent.data->hasAlarmDateTime )
331 return false;
332 if ( data->alarmDateTime != toDoEvent.data->alarmDateTime )
333 return false;
334 if ( data->maintainer != toDoEvent.data->maintainer ) 326 if ( data->maintainer != toDoEvent.data->maintainer )
335 return false; 327 return false;
@@ -372,7 +364,9 @@ QMap<int, QString> OTodo::toMap() const {
372 map.insert( Progress, QString::number( data->prog ) ); 364 map.insert( Progress, QString::number( data->prog ) );
373// map.insert( CrossReference, crossToString() ); 365// map.insert( CrossReference, crossToString() );
374 map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); 366 /* FIXME!!! map.insert( State, );
375 map.insert( AlarmDateTime, data->alarmDateTime.toString() ); 367 map.insert( Recurrence, );
376 368 map.insert( Reminders, );
369 map.
370 */
377 return map; 371 return map;
378} 372}
@@ -409,9 +403,10 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) {
409 dest->extra = src->extra; 403 dest->extra = src->extra;
410 dest->prog = src->prog; 404 dest->prog = src->prog;
411 dest->hasAlarmDateTime = src->hasAlarmDateTime;
412 dest->alarmDateTime = src->alarmDateTime;
413 dest->state = src->state; 405 dest->state = src->state;
414 dest->recur = src->recur; 406 dest->recur = src->recur;
415 dest->maintainer = src->maintainer; 407 dest->maintainer = src->maintainer;
408 dest->start = src->start;
409 dest->completed = src->completed;
410 dest->notifiers = src->notifiers;
416} 411}
417QString OTodo::type() const { 412QString OTodo::type() const {
@@ -422,2 +417,5 @@ QString OTodo::recordField(int /*id*/ )const {
422} 417}
423 418
419int OTodo::rtti(){
420 return 1;
421}