summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
Unidiff
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h81
-rw-r--r--libopie2/opiepim/core/opimrecord.h19
-rw-r--r--libopie2/opiepim/core/otemplatebase.h3
3 files changed, 96 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index e0708e1..36f5a99 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -11,2 +11,11 @@
11 11
12/**
13 * Thats the frontend to our OPIE PIM
14 * Library. Either you want to use it's
15 * interface or you want to implement
16 * your own Access lib
17 * Just create a OPimRecord and inherit from
18 * the plugins
19 */
20
12template <class T = OPimRecord > 21template <class T = OPimRecord >
@@ -16,14 +25,50 @@ public:
16 typedef OPimAccessBackend<T> BackEnd; 25 typedef OPimAccessBackend<T> BackEnd;
26
27 /**
28 * our sort order
29 * should be safe explaining
30 */
31 enum SortOrder { WildCards = 0, IgnoreCase = 1,
32 RegExp = 2, ExactMatch = 4 };
33
34 /**
35 * c'tor BackEnd
36 */
17 OPimAccessTemplate( BackEnd* end); 37 OPimAccessTemplate( BackEnd* end);
18 virtual ~OPimAccessTemplate(); 38 virtual ~OPimAccessTemplate();
39
40 /**
41 * load from the backend
42 */
19 virtual void load(); 43 virtual void load();
44
45 /**
46 * reload from the backend
47 */
20 virtual void reload(); 48 virtual void reload();
49
50 /**
51 * save to the backend
52 */
21 virtual void save(); 53 virtual void save();
22 54
23 /* 55 /**
24 *do array to Records conversion 56 * if the resource was changed externally
25 * QArray<int> ids 57 */
58 bool wasChangedExternally()const;
59
60 /**
61 * return a List of records
62 * you can iterate over them
26 */ 63 */
27 virtual List allRecords()const; 64 virtual List allRecords()const;
65
66 /**
67 * queryByExample
68 */
28 virtual List queryByExample( const T& t, int sortOrder ); 69 virtual List queryByExample( const T& t, int sortOrder );
70
71 /**
72 * find the OPimRecord uid
73 */
29 virtual T find( int uid ); 74 virtual T find( int uid );
@@ -31,3 +76,10 @@ public:
31 /* invalidate cache here */ 76 /* invalidate cache here */
77 /**
78 * clears the backend and invalidates the backend
79 */
32 virtual void clear() ; 80 virtual void clear() ;
81
82 /**
83 * add T to the backend
84 */
33 virtual bool add( const T& t ) ; 85 virtual bool add( const T& t ) ;
@@ -35,7 +87,25 @@ public:
35 /* only the uid matters */ 87 /* only the uid matters */
88 /**
89 * remove T from the backend
90 */
36 virtual bool remove( const T& t ); 91 virtual bool remove( const T& t );
92
93 /**
94 * remove the OPimRecord with uid
95 */
37 virtual bool remove( int uid ); 96 virtual bool remove( int uid );
97
98 /**
99 * replace T from backend
100 */
38 virtual bool replace( const T& t) ; 101 virtual bool replace( const T& t) ;
39protected: 102protected:
103 /**
104 * invalidate the cache
105 */
40 void invalidateCache(); 106 void invalidateCache();
107
108 /**
109 * returns the backend
110 */
41 BackEnd* backEnd(); 111 BackEnd* backEnd();
@@ -116,3 +186,6 @@ OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() {
116} 186}
117 187template <class T>
188bool OPimAccessTemplate<T>::wasChangedExternally()const {
189 return false;
190}
118#endif 191#endif
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index e4d33d6..dbb94ed 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -9,2 +9,8 @@
9 9
10
11/**
12 * This is the base class for
13 * all PIM Records
14 *
15 */
10class OPimRecord : public Qtopia::Record { 16class OPimRecord : public Qtopia::Record {
@@ -12,2 +18,3 @@ public:
12 /** 18 /**
19 * c'tor
13 * uid of 0 isEmpty 20 * uid of 0 isEmpty
@@ -46,2 +53,3 @@ public:
46 * if a Record isEmpty 53 * if a Record isEmpty
54 * it's empty if it's 0
47 */ 55 */
@@ -90,3 +98,4 @@ public:
90 /** 98 /**
91 * 99 * clear the relations for all relations
100 * with app
92 */ 101 */
@@ -95,3 +104,3 @@ public:
95 /** 104 /**
96 * 105 * add a relation
97 */ 106 */
@@ -100,5 +109,9 @@ public:
100 /** 109 /**
101 * 110 * set the relations for an app
102 */ 111 */
103 void setRelations( const QString&, QArray<int> ids ); 112 void setRelations( const QString&, QArray<int> ids );
113
114 /**
115 * set the uid
116 */
104 virtual void setUid( int uid ); 117 virtual void setUid( int uid );
diff --git a/libopie2/opiepim/core/otemplatebase.h b/libopie2/opiepim/core/otemplatebase.h
index 41cc934..add1de4 100644
--- a/libopie2/opiepim/core/otemplatebase.h
+++ b/libopie2/opiepim/core/otemplatebase.h
@@ -5,2 +5,5 @@
5 5
6/**
7 * internal template base
8 */
6template <class T = OPimRecord> 9template <class T = OPimRecord>