-rw-r--r-- | libopie/libopie.pro | 2 | ||||
-rw-r--r-- | libopie/pim/opimmaintainer.cpp | 37 | ||||
-rw-r--r-- | libopie/pim/opimmaintainer.h | 36 | ||||
-rw-r--r-- | libopie/pim/opimxrefmanager.cpp | 2 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 20 | ||||
-rw-r--r-- | libopie/pim/otodo.h | 12 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimmaintainer.cpp | 37 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimmaintainer.h | 36 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimxrefmanager.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.h | 12 |
11 files changed, 214 insertions, 2 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro index 3e6156e..a80a407 100644 --- a/libopie/libopie.pro +++ b/libopie/libopie.pro @@ -33,2 +33,3 @@ HEADERS = ofontmenu.h \ pim/opimxrefmanager.h \ + pim/opimmaintainer.h \ orecurrancewidget.h \ @@ -62,2 +63,3 @@ SOURCES = ofontmenu.cc \ pim/opimxrefmanager.cpp \ + pim/opimmaintainer.cpp \ orecurrancewidget.cpp \ diff --git a/libopie/pim/opimmaintainer.cpp b/libopie/pim/opimmaintainer.cpp new file mode 100644 index 0000000..e34f035 --- a/dev/null +++ b/libopie/pim/opimmaintainer.cpp @@ -0,0 +1,37 @@ +#include "opimmaintainer.h" + +OPimMaintainer::OPimMaintainer( enum Mode mode, int uid ) + : m_mode(mode), m_uid(uid ) +{} +OPimMaintainer::~OPimMaintainer() { +} +OPimMaintainer::OPimMaintainer( const OPimMaintainer& main ) { + *this = main; +} +OPimMaintainer &OPimMaintainer::operator=( const OPimMaintainer& main ) { + m_mode = main.m_mode; + m_uid = main.m_uid; + + return *this; +} +bool OPimMaintainer::operator==( const OPimMaintainer& main ) { + if (m_mode != main.m_mode ) return false; + if (m_uid != main.m_uid ) return false; + + return true; +} +bool OPimMaintainer::operator!=( const OPimMaintainer& main ) { + return !(*this == main ); +} +OPimMaintainer::Mode OPimMaintainer::mode()const { + return m_mode; +} +int OPimMaintainer::uid()const { + return m_uid; +} +void OPimMaintainer::setMode( enum Mode mo) { + m_mode = mo; +} +void OPimMaintainer::setUid( int uid ) { + m_uid = uid; +} diff --git a/libopie/pim/opimmaintainer.h b/libopie/pim/opimmaintainer.h new file mode 100644 index 0000000..310e15a --- a/dev/null +++ b/libopie/pim/opimmaintainer.h @@ -0,0 +1,36 @@ +#ifndef OPIE_PIM_MAINTAINER_H +#define OPIE_PIM_MAINTAINER_H + +#include <qstring.h> + +/** + * Who maintains what? + */ +class OPimMaintainer { +public: + enum Mode { Undefined = -1, + Responsible = 0, + DoneBy, + Coordinating }; + OPimMaintainer( enum Mode mode = Undefined, int uid = 0); + OPimMaintainer( const OPimMaintainer& ); + ~OPimMaintainer(); + + OPimMaintainer &operator=( const OPimMaintainer& ); + bool operator==( const OPimMaintainer& ); + bool operator!=( const OPimMaintainer& ); + + + Mode mode()const; + int uid()const; + + void setMode( enum Mode ); + void setUid( int uid ); + +private: + Mode m_mode; + int m_uid; + +}; + +#endif diff --git a/libopie/pim/opimxrefmanager.cpp b/libopie/pim/opimxrefmanager.cpp index d49f5f5..965f542 100644 --- a/libopie/pim/opimxrefmanager.cpp +++ b/libopie/pim/opimxrefmanager.cpp @@ -8,2 +8,4 @@ OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { } +OPimXRefManager::~OPimXRefManager() { +} OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index 4d5cb79..6fcf9f6 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp @@ -16,2 +16,4 @@ #include "orecur.h" +#include "opimmaintainer.h" + #include "otodo.h" @@ -35,2 +37,3 @@ struct OTodo::OTodoData : public QShared { ORecur recur; + OPimMaintainer maintainer; }; @@ -155,2 +158,5 @@ ORecur OTodo::recurrence()const { } +OPimMaintainer OTodo::maintainer()const { + return data->maintainer; +} void OTodo::setCompleted( bool completed ) @@ -204,2 +210,6 @@ void OTodo::setRecurrence( const ORecur& rec) { } +void OTodo::setMaintainer( const OPimMaintainer& pim ) { + changeOrModify(); + data->maintainer = pim; +} bool OTodo::isOverdue( ) @@ -323,2 +333,4 @@ bool OTodo::operator==(const OTodo &toDoEvent )const return false; + if ( data->maintainer != toDoEvent.data->maintainer ) + return false; @@ -360,3 +372,3 @@ QMap<int, QString> OTodo::toMap() const { map.insert( Progress, QString::number( data->prog ) ); - map.insert( CrossReference, crossToString() ); +// map.insert( CrossReference, crossToString() ); map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); @@ -384,2 +396,7 @@ void OTodo::changeOrModify() { } +// WATCHOUT +/* + * if you add something to the Data struct + * be sure to copy it here + */ void OTodo::copy( OTodoData* src, OTodoData* dest ) { @@ -397,2 +414,3 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { dest->recur = src->recur; + dest->maintainer = src->maintainer; } diff --git a/libopie/pim/otodo.h b/libopie/pim/otodo.h index 2cdc587..70b0253 100644 --- a/libopie/pim/otodo.h +++ b/libopie/pim/otodo.h @@ -20,2 +20,3 @@ class OPimState; class ORecur; +class OPimMaintainer; class OTodo : public OPimRecord { @@ -130,2 +131,7 @@ public: /** + * the Maintainer of this OTodo + */ + OPimMaintainer maintainer()const; + + /** * The description of the todo @@ -204,2 +210,8 @@ public: void setState( const OPimState& state); + + /** + * set the Maintainer Mode + */ + void setMaintainer( const OPimMaintainer& ); + bool isOverdue(); diff --git a/libopie2/opiepim/core/opimmaintainer.cpp b/libopie2/opiepim/core/opimmaintainer.cpp new file mode 100644 index 0000000..e34f035 --- a/dev/null +++ b/libopie2/opiepim/core/opimmaintainer.cpp @@ -0,0 +1,37 @@ +#include "opimmaintainer.h" + +OPimMaintainer::OPimMaintainer( enum Mode mode, int uid ) + : m_mode(mode), m_uid(uid ) +{} +OPimMaintainer::~OPimMaintainer() { +} +OPimMaintainer::OPimMaintainer( const OPimMaintainer& main ) { + *this = main; +} +OPimMaintainer &OPimMaintainer::operator=( const OPimMaintainer& main ) { + m_mode = main.m_mode; + m_uid = main.m_uid; + + return *this; +} +bool OPimMaintainer::operator==( const OPimMaintainer& main ) { + if (m_mode != main.m_mode ) return false; + if (m_uid != main.m_uid ) return false; + + return true; +} +bool OPimMaintainer::operator!=( const OPimMaintainer& main ) { + return !(*this == main ); +} +OPimMaintainer::Mode OPimMaintainer::mode()const { + return m_mode; +} +int OPimMaintainer::uid()const { + return m_uid; +} +void OPimMaintainer::setMode( enum Mode mo) { + m_mode = mo; +} +void OPimMaintainer::setUid( int uid ) { + m_uid = uid; +} diff --git a/libopie2/opiepim/core/opimmaintainer.h b/libopie2/opiepim/core/opimmaintainer.h new file mode 100644 index 0000000..310e15a --- a/dev/null +++ b/libopie2/opiepim/core/opimmaintainer.h @@ -0,0 +1,36 @@ +#ifndef OPIE_PIM_MAINTAINER_H +#define OPIE_PIM_MAINTAINER_H + +#include <qstring.h> + +/** + * Who maintains what? + */ +class OPimMaintainer { +public: + enum Mode { Undefined = -1, + Responsible = 0, + DoneBy, + Coordinating }; + OPimMaintainer( enum Mode mode = Undefined, int uid = 0); + OPimMaintainer( const OPimMaintainer& ); + ~OPimMaintainer(); + + OPimMaintainer &operator=( const OPimMaintainer& ); + bool operator==( const OPimMaintainer& ); + bool operator!=( const OPimMaintainer& ); + + + Mode mode()const; + int uid()const; + + void setMode( enum Mode ); + void setUid( int uid ); + +private: + Mode m_mode; + int m_uid; + +}; + +#endif diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp index d49f5f5..965f542 100644 --- a/libopie2/opiepim/core/opimxrefmanager.cpp +++ b/libopie2/opiepim/core/opimxrefmanager.cpp @@ -8,2 +8,4 @@ OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { } +OPimXRefManager::~OPimXRefManager() { +} OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index 4d5cb79..6fcf9f6 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp @@ -16,2 +16,4 @@ #include "orecur.h" +#include "opimmaintainer.h" + #include "otodo.h" @@ -35,2 +37,3 @@ struct OTodo::OTodoData : public QShared { ORecur recur; + OPimMaintainer maintainer; }; @@ -155,2 +158,5 @@ ORecur OTodo::recurrence()const { } +OPimMaintainer OTodo::maintainer()const { + return data->maintainer; +} void OTodo::setCompleted( bool completed ) @@ -204,2 +210,6 @@ void OTodo::setRecurrence( const ORecur& rec) { } +void OTodo::setMaintainer( const OPimMaintainer& pim ) { + changeOrModify(); + data->maintainer = pim; +} bool OTodo::isOverdue( ) @@ -323,2 +333,4 @@ bool OTodo::operator==(const OTodo &toDoEvent )const return false; + if ( data->maintainer != toDoEvent.data->maintainer ) + return false; @@ -360,3 +372,3 @@ QMap<int, QString> OTodo::toMap() const { map.insert( Progress, QString::number( data->prog ) ); - map.insert( CrossReference, crossToString() ); +// map.insert( CrossReference, crossToString() ); map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); @@ -384,2 +396,7 @@ void OTodo::changeOrModify() { } +// WATCHOUT +/* + * if you add something to the Data struct + * be sure to copy it here + */ void OTodo::copy( OTodoData* src, OTodoData* dest ) { @@ -397,2 +414,3 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { dest->recur = src->recur; + dest->maintainer = src->maintainer; } diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h index 2cdc587..70b0253 100644 --- a/libopie2/opiepim/otodo.h +++ b/libopie2/opiepim/otodo.h @@ -20,2 +20,3 @@ class OPimState; class ORecur; +class OPimMaintainer; class OTodo : public OPimRecord { @@ -130,2 +131,7 @@ public: /** + * the Maintainer of this OTodo + */ + OPimMaintainer maintainer()const; + + /** * The description of the todo @@ -204,2 +210,8 @@ public: void setState( const OPimState& state); + + /** + * set the Maintainer Mode + */ + void setMaintainer( const OPimMaintainer& ); + bool isOverdue(); |