-rw-r--r-- | libopie2/opiepim/core/opimstate.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimxref.h | 36 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimxrefmanager.h | 36 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimxrefpartner.h | 40 |
4 files changed, 114 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimstate.h b/libopie2/opiepim/core/opimstate.h index 731181e..cf6af46 100644 --- a/libopie2/opiepim/core/opimstate.h +++ b/libopie2/opiepim/core/opimstate.h | |||
@@ -1,44 +1,46 @@ | |||
1 | #ifndef OPIE_PIM_STATE_H | 1 | #ifndef OPIE_PIM_STATE_H |
2 | #define OPIE_PIM_STATE_H | 2 | #define OPIE_PIM_STATE_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * The State of a Task | 7 | * The State of a Task |
8 | * This class encapsules the state of a todo | 8 | * This class encapsules the state of a todo |
9 | * and it's shared too | 9 | * and it's shared too |
10 | */ | 10 | */ |
11 | /* | 11 | /* |
12 | * in c a simple struct would be enough ;) | 12 | * in c a simple struct would be enough ;) |
13 | * g_new_state(); | 13 | * g_new_state(); |
14 | * g_do_some_thing( state_t* ); | 14 | * g_do_some_thing( state_t* ); |
15 | * ;) | 15 | * ;) |
16 | */ | 16 | */ |
17 | class OPimState { | 17 | class OPimState { |
18 | public: | 18 | public: |
19 | enum State { | 19 | enum State { |
20 | Started = 0, | 20 | Started = 0, |
21 | Postponed, | 21 | Postponed, |
22 | Finished, | 22 | Finished, |
23 | NotStarted, | 23 | NotStarted, |
24 | Undefined | 24 | Undefined |
25 | }; | 25 | }; |
26 | OPimState( int state = Undefined ); | 26 | OPimState( int state = Undefined ); |
27 | OPimState( const OPimState& ); | 27 | OPimState( const OPimState& ); |
28 | ~OPimState(); | 28 | ~OPimState(); |
29 | 29 | ||
30 | bool operator==( const OPimState& ); | 30 | bool operator==( const OPimState& ); |
31 | OPimState &operator=( const OPimState& ); | 31 | OPimState &operator=( const OPimState& ); |
32 | void setState( int state); | 32 | void setState( int state); |
33 | int state()const; | 33 | int state()const; |
34 | private: | 34 | private: |
35 | void deref(); | 35 | void deref(); |
36 | inline void copyInternally(); | 36 | inline void copyInternally(); |
37 | |||
37 | struct Data; | 38 | struct Data; |
38 | Data* data; | 39 | Data* data; |
40 | |||
39 | class Private; | 41 | class Private; |
40 | Private *d; | 42 | Private *d; |
41 | }; | 43 | }; |
42 | 44 | ||
43 | 45 | ||
44 | #endif | 46 | #endif |
diff --git a/libopie2/opiepim/core/opimxref.h b/libopie2/opiepim/core/opimxref.h new file mode 100644 index 0000000..72154ac --- a/dev/null +++ b/libopie2/opiepim/core/opimxref.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef OPIM_XREF_H | ||
2 | #define OPIM_XREF_H | ||
3 | |||
4 | #include <qarray.h> | ||
5 | #include <qvaluelist.h> | ||
6 | |||
7 | #include <opie/opimxrefpartner.h> | ||
8 | |||
9 | /** | ||
10 | * this is a Cross Referecne between | ||
11 | * two Cross Reference Partners | ||
12 | */ | ||
13 | class OPimXRef { | ||
14 | public: | ||
15 | typedef QValueList<OPimXRef> ValueList; | ||
16 | enum Partners { One, Two }; | ||
17 | OPimXRef( const OPimXRefPartner& ONE, const OPimXRefPartner& ); | ||
18 | OPimXRef(); | ||
19 | OPimXRef( const OPimXRef& ); | ||
20 | ~OPimXRef(); | ||
21 | |||
22 | OPimXRef &operator=( const OPimXRef& ); | ||
23 | bool operator==( const OPimXRef ); | ||
24 | |||
25 | OPimXRefPartner partner( enum Partners ); | ||
26 | |||
27 | void setPartner( enum Partners, const OPimXRefPartner& ); | ||
28 | |||
29 | private: | ||
30 | QArray<OPimXRefPartner> m_partners; | ||
31 | |||
32 | class Private; | ||
33 | Private *d; | ||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/libopie2/opiepim/core/opimxrefmanager.h b/libopie2/opiepim/core/opimxrefmanager.h new file mode 100644 index 0000000..147895d --- a/dev/null +++ b/libopie2/opiepim/core/opimxrefmanager.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef OPIM_XREF_MANAGER_H | ||
2 | #define OPIM_XREF_MANAGER_H | ||
3 | |||
4 | #include <opie/opimxref.h> | ||
5 | |||
6 | /** | ||
7 | * This is a simple manager for | ||
8 | * OPimXRefs. | ||
9 | * It allows addition, removing, replacing | ||
10 | * clearing and 'querying' the XRef... | ||
11 | */ | ||
12 | class OPimXRefManager { | ||
13 | public: | ||
14 | OPimXRefManager(); | ||
15 | OPimXRefManager( const OPimXRefManager& ); | ||
16 | ~OPimXRefManager(); | ||
17 | |||
18 | OPimXRefManager& operator=( const OPimXRefManager& ); | ||
19 | bool operator==( const OPimXRefManager& ); | ||
20 | |||
21 | void add( const OPimXRef& ); | ||
22 | void remove( const OPimXRef& ); | ||
23 | void replace( const OPimXRef& ); | ||
24 | |||
25 | void clear(); | ||
26 | |||
27 | /** | ||
28 | * apps participating | ||
29 | */ | ||
30 | QStringList apps()const; | ||
31 | OPimXRef::ValueList list()const; | ||
32 | OPimXRef::ValueList list( const QString& appName )const; | ||
33 | OPimXRef::ValueList list( int uid )const; | ||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/libopie2/opiepim/core/opimxrefpartner.h b/libopie2/opiepim/core/opimxrefpartner.h new file mode 100644 index 0000000..808b9ab --- a/dev/null +++ b/libopie2/opiepim/core/opimxrefpartner.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef OPIM_XREF_PARTNER_H | ||
2 | #define OPIM_XREF_PARTNER_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | |||
6 | /** | ||
7 | * This class represents one partner | ||
8 | * of a Cross Reference. | ||
9 | * In Opie one application | ||
10 | * can link one uid | ||
11 | * with one tableId( fieldId ) to another. | ||
12 | */ | ||
13 | class OPimXRefPartner { | ||
14 | public: | ||
15 | OPimXRefPartner( const QString& appName = QString::null, | ||
16 | int uid = 0, int field = -1 ); | ||
17 | OPimXRefPartner( const OPimXRefPartner& ); | ||
18 | OPimXRefPartner& operator=( const OPimXRefPartner& ); | ||
19 | ~OPimXRefPartner(); | ||
20 | |||
21 | bool operator==(const OPimXRefPartner& ); | ||
22 | |||
23 | QString appName()const; | ||
24 | int uid()const; | ||
25 | int field()const; | ||
26 | |||
27 | void setAppName( const QString& appName ); | ||
28 | void setUid( int uid ); | ||
29 | void setField( int field ); | ||
30 | private: | ||
31 | QString m_app; | ||
32 | int m_uid; | ||
33 | int m_field; | ||
34 | |||
35 | class Private; | ||
36 | Private* d; | ||
37 | }; | ||
38 | |||
39 | |||
40 | #endif | ||