Diffstat (limited to 'libopie/pim/opimaccessbackend.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/opimaccessbackend.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h index 8e744e7..5707b58 100644 --- a/libopie/pim/opimaccessbackend.h +++ b/libopie/pim/opimaccessbackend.h | |||
@@ -7,2 +7,11 @@ | |||
7 | 7 | ||
8 | |||
9 | /** | ||
10 | * OPimAccessBackend is the base class | ||
11 | * for all private backends | ||
12 | * it operates on OPimRecord as the base class | ||
13 | * and it's responsible for fast manipulating | ||
14 | * the resource the implementation takes care | ||
15 | * of | ||
16 | */ | ||
8 | template <class T = OPimRecord> | 17 | template <class T = OPimRecord> |
@@ -12,11 +21,55 @@ public: | |||
12 | virtual ~OPimAccessBackend(); | 21 | virtual ~OPimAccessBackend(); |
22 | |||
23 | /** | ||
24 | * load the resource | ||
25 | */ | ||
13 | virtual void load() = 0; | 26 | virtual void load() = 0; |
27 | |||
28 | /** | ||
29 | * reload the resource | ||
30 | */ | ||
14 | virtual void reload() = 0; | 31 | virtual void reload() = 0; |
32 | |||
33 | /** | ||
34 | * save the resource and | ||
35 | * all it's changes | ||
36 | */ | ||
15 | virtual void save() = 0; | 37 | virtual void save() = 0; |
38 | |||
39 | /** | ||
40 | * return an array of | ||
41 | * all available uids | ||
42 | */ | ||
16 | virtual QArray<int> allRecords()const = 0; | 43 | virtual QArray<int> allRecords()const = 0; |
44 | |||
45 | /** | ||
46 | * queryByExample for T with the SortOrder | ||
47 | * sort | ||
48 | */ | ||
17 | virtual QArray<int> queryByExample( const T& t, int sort ) = 0; | 49 | virtual QArray<int> queryByExample( const T& t, int sort ) = 0; |
50 | |||
51 | /** | ||
52 | * find the OPimRecord with uid @param uid | ||
53 | * returns T and T.isEmpty() if nothing was found | ||
54 | */ | ||
18 | virtual T find(int uid ) = 0; | 55 | virtual T find(int uid ) = 0; |
56 | |||
57 | /** | ||
58 | * clear the back end | ||
59 | */ | ||
19 | virtual void clear() = 0; | 60 | virtual void clear() = 0; |
61 | |||
62 | /** | ||
63 | * add T | ||
64 | */ | ||
20 | virtual bool add( const T& t ) = 0; | 65 | virtual bool add( const T& t ) = 0; |
66 | |||
67 | /** | ||
68 | * remove | ||
69 | */ | ||
21 | virtual bool remove( int uid ) = 0; | 70 | virtual bool remove( int uid ) = 0; |
71 | |||
72 | /** | ||
73 | * replace a record with T.uid() | ||
74 | */ | ||
22 | virtual bool replace( const T& t ) = 0; | 75 | virtual bool replace( const T& t ) = 0; |