summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimaccesstemplate.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimaccesstemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index a0d8f63..3e1f393 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -6,90 +6,84 @@
6#include <opie/opimrecord.h> 6#include <opie/opimrecord.h>
7#include <opie/opimaccessbackend.h> 7#include <opie/opimaccessbackend.h>
8#include <opie/orecordlist.h> 8#include <opie/orecordlist.h>
9 9
10#include "opimcache.h" 10#include "opimcache.h"
11#include "otemplatebase.h" 11#include "otemplatebase.h"
12 12
13/** 13/**
14 * Thats the frontend to our OPIE PIM 14 * Thats the frontend to our OPIE PIM
15 * Library. Either you want to use it's 15 * Library. Either you want to use it's
16 * interface or you want to implement 16 * interface or you want to implement
17 * your own Access lib 17 * your own Access lib
18 * Just create a OPimRecord and inherit from 18 * Just create a OPimRecord and inherit from
19 * the plugins 19 * the plugins
20 */ 20 */
21 21
22template <class T = OPimRecord > 22template <class T = OPimRecord >
23class OPimAccessTemplate : public OTemplateBase<T> { 23class OPimAccessTemplate : public OTemplateBase<T> {
24public: 24public:
25 typedef ORecordList<T> List; 25 typedef ORecordList<T> List;
26 typedef OPimAccessBackend<T> BackEnd; 26 typedef OPimAccessBackend<T> BackEnd;
27 typedef OPimCache<T> Cache; 27 typedef OPimCache<T> Cache;
28 28
29 /** 29 /**
30 * our sort order
31 * should be safe explaining
32 */
33 enum SortOrder { WildCards = 0, IgnoreCase = 1,
34 RegExp = 2, ExactMatch = 4 };
35
36 /**
37 * c'tor BackEnd 30 * c'tor BackEnd
38 */ 31 */
39 OPimAccessTemplate( BackEnd* end); 32 OPimAccessTemplate( BackEnd* end);
40 virtual ~OPimAccessTemplate(); 33 virtual ~OPimAccessTemplate();
41 34
42 /** 35 /**
43 * load from the backend 36 * load from the backend
44 */ 37 */
45 virtual bool load(); 38 virtual bool load();
46 39
47 /** 40 /**
48 * reload from the backend 41 * reload from the backend
49 */ 42 */
50 virtual bool reload(); 43 virtual bool reload();
51 44
52 /** 45 /**
53 * save to the backend 46 * save to the backend
54 */ 47 */
55 virtual bool save(); 48 virtual bool save();
56 49
57 /** 50 /**
58 * if the resource was changed externally 51 * if the resource was changed externally
59 */ 52 */
60 bool wasChangedExternally()const; 53 bool wasChangedExternally()const;
61 54
62 /** 55 /**
63 * return a List of records 56 * return a List of records
64 * you can iterate over them 57 * you can iterate over them
65 */ 58 */
66 virtual List allRecords()const; 59 virtual List allRecords()const;
67 60
68 /** 61 /**
69 * queryByExample 62 * queryByExample)
63 * @see otodoaccess, ocontactaccess
70 */ 64 */
71 virtual List queryByExample( const T& t, int sortOrder ); 65 virtual List queryByExample( const T& t, int querySettings );
72 66
73 /** 67 /**
74 * find the OPimRecord uid 68 * find the OPimRecord uid
75 */ 69 */
76 virtual T find( int uid )const; 70 virtual T find( int uid )const;
77 71
78 /** 72 /**
79 * read ahead cache find method ;) 73 * read ahead cache find method ;)
80 */ 74 */
81 virtual T find( int uid, const QArray<int>&, 75 virtual T find( int uid, const QArray<int>&,
82 uint current, CacheDirection dir = Forward )const; 76 uint current, CacheDirection dir = Forward )const;
83 77
84 /* invalidate cache here */ 78 /* invalidate cache here */
85 /** 79 /**
86 * clears the backend and invalidates the backend 80 * clears the backend and invalidates the backend
87 */ 81 */
88 virtual void clear() ; 82 virtual void clear() ;
89 83
90 /** 84 /**
91 * add T to the backend 85 * add T to the backend
92 */ 86 */
93 virtual bool add( const T& t ) ; 87 virtual bool add( const T& t ) ;
94 88
95 /* only the uid matters */ 89 /* only the uid matters */