summaryrefslogtreecommitdiff
path: root/libopie/pim
authorzecke <zecke>2002-11-15 21:43:59 (UTC)
committer zecke <zecke>2002-11-15 21:43:59 (UTC)
commita1306f7603ab9a05f7d0059fad60b68f01a0ae71 (patch) (unidiff)
tree9af055fb6dea589ac5e5d93a7bf9f192b257c4c8 /libopie/pim
parent11116312592ada97b202f09c6e9ee57c9dd80b84 (diff)
downloadopie-a1306f7603ab9a05f7d0059fad60b68f01a0ae71.zip
opie-a1306f7603ab9a05f7d0059fad60b68f01a0ae71.tar.gz
opie-a1306f7603ab9a05f7d0059fad60b68f01a0ae71.tar.bz2
Make OTodo compile
add the MaintainerMode to OTodo
Diffstat (limited to 'libopie/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimmaintainer.cpp37
-rw-r--r--libopie/pim/opimmaintainer.h36
-rw-r--r--libopie/pim/opimxrefmanager.cpp2
-rw-r--r--libopie/pim/otodo.cpp20
-rw-r--r--libopie/pim/otodo.h12
5 files changed, 106 insertions, 1 deletions
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 @@
1#include "opimmaintainer.h"
2
3OPimMaintainer::OPimMaintainer( enum Mode mode, int uid )
4 : m_mode(mode), m_uid(uid )
5{}
6OPimMaintainer::~OPimMaintainer() {
7}
8OPimMaintainer::OPimMaintainer( const OPimMaintainer& main ) {
9 *this = main;
10}
11OPimMaintainer &OPimMaintainer::operator=( const OPimMaintainer& main ) {
12 m_mode = main.m_mode;
13 m_uid = main.m_uid;
14
15 return *this;
16}
17bool OPimMaintainer::operator==( const OPimMaintainer& main ) {
18 if (m_mode != main.m_mode ) return false;
19 if (m_uid != main.m_uid ) return false;
20
21 return true;
22}
23bool OPimMaintainer::operator!=( const OPimMaintainer& main ) {
24 return !(*this == main );
25}
26OPimMaintainer::Mode OPimMaintainer::mode()const {
27 return m_mode;
28}
29int OPimMaintainer::uid()const {
30 return m_uid;
31}
32void OPimMaintainer::setMode( enum Mode mo) {
33 m_mode = mo;
34}
35void OPimMaintainer::setUid( int uid ) {
36 m_uid = uid;
37}
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 @@
1#ifndef OPIE_PIM_MAINTAINER_H
2#define OPIE_PIM_MAINTAINER_H
3
4#include <qstring.h>
5
6/**
7 * Who maintains what?
8 */
9class OPimMaintainer {
10public:
11 enum Mode { Undefined = -1,
12 Responsible = 0,
13 DoneBy,
14 Coordinating };
15 OPimMaintainer( enum Mode mode = Undefined, int uid = 0);
16 OPimMaintainer( const OPimMaintainer& );
17 ~OPimMaintainer();
18
19 OPimMaintainer &operator=( const OPimMaintainer& );
20 bool operator==( const OPimMaintainer& );
21 bool operator!=( const OPimMaintainer& );
22
23
24 Mode mode()const;
25 int uid()const;
26
27 void setMode( enum Mode );
28 void setUid( int uid );
29
30private:
31 Mode m_mode;
32 int m_uid;
33
34};
35
36#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) {
8} 8}
9OPimXRefManager::~OPimXRefManager() {
10}
9OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { 11OPimXRefManager &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 @@
16#include "orecur.h" 16#include "orecur.h"
17#include "opimmaintainer.h"
18
17#include "otodo.h" 19#include "otodo.h"
@@ -35,2 +37,3 @@ struct OTodo::OTodoData : public QShared {
35 ORecur recur; 37 ORecur recur;
38 OPimMaintainer maintainer;
36}; 39};
@@ -155,2 +158,5 @@ ORecur OTodo::recurrence()const {
155} 158}
159OPimMaintainer OTodo::maintainer()const {
160 return data->maintainer;
161}
156void OTodo::setCompleted( bool completed ) 162void OTodo::setCompleted( bool completed )
@@ -204,2 +210,6 @@ void OTodo::setRecurrence( const ORecur& rec) {
204} 210}
211void OTodo::setMaintainer( const OPimMaintainer& pim ) {
212 changeOrModify();
213 data->maintainer = pim;
214}
205bool OTodo::isOverdue( ) 215bool OTodo::isOverdue( )
@@ -323,2 +333,4 @@ bool OTodo::operator==(const OTodo &toDoEvent )const
323 return false; 333 return false;
334 if ( data->maintainer != toDoEvent.data->maintainer )
335 return false;
324 336
@@ -360,3 +372,3 @@ QMap<int, QString> OTodo::toMap() const {
360 map.insert( Progress, QString::number( data->prog ) ); 372 map.insert( Progress, QString::number( data->prog ) );
361 map.insert( CrossReference, crossToString() ); 373// map.insert( CrossReference, crossToString() );
362 map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); 374 map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) );
@@ -384,2 +396,7 @@ void OTodo::changeOrModify() {
384} 396}
397// WATCHOUT
398/*
399 * if you add something to the Data struct
400 * be sure to copy it here
401 */
385void OTodo::copy( OTodoData* src, OTodoData* dest ) { 402void OTodo::copy( OTodoData* src, OTodoData* dest ) {
@@ -397,2 +414,3 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) {
397 dest->recur = src->recur; 414 dest->recur = src->recur;
415 dest->maintainer = src->maintainer;
398} 416}
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;
20class ORecur; 20class ORecur;
21class OPimMaintainer;
21class OTodo : public OPimRecord { 22class OTodo : public OPimRecord {
@@ -130,2 +131,7 @@ public:
130 /** 131 /**
132 * the Maintainer of this OTodo
133 */
134 OPimMaintainer maintainer()const;
135
136 /**
131 * The description of the todo 137 * The description of the todo
@@ -204,2 +210,8 @@ public:
204 void setState( const OPimState& state); 210 void setState( const OPimState& state);
211
212 /**
213 * set the Maintainer Mode
214 */
215 void setMaintainer( const OPimMaintainer& );
216
205 bool isOverdue(); 217 bool isOverdue();