85
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef C_CASTORAGE_H
|
|
19 |
#define C_CASTORAGE_H
|
|
20 |
|
|
21 |
#include "caoperationparams.h"
|
|
22 |
|
|
23 |
// FORWARD DECLARATIONS
|
|
24 |
class CCaInnerQuery;
|
|
25 |
class CCaInnerEntry;
|
|
26 |
class CCaLocalizationEntry;
|
|
27 |
/**
|
|
28 |
* @ingroup group_catorage.
|
|
29 |
* Interface for storage.
|
|
30 |
*/
|
|
31 |
class CCaStorage: public CBase
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Localizes one entry attribute.
|
|
37 |
*
|
|
38 |
* @param aLocalization localization information about entry.
|
|
39 |
*/
|
|
40 |
virtual void LocalizeEntryL( CCaLocalizationEntry& aLocalization ) = 0;
|
|
41 |
|
|
42 |
/**
|
94
|
43 |
* Adds localization row to the localization table
|
|
44 |
*
|
|
45 |
* @param aLocalization localization information about entry.
|
|
46 |
*/
|
|
47 |
virtual void AddLocalizationL( const CCaLocalizationEntry& aLocalization ) = 0;
|
|
48 |
|
|
49 |
/**
|
85
|
50 |
* Fetches data from database
|
|
51 |
*
|
|
52 |
* @param aResultContainer container for localizations information.
|
|
53 |
*/
|
|
54 |
virtual void GetLocalizationsL( RPointerArray<CCaLocalizationEntry>& aResultContainer ) = 0;
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Fetches data from database.
|
|
58 |
*
|
|
59 |
* @param aQuery The query information to select specific entries.
|
|
60 |
* @param aResultContainer The result list of entries .
|
|
61 |
* for a specific select.
|
|
62 |
*/
|
86
|
63 |
virtual void GetEntriesL( const CCaInnerQuery* aQuery,
|
85
|
64 |
RPointerArray<CCaInnerEntry>& aResultContainer ) = 0;
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Fetches data from database by ids.
|
|
68 |
*
|
|
69 |
* @param aQuery The query information to select specific entries.
|
86
|
70 |
* @param aResultIdArray The result list of entries' ids.
|
85
|
71 |
* for a specific select.
|
|
72 |
*/
|
|
73 |
virtual void GetEntriesIdsL( const CCaInnerQuery* aQuery,
|
|
74 |
RArray<TInt>& aResultIdArray ) = 0;
|
|
75 |
|
|
76 |
/**
|
|
77 |
* Fetches parent id from database by entry ids.
|
|
78 |
*
|
|
79 |
* @param aEntryIdArray list of enties ids.
|
|
80 |
* @param aParentIdArray The result list of parents' ids
|
|
81 |
* for a specific select.
|
99
|
82 |
* @param aCheckParentsParent flag if set to true then
|
98
|
83 |
* search also for parent of the parent
|
85
|
84 |
*/
|
86
|
85 |
virtual void GetParentsIdsL( const RArray<TInt>& aEntryIdArray,
|
98
|
86 |
RArray<TInt>& aParentIdArray,
|
|
87 |
TBool aCheckParentsParent = ETrue ) = 0;
|
85
|
88 |
|
|
89 |
/**
|
|
90 |
* Adds or Updates data & action to the storage.
|
|
91 |
*
|
|
92 |
* @param aEntry The entry data to be added or updated.
|
|
93 |
*/
|
|
94 |
virtual void AddL( CCaInnerEntry* aEntry, TBool aUpdate = EFalse ) = 0;
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Removes data item from storage.
|
|
98 |
*
|
|
99 |
* @param aEntryIds The entry ids to be removed.
|
|
100 |
*/
|
|
101 |
virtual void RemoveL( const RArray<TInt>& aEntryIds ) = 0;
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Organizes data within a group in the storage.
|
|
105 |
*
|
|
106 |
* @param aEntryIds Ids of entries to organize.
|
|
107 |
* @param aParams Operation parameters to specify the organize type.
|
|
108 |
*/
|
|
109 |
virtual void OrganizeL( const RArray<TInt>& aEntryIds,
|
|
110 |
TCaOperationParams aParams ) = 0;
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Stores touch data information in storage.
|
|
114 |
*
|
|
115 |
* @param aEntryId The entry id for which touch data should be stored.
|
107
|
116 |
* @param aRemovable if entry is removable then flag is set if necessary.
|
85
|
117 |
*/
|
107
|
118 |
virtual void TouchL( const TInt aEntryId, TBool aRemovable ) = 0;
|
86
|
119 |
|
85
|
120 |
/**
|
|
121 |
* Get database property from db.
|
|
122 |
*
|
|
123 |
* @param aProperty The property to get.
|
|
124 |
* @param aPropertyValue The value of property.
|
|
125 |
*/
|
|
126 |
virtual void DbPropertyL( const TDesC& aProperty, TDes& aPropertyValue ) = 0;
|
86
|
127 |
|
85
|
128 |
/**
|
|
129 |
* Set property .
|
|
130 |
*
|
|
131 |
* @param aProperty The property to set.
|
|
132 |
* @param aPropertyValue The value of property.
|
|
133 |
*/
|
|
134 |
virtual void SetDBPropertyL( const TDesC& aProperty, const TDesC& aPropertyValue ) = 0;
|
86
|
135 |
|
85
|
136 |
/**
|
|
137 |
* Remove from localization table .
|
|
138 |
*
|
|
139 |
* @param aEntryId Entry Id to remove.
|
|
140 |
*/
|
|
141 |
virtual void RemoveFromLocalizationL( const TInt aEntryId ) = 0;
|
86
|
142 |
|
85
|
143 |
/**
|
|
144 |
* Organizes data within a group in custom order.
|
|
145 |
*
|
|
146 |
* @param aEntryIds Ids of entries in custom order.
|
|
147 |
* @param aGroupId Group to sort.
|
|
148 |
*/
|
|
149 |
virtual void CustomSortL( const RArray<TInt>& aEntryIds,
|
86
|
150 |
const TInt aGroupId ) = 0;
|
|
151 |
|
107
|
152 |
|
|
153 |
/**
|
|
154 |
* Saves a copy of database to private.
|
|
155 |
*/
|
|
156 |
virtual void RestoreDatabaseL() = 0;
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Saves a copy of database to private.
|
|
160 |
*/
|
|
161 |
virtual void SaveDatabaseL() = 0;
|
|
162 |
|
86
|
163 |
/**
|
|
164 |
* Loads data base from rom.
|
|
165 |
*/
|
|
166 |
virtual void LoadDataBaseFromRomL() = 0;
|
85
|
167 |
|
|
168 |
};
|
|
169 |
|
|
170 |
#endif //C_CASTORAGE_H
|