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