author | zecke <zecke> | 2002-11-30 11:28:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-30 11:28:47 (UTC) |
commit | 9b8b30fa6cbdf1424b29cde21fae112e8bf96e6d (patch) (side-by-side diff) | |
tree | 896dd858dc2ec2f0b7e1b265cae66ccceecc82da /libopie/pim/otodo.cpp | |
parent | 599c58c6ab2ab936890cbbfa4e6299493c141f8a (diff) | |
download | opie-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
-rw-r--r-- | libopie/pim/otodo.cpp | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index 6fcf9f6..ece624a 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp @@ -16,4 +16,5 @@ #include "orecur.h" #include "opimmaintainer.h" +#include "opimnotifymanager.h" #include "otodo.h" @@ -32,9 +33,10 @@ struct OTodo::OTodoData : public QShared { QMap<QString, QString> extra; ushort prog; - bool hasAlarmDateTime :1; - QDateTime alarmDateTime; OPimState state; ORecur recur; OPimMaintainer maintainer; + QDate start; + QDate completed; + OPimNotifyManager notifiers; }; @@ -74,6 +76,4 @@ OTodo::OTodo(bool completed, int priority, data->prog = progress; data->desc = Qtopia::simplifyMultiLineSpace(description ); - data->hasAlarmDateTime = false; - } OTodo::OTodo(bool completed, int priority, @@ -97,6 +97,4 @@ OTodo::OTodo(bool completed, int priority, data->prog = progress; data->desc = Qtopia::simplifyMultiLineSpace(description ); - data->hasAlarmDateTime = false; - } bool OTodo::match( const QRegExp ®Exp )const @@ -121,7 +119,9 @@ bool OTodo::hasDueDate() const return data->hasDate; } -bool OTodo::hasAlarmDateTime() const -{ - return data->hasAlarmDateTime; +bool OTodo::hasStartDate()const { + return data->start.isValid(); +} +bool OTodo::hasCompletedDate()const { + return data->completed.isValid(); } int OTodo::priority()const @@ -141,10 +141,10 @@ QDate OTodo::dueDate()const return data->date; } - -QDateTime OTodo::alarmDateTime() const -{ - return data->alarmDateTime; +QDate OTodo::startDate()const { + return data->start; +} +QDate OTodo::completedDate()const { + return data->completed; } - QString OTodo::description()const { @@ -170,9 +170,4 @@ void OTodo::setHasDueDate( bool hasDate ) data->hasDate = hasDate; } -void OTodo::setHasAlarmDateTime( bool hasAlarmDateTime ) -{ - changeOrModify(); - data->hasAlarmDateTime = hasAlarmDateTime; -} void OTodo::setDescription(const QString &desc ) { @@ -191,13 +186,16 @@ void OTodo::setPriority(int prio ) data->priority = prio; } -void OTodo::setDueDate( QDate date ) +void OTodo::setDueDate( const QDate& date ) { changeOrModify(); data->date = date; } -void OTodo::setAlarmDateTime( const QDateTime& alarm ) -{ +void OTodo::setStartDate( const QDate& date ) { changeOrModify(); - data->alarmDateTime = alarm; + data->start = date; +} +void OTodo::setCompletedDate( const QDate& date ) { + changeOrModify(); + data->completed = date; } void OTodo::setState( const OPimState& state ) { @@ -255,9 +253,4 @@ QString OTodo::toRichText() const text += "<br>"; } - if (hasAlarmDateTime() ){ - text += "<b>" + QObject::tr( "Alarmed Notification:") + " </b>"; - text += alarmDateTime().toString(); - text += "<br>"; - } text += "<b>" + QObject::tr( "Category:") + "</b> "; @@ -267,4 +260,7 @@ QString OTodo::toRichText() const return text; } +OPimNotifyManager& OTodo::notifiers() { + return data->notifiers; +} bool OTodo::operator<( const OTodo &toDoEvent )const{ @@ -328,8 +324,4 @@ bool OTodo::operator==(const OTodo &toDoEvent )const if ( data->sum != toDoEvent.data->sum ) return false; if ( data->desc != toDoEvent.data->desc ) return false; - if ( data->hasAlarmDateTime != toDoEvent.data->hasAlarmDateTime ) - return false; - if ( data->alarmDateTime != toDoEvent.data->alarmDateTime ) - return false; if ( data->maintainer != toDoEvent.data->maintainer ) return false; @@ -372,7 +364,9 @@ QMap<int, QString> OTodo::toMap() const { map.insert( Progress, QString::number( data->prog ) ); // map.insert( CrossReference, crossToString() ); - map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); - map.insert( AlarmDateTime, data->alarmDateTime.toString() ); - + /* FIXME!!! map.insert( State, ); + map.insert( Recurrence, ); + map.insert( Reminders, ); + map. + */ return map; } @@ -409,9 +403,10 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { dest->extra = src->extra; dest->prog = src->prog; - dest->hasAlarmDateTime = src->hasAlarmDateTime; - dest->alarmDateTime = src->alarmDateTime; dest->state = src->state; dest->recur = src->recur; dest->maintainer = src->maintainer; + dest->start = src->start; + dest->completed = src->completed; + dest->notifiers = src->notifiers; } QString OTodo::type() const { @@ -422,2 +417,5 @@ QString OTodo::recordField(int /*id*/ )const { } +int OTodo::rtti(){ + return 1; +} |