|
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: Main class in the SQL wrapper component |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef M_MCMSQLMAIN_H |
|
24 #define M_MCMSQLMAIN_H |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <badesca.h> |
|
28 #include "cmcommon.h" |
|
29 #include "cmcommontypes.h" |
|
30 |
|
31 /* Forward declarations. */ |
|
32 class RFs; |
|
33 class CCmSqlDbMaintenance; |
|
34 class CCmSqlConnection; |
|
35 class CCmSqlDbClause; |
|
36 class CCmBaseListItem; |
|
37 class CCmSqlBaseItem; |
|
38 class CCmFillRule; |
|
39 class CCmFillListItem; |
|
40 class CCmSqlGenericItem; |
|
41 class CCmSqlPropertyItem; |
|
42 class CCmBaseListItem; |
|
43 class CCmSqlPropertyCollector; |
|
44 |
|
45 /** |
|
46 * MCmSqlMain class ( Interface to sql wrapper ) |
|
47 * Part of SQL wrapper. SQL wrapper is part of |
|
48 * Content manager component. |
|
49 * |
|
50 * @lib cmsqlwrapper.lib |
|
51 * |
|
52 * @since S60 5.1 |
|
53 */ |
|
54 class MCmSqlMain |
|
55 { |
|
56 public: |
|
57 |
|
58 /** |
|
59 * Canceling operation |
|
60 * |
|
61 * @since S60 5.1 |
|
62 * @param None |
|
63 * @return None |
|
64 */ |
|
65 virtual void CancelAsyncOperation() = 0; |
|
66 |
|
67 /** |
|
68 * Setting media server id |
|
69 * |
|
70 * @since S60 5.1 |
|
71 * @param aId, id to be used |
|
72 * @return None |
|
73 */ |
|
74 virtual void SetMsId( TUint aId ) = 0; |
|
75 |
|
76 /** |
|
77 * Setting mmc quota |
|
78 * |
|
79 * @since S60 5.1 |
|
80 * @param aQuota, quota to be used in unlimited fill lists |
|
81 * @return None |
|
82 */ |
|
83 virtual void SetQuota( TInt64 aQuota ) = 0; |
|
84 |
|
85 /** |
|
86 * Setting dlna profile filters |
|
87 * |
|
88 * @since S60 5.1 |
|
89 * @param aProfileIds, unsupported profile ids |
|
90 * @return None |
|
91 */ |
|
92 virtual void SetDlnaProfileFilters( const RArray<TInt64>& aProfileIds ) = 0; |
|
93 |
|
94 /** |
|
95 * Asyncronous batch add |
|
96 * |
|
97 * @since S60 5.1 |
|
98 * @param aItems, items to be added |
|
99 * @param aStatus, request status to be completed |
|
100 * @return None |
|
101 */ |
|
102 virtual void AsyncBatchAdd( RPointerArray<CCmSqlGenericItem>& aItems, |
|
103 TRequestStatus& aStatus ) = 0; |
|
104 |
|
105 /** |
|
106 * Asyncronous batch property value add |
|
107 * |
|
108 * @since S60 5.1 |
|
109 * @param aItems, property items to be added |
|
110 * @param aField, property identifier |
|
111 * @param aStatus, request status to be completed |
|
112 * @return None |
|
113 */ |
|
114 virtual void AsyncBatchAddPropertyItems( |
|
115 RPointerArray<CCmSqlPropertyItem>& aItems, TCmMetadataField aField, |
|
116 TRequestStatus& aStatus ) = 0; |
|
117 |
|
118 /** |
|
119 * Syncronous property value add |
|
120 * |
|
121 * @since S60 5.1 |
|
122 * @param aItem, property item to be added |
|
123 * @param aField, property identifier |
|
124 * @return None |
|
125 */ |
|
126 virtual void SyncAddPropertyItemL( CCmSqlPropertyItem& aItem, |
|
127 TCmMetadataField aField ) = 0; |
|
128 |
|
129 /** |
|
130 * Asyncronous batch delete |
|
131 * |
|
132 * @since S60 5.1 |
|
133 * @param aItems, items to be deleted |
|
134 * @param aStatus, request status to be completed |
|
135 * @return None |
|
136 */ |
|
137 virtual void AsyncBatchDelete( RPointerArray<CCmSqlBaseItem>& aItems, |
|
138 TRequestStatus& aStatus ) = 0; |
|
139 |
|
140 /** |
|
141 * Asyncronous metadata delete |
|
142 * |
|
143 * @since S60 5.1 |
|
144 * @param aMsIds, defines where metadata is harvested |
|
145 * @param aStatus, request status to be completed |
|
146 * @return None |
|
147 */ |
|
148 virtual void AsyncMetadataDelete( RArray<TInt>& aMsIds, |
|
149 TRequestStatus& aStatus ) = 0; |
|
150 |
|
151 /** |
|
152 * SELECT XXX oldest and delete those |
|
153 * Delete defined amount of media items |
|
154 * |
|
155 * @since S60 5.1 |
|
156 * @param aType, media type identifier |
|
157 * @param aCount, amount to be deleted |
|
158 * @return None |
|
159 */ |
|
160 virtual void DeleteOldestMediaItemsL( TCmMediaType aType, |
|
161 TInt64 aCount ) = 0; |
|
162 |
|
163 /** |
|
164 * Deletes unused propertys |
|
165 * |
|
166 * @since S60 5.1 |
|
167 * @param None |
|
168 * @return None |
|
169 */ |
|
170 virtual void DeleteUnusedPropertys( ) = 0; |
|
171 |
|
172 /** |
|
173 * Asyncronous metadata query |
|
174 * |
|
175 * @since S60 5.1 |
|
176 * @param aItems, result array reference |
|
177 * @param aStatus, request status to be completed |
|
178 * @return None |
|
179 */ |
|
180 virtual void GetItemsL( RPointerArray<CCmSqlBaseItem>& aItems, |
|
181 TRequestStatus& aStatus ) = 0; |
|
182 |
|
183 /** |
|
184 * Asyncronous fill list item query |
|
185 * |
|
186 * @since S60 5.1 |
|
187 * @param aItems, result array reference |
|
188 * @param aRule, fill list used as a query clause parameter |
|
189 * @param aStatus, request status to be completed |
|
190 * @return None |
|
191 */ |
|
192 virtual void GetFillItemsL( RPointerArray<CCmFillListItem>& aItems, |
|
193 CCmFillRule& aRule, TRequestStatus& aStatus ) = 0; |
|
194 |
|
195 /** |
|
196 * Asyncronous metadata property values query |
|
197 * |
|
198 * @since S60 5.1 |
|
199 * @param aItems, result array reference |
|
200 * @param aStatus, request status to be completed |
|
201 * @param aField, property identifier ( e.g. artist ) |
|
202 * @param aMedia, media type identifier ( e.g. audio ) |
|
203 * @return None |
|
204 */ |
|
205 virtual void GetPropertyValuesL( |
|
206 RPointerArray<CCmSqlPropertyItem>& aItems, TRequestStatus& aStatus, |
|
207 TCmMetadataField aField, TCmMediaType aMedia = ECmAll ) = 0; |
|
208 |
|
209 /** |
|
210 * Asyncronous metadata filtered property values query |
|
211 * |
|
212 * @since S60 5.1 |
|
213 * @param aPropertys, result array reference |
|
214 * @param aStatus, request status to be completed |
|
215 * @return None |
|
216 */ |
|
217 virtual void GetFilteredPropertyValuesL( |
|
218 CCmSqlPropertyCollector& aPropertys, TRequestStatus& aStatus ) = 0; |
|
219 |
|
220 /** |
|
221 * Returns amount of media items |
|
222 * |
|
223 * @since S60 5.1 |
|
224 * @param aCount, media amount on return |
|
225 * @param aType, media type |
|
226 * @return None |
|
227 */ |
|
228 virtual void GetMediaCountL( TInt64& aCount, TCmMediaType aType ) = 0; |
|
229 |
|
230 /** |
|
231 * Returns ETrue if item exist in db |
|
232 * |
|
233 * @since S60 5.1 |
|
234 * @param aItem, item |
|
235 * @param aDevId, device id |
|
236 * @return ETrue if exists |
|
237 */ |
|
238 virtual TBool ExistsL( const CCmBaseListItem& aItem, const TInt aDevId ) = 0; |
|
239 |
|
240 /** |
|
241 * Deletes the object |
|
242 * |
|
243 * @since S60 5.1 |
|
244 */ |
|
245 virtual void Close() = 0; |
|
246 |
|
247 }; |
|
248 |
|
249 #endif // M_MCMSQLMAIN_H |