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 Database manager component |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_CMDMMAIN_H |
|
24 #define C_CMDMMAIN_H |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <badesca.h> |
|
28 #include "cmcommon.h" |
|
29 #include "cmcommontypes.h" |
|
30 |
|
31 // Operation types |
|
32 enum TCMQueryCmdType |
|
33 { |
|
34 EFillRuleQuery = 1, |
|
35 EMediaServerInfoQyery, |
|
36 EMediaServerIdQuery, |
|
37 EMediaServerUDNQuery, |
|
38 EMediaServersAllQuery, |
|
39 EHashValueQuery, |
|
40 EFilledQuery, |
|
41 EStoredQuery, |
|
42 EFilledRowQuery, |
|
43 EStoredRowQuery, |
|
44 ESelectedFillRuleQuery, |
|
45 EFillRuleNamesQuery, |
|
46 EStoreRuleQuery, |
|
47 EStoreRuleNamesQuery, |
|
48 ESelectedStoreRuleQuery, |
|
49 ETransferHistoryQuery, |
|
50 EFillFilesQuery, |
|
51 EStoreFilesQuery, |
|
52 EAllFillFilesQuery, |
|
53 EAllStoreFilesQuery, |
|
54 EFilledLowPriorityQuery, |
|
55 EAllFillFilesStatusQuery, |
|
56 EAllStoreFilesStatusQuery, |
|
57 EDeletedFillFilesQuery, |
|
58 EDrivesQuery |
|
59 }; |
|
60 |
|
61 /* Forward declarations. */ |
|
62 class CCmDmSqlDbMaintenance; |
|
63 class CCmDmSQLiteConnection; |
|
64 class CCmFillRule; |
|
65 class CCmFillRuleContainer; |
|
66 class CCmMediaServerFull; |
|
67 class CCmStoreRule; |
|
68 class CCmBaseListItem; |
|
69 class CCmFillListItem; |
|
70 class CCmStoreListItem; |
|
71 class CCmSearchResponseHash; |
|
72 class CCmDriveInfo; |
|
73 |
|
74 |
|
75 /** |
|
76 * CCmDmMain class |
|
77 * Part of Database manager. Database manager is part of |
|
78 * Content manager component. |
|
79 * |
|
80 * @lib cmdatabasemanager.lib |
|
81 * |
|
82 * @since S60 5.1 |
|
83 */ |
|
84 class CCmDmMain : public CBase |
|
85 { |
|
86 |
|
87 public: |
|
88 |
|
89 /** |
|
90 * Two-phased constructor. |
|
91 */ |
|
92 IMPORT_C static CCmDmMain* NewL(); |
|
93 |
|
94 /** |
|
95 * Two-phased constructor. |
|
96 */ |
|
97 IMPORT_C static CCmDmMain* NewLC(); |
|
98 |
|
99 /** |
|
100 * Destructor. |
|
101 */ |
|
102 IMPORT_C virtual ~CCmDmMain(); |
|
103 |
|
104 /** |
|
105 * Prepares query command |
|
106 * |
|
107 * @since S60 5.1 |
|
108 * @param aType type of query |
|
109 * @return None |
|
110 */ |
|
111 IMPORT_C void PrepareQueryCmdL( TCMQueryCmdType aType ); |
|
112 |
|
113 /** |
|
114 * Query fill rule |
|
115 * |
|
116 * @since S60 5.1 |
|
117 * @param aFillRule |
|
118 * @return TInt, Error code |
|
119 */ |
|
120 IMPORT_C TInt QueryFillRuleL( CCmFillRule* aFillRule ); |
|
121 |
|
122 /** |
|
123 * Query names of selected fill rules |
|
124 * |
|
125 * @since S60 5.1 |
|
126 * @param aNames |
|
127 * @param aSelected |
|
128 * @return None |
|
129 */ |
|
130 IMPORT_C void QuerySelectedFillRuleNamesL( |
|
131 RPointerArray<HBufC8>& aNames, |
|
132 TInt aSelected ); |
|
133 |
|
134 /** |
|
135 * Query names of fill rules |
|
136 * |
|
137 * @since S60 5.1 |
|
138 * @param aNames, on return fill rule names |
|
139 * @return None |
|
140 */ |
|
141 IMPORT_C void QueryFillRuleNamesL( RPointerArray<HBufC8>& aNames ); |
|
142 |
|
143 /** |
|
144 * Query store rule |
|
145 * |
|
146 * @since S60 5.1 |
|
147 * @param aStoreRule, store list |
|
148 * @return TInt, Error code |
|
149 */ |
|
150 IMPORT_C TInt QueryStoreRuleL( CCmStoreRule* aStoreRule ); |
|
151 |
|
152 /** |
|
153 * Query store rule names |
|
154 * |
|
155 * @since S60 5.1 |
|
156 * @param aNames, list names |
|
157 * @return None |
|
158 */ |
|
159 IMPORT_C void QueryStoreRuleNamesL( RPointerArray<HBufC8>& aNames ); |
|
160 |
|
161 /** |
|
162 * Query selected store rule names |
|
163 * |
|
164 * @since S60 5.1 |
|
165 * @param aNames, list names |
|
166 * @param aSelected, selection status |
|
167 * @return None |
|
168 */ |
|
169 IMPORT_C void QuerySelectedStoreRuleNamesL( |
|
170 RPointerArray<HBufC8>& aNames, |
|
171 TInt aSelected ); |
|
172 |
|
173 /** |
|
174 * Query media server info |
|
175 * |
|
176 * @since S60 5.1 |
|
177 * @param aMediaServer, mediaserver |
|
178 * @return TInt, Error code |
|
179 */ |
|
180 IMPORT_C TInt QueryMediaServerL( CCmMediaServerFull* aMediaServer ); |
|
181 |
|
182 /** |
|
183 * Query media server ids |
|
184 * |
|
185 * @since S60 5.1 |
|
186 * @param aUDN, server UDN |
|
187 * @return TInt64, Media server id |
|
188 */ |
|
189 IMPORT_C TInt64 QueryMediaServerId( const TDesC8& aUDN ); |
|
190 |
|
191 /** |
|
192 * Query media server udn |
|
193 * |
|
194 * @since S60 5.1 |
|
195 * @param aUDN, server UDN |
|
196 * @param aId, server id |
|
197 * @return TInt, Error code |
|
198 */ |
|
199 IMPORT_C TInt QueryMediaServerUdn( HBufC8*& aUdn, const TInt32 aId ); |
|
200 |
|
201 /** |
|
202 * Query All Media servers |
|
203 * |
|
204 * @since S60 5.1 |
|
205 * @param aMediaServer, mediaserver |
|
206 * @return TInt, Error code |
|
207 */ |
|
208 IMPORT_C TInt QueryAllMediaServersL( CCmMediaServerFull* aMediaServer ); |
|
209 |
|
210 /** |
|
211 * Get media servers |
|
212 * |
|
213 * @since S60 5.1 |
|
214 * @param aMediaServers, mediaserver list |
|
215 * @return None |
|
216 */ |
|
217 IMPORT_C void GetMediaServersL( |
|
218 RPointerArray<CCmMediaServerFull>& aMediaServers ); |
|
219 |
|
220 /** |
|
221 * Query filled |
|
222 * |
|
223 * @since S60 5.1 |
|
224 * @param aDrive, drive id |
|
225 * @param aFilled, fill list items |
|
226 * @return TInt, Error code |
|
227 */ |
|
228 IMPORT_C TInt GetLowPriorityFilledFilesL( |
|
229 TInt aDrive, |
|
230 RPointerArray<CCmFillListItem>& aFilled ); |
|
231 |
|
232 /** |
|
233 * Query fill file list |
|
234 * |
|
235 * @since S60 5.1 |
|
236 * @param aItems, fill list items |
|
237 * @param aName, fill list name |
|
238 * @param aStatus, list status |
|
239 * @return TInt, Error code |
|
240 */ |
|
241 IMPORT_C TInt QueryFillFileListL( |
|
242 RPointerArray<CCmBaseListItem>& aItems, |
|
243 const TDesC8& aName, |
|
244 TUint aStatus ); |
|
245 |
|
246 /** |
|
247 * Query fill file list |
|
248 * |
|
249 * @since S60 5.1 |
|
250 * @param aItems, fill list items |
|
251 * @param aStatus, list status |
|
252 * @return TInt, Error code |
|
253 */ |
|
254 IMPORT_C TInt GetAllFillFilesL( |
|
255 RPointerArray<CCmFillListItem>& aItems, |
|
256 TUint aStatus ); |
|
257 |
|
258 /** |
|
259 * Query store file list |
|
260 * |
|
261 * @since S60 5.1 |
|
262 * @param aItems, list items |
|
263 * @param aName, list name |
|
264 * @param aStatus, list status |
|
265 * @return TInt, Error code |
|
266 */ |
|
267 IMPORT_C TInt QueryStoreFileListL( |
|
268 RPointerArray<CCmBaseListItem>& aItems, |
|
269 const TDesC8& aName, |
|
270 TUint aStatus ); |
|
271 |
|
272 /** |
|
273 * Query store file list |
|
274 * |
|
275 * @since S60 5.1 |
|
276 * @param aItems, list items |
|
277 * @param aStatus, list status |
|
278 * @return TInt, Error code |
|
279 */ |
|
280 IMPORT_C TInt GetAllStoreFilesL( |
|
281 RPointerArray<CCmStoreListItem>& aItems, |
|
282 TUint aStatus ); |
|
283 |
|
284 /** |
|
285 * Query all fill files |
|
286 * @since S60 5.1 |
|
287 * @param aItems |
|
288 * @return TInt, Error code |
|
289 */ |
|
290 IMPORT_C TInt QueryAllFillFilesL( |
|
291 RPointerArray<CCmFillListItem>& aItems ); |
|
292 |
|
293 /** |
|
294 * Query all store files |
|
295 * |
|
296 * @since S60 5.1 |
|
297 * @param aItems, list items |
|
298 * @return TInt, Error code |
|
299 */ |
|
300 IMPORT_C TInt QueryAllStoreFilesL( |
|
301 RPointerArray<CCmStoreListItem>& aItems ); |
|
302 |
|
303 /** |
|
304 * Query all stored ( use aFile as a query parameter ) |
|
305 * |
|
306 * @since S60 5.1 |
|
307 * @param aFiles, stored files |
|
308 * @param aUDN, server udn |
|
309 * @param aAmount, amount of files |
|
310 * @return None |
|
311 */ |
|
312 IMPORT_C void QueryStoredRowL( |
|
313 RPointerArray<HBufC16>& aFiles, |
|
314 const TDesC8& aUDN, |
|
315 TInt aAmount ); |
|
316 |
|
317 /** |
|
318 * Query transfer history |
|
319 * |
|
320 * @since S60 5.1 |
|
321 * @param aUdn, server udn |
|
322 * @param aDownloadData, download data size |
|
323 * @param aUploadData, upload data size |
|
324 * @param aDownloadTime, download time |
|
325 * @param aUploadTime, upload time |
|
326 * @return None |
|
327 */ |
|
328 IMPORT_C void QueryTransferHistory( |
|
329 const TDesC8& aUdn, |
|
330 TInt64& aDownloadData, |
|
331 TInt64& aUploadData, |
|
332 TInt64& aDownloadTime, |
|
333 TInt64& aUploadTime ); |
|
334 |
|
335 /** |
|
336 * Query deleted items list |
|
337 * |
|
338 * @since S60 5.1 |
|
339 * @param aUdn, server udn |
|
340 * @param aArray, array of deleted items |
|
341 * @param aStatus, status info |
|
342 * @return None |
|
343 */ |
|
344 IMPORT_C void QueryDeletedItemsListsL( |
|
345 RPointerArray<CCmBaseListItem>& aArray, |
|
346 TUint aStatus ); |
|
347 |
|
348 /** |
|
349 * Query drives |
|
350 * |
|
351 * @since S60 5.1 |
|
352 * @param aDrives, drive array |
|
353 * @return None |
|
354 */ |
|
355 IMPORT_C void QueryDrivesL( RPointerArray<CCmDriveInfo>& aDrives ); |
|
356 |
|
357 /** |
|
358 * Avarage image shrinking time |
|
359 * |
|
360 * @since S60 5.1 |
|
361 * @return TInt, Avarage image shrinking time in millisecond |
|
362 */ |
|
363 IMPORT_C TInt GetAvgImageShrinkTime(); |
|
364 |
|
365 /** |
|
366 * Get list name using list id |
|
367 * |
|
368 * @since S60 5.1 |
|
369 * @param aListName, name of the fill list |
|
370 * @param aListId, id of the named list |
|
371 * @return None |
|
372 */ |
|
373 IMPORT_C void GetFillListNameL( |
|
374 HBufC8*& aListName, |
|
375 const TInt64 aListId ); |
|
376 |
|
377 /** |
|
378 * Set fill file list |
|
379 * |
|
380 * @since S60 5.1 |
|
381 * @param aItems, fill list items |
|
382 * @return TInt Error code |
|
383 */ |
|
384 IMPORT_C TInt SetFillFiles( RPointerArray<CCmFillListItem>& aItems ); |
|
385 |
|
386 /** |
|
387 * Set store file list |
|
388 * |
|
389 * @since S60 5.1 |
|
390 * @param aItems, store list items |
|
391 * @return TInt, Error code |
|
392 */ |
|
393 IMPORT_C TInt SetStoreFilesL( RPointerArray<CCmStoreListItem>& aItems ); |
|
394 |
|
395 /** |
|
396 * Adds one item into store file list |
|
397 * |
|
398 * @since S60 5.1 |
|
399 * @param aItem, store list item |
|
400 * @return TInt, Error code |
|
401 */ |
|
402 IMPORT_C TInt AddStoreFile( CCmStoreListItem& aItem ); |
|
403 |
|
404 /** |
|
405 * Add stored item |
|
406 * |
|
407 * @since S60 5.1 |
|
408 * @param aFileName, file name |
|
409 * @param aUDN, server udn |
|
410 * @param aTimeStamp, timestamp |
|
411 * @return TInt, Error code |
|
412 */ |
|
413 IMPORT_C TInt AddStoredL( |
|
414 const TDesC& aFileName, |
|
415 const TDesC8& aUDN, |
|
416 TTime aTimeStamp ); |
|
417 |
|
418 /** |
|
419 * Add fill rule |
|
420 * |
|
421 * @since S60 5.1 |
|
422 * @param aFillRule, fill list |
|
423 * @return TInt, Error code |
|
424 */ |
|
425 IMPORT_C TInt AddFillRuleL( CCmFillRule* aFillRule ); |
|
426 |
|
427 /** |
|
428 * Add store rule |
|
429 * |
|
430 * @since S60 5.1 |
|
431 * @param aStoreRule, store list |
|
432 * @return TInt, Error code |
|
433 */ |
|
434 IMPORT_C TInt AddStoreRuleL( CCmStoreRule* aStoreRule ); |
|
435 |
|
436 /** |
|
437 * Add Media server |
|
438 * |
|
439 * @since S60 5.1 |
|
440 * @param aMediaServer, media server |
|
441 * @return TInt, Error code |
|
442 */ |
|
443 IMPORT_C TInt AddMediaServerL( CCmMediaServerFull* aMediaServer ); |
|
444 |
|
445 /** |
|
446 * Add hash value |
|
447 * |
|
448 * @since S60 5.1 |
|
449 * @param aMediaServerId, media server id |
|
450 * @param aHashValue, hash value |
|
451 * @return TInt, Error code |
|
452 */ |
|
453 IMPORT_C TInt AddHashValue( TInt64 aMediaServerId, |
|
454 CCmSearchResponseHash* aHashValue ); |
|
455 |
|
456 /** |
|
457 * Query hash values |
|
458 * |
|
459 * @since S60 5.1 |
|
460 * @param aMediaServerId, media server id |
|
461 * @param aHashValues, hash value |
|
462 * @return TInt, Error code |
|
463 */ |
|
464 IMPORT_C TInt QueryHashValuesL( TInt aMediaServer, |
|
465 RPointerArray<CCmSearchResponseHash>& aHashValues ); |
|
466 |
|
467 /** |
|
468 * Sets is active status of the media server |
|
469 * |
|
470 * @since S60 5.1 |
|
471 * @param aServers, mediaservers |
|
472 * @return TInt, Error code |
|
473 */ |
|
474 IMPORT_C TInt SetMediaServersL( |
|
475 RPointerArray<CCmMediaServerFull>& aServers ); |
|
476 |
|
477 /** |
|
478 * Sets last syncs time |
|
479 * |
|
480 * @since S60 5.1 |
|
481 * @param None |
|
482 * @return TInt, Error code |
|
483 */ |
|
484 IMPORT_C TInt SetSyncTime(); |
|
485 |
|
486 /** |
|
487 * Gets last syncs time |
|
488 * |
|
489 * @since S60 5.1 |
|
490 * @param aTime last sync time |
|
491 * @return TInt, Error code |
|
492 */ |
|
493 IMPORT_C TInt GetSyncTime( TTime& aTime ); |
|
494 |
|
495 /** |
|
496 * Sets Progress info |
|
497 * @since S60 5.1 |
|
498 * |
|
499 * @param aTransferred how many files transferred |
|
500 * @param aTotalCount how many will be trasferred |
|
501 * @return TInt, Error code |
|
502 */ |
|
503 IMPORT_C TInt SetProgressInfo( TInt aTransferred, TInt aTotalCount ); |
|
504 |
|
505 /** |
|
506 * Gets Progress info |
|
507 * |
|
508 * @since S60 5.1 |
|
509 * @param aTransferred how many files transferred |
|
510 * @param aTotalCount how many will be trasferred |
|
511 * @return TInt, Error code |
|
512 */ |
|
513 IMPORT_C TInt GetProgressInfo( |
|
514 TInt& aTransferred, |
|
515 TInt& aTotalCount ); |
|
516 |
|
517 /** |
|
518 * Sets Drives info |
|
519 * |
|
520 * @since S60 5.1 |
|
521 * @param aDrives, drives to be set into database |
|
522 * @return None |
|
523 */ |
|
524 IMPORT_C void SetDrivesL( RPointerArray<CCmDriveInfo>& aDrives ); |
|
525 |
|
526 /** |
|
527 * Remove media server info from database |
|
528 * |
|
529 * @since S60 5.1 |
|
530 * @param aUDN, server udn |
|
531 * @return TInt, Error code |
|
532 */ |
|
533 IMPORT_C TInt DeleteMediaServer( const TDesC8& aUDN ); |
|
534 |
|
535 /** |
|
536 * Remove fill rule from database |
|
537 * |
|
538 * @since S60 5.1 |
|
539 * @param aName, fill list name |
|
540 * @return TInt, Error code |
|
541 */ |
|
542 IMPORT_C TInt DeleteFillRuleByName( const TDesC8& aName ); |
|
543 |
|
544 /** |
|
545 * Delete all fill rules |
|
546 * |
|
547 * @since S60 5.1 |
|
548 * @param None |
|
549 * @return TInt, Error code |
|
550 */ |
|
551 IMPORT_C TInt DeleteAllFillRules(); |
|
552 |
|
553 /** |
|
554 * Delete all store rules |
|
555 * |
|
556 * @since S60 5.1 |
|
557 * @param None |
|
558 * @return Error code |
|
559 */ |
|
560 IMPORT_C TInt DeleteAllStoreRules(); |
|
561 |
|
562 /** |
|
563 * Deletes all fill files |
|
564 * |
|
565 * @since S60 5.1 |
|
566 * @param None |
|
567 * @return Error code |
|
568 */ |
|
569 IMPORT_C TInt DeleteFillFiles(); |
|
570 |
|
571 /** |
|
572 * Deletes all store files |
|
573 * |
|
574 * @since S60 5.1 |
|
575 * @param None |
|
576 * @return TInt, Error code |
|
577 */ |
|
578 IMPORT_C TInt DeleteStoreFiles(); |
|
579 |
|
580 /** |
|
581 * Delete deleted items |
|
582 * |
|
583 * @since S60 5.1 |
|
584 * @param None |
|
585 * @return None |
|
586 */ |
|
587 IMPORT_C void DeleteDeletedItemsL(); |
|
588 |
|
589 /** |
|
590 * Delete items by FillListId |
|
591 * |
|
592 * @since S60 5.1 |
|
593 * @param FillListId, fill list id |
|
594 * @return TInt, Error code |
|
595 */ |
|
596 IMPORT_C TInt DeleteItemsByFillListId( TInt aFillListId ); |
|
597 |
|
598 /** |
|
599 * Delete deleted media servers |
|
600 * |
|
601 * @since S60 5.1 |
|
602 * @param None |
|
603 * @return None |
|
604 */ |
|
605 IMPORT_C void DeleteDeletedMediaServersL(); |
|
606 |
|
607 /** |
|
608 * Deletes hash values |
|
609 * |
|
610 * @since S60 5.1 |
|
611 * @param aMediaServerId, media server id |
|
612 * @param aSearchIndex, search index |
|
613 * @return None |
|
614 */ |
|
615 IMPORT_C void DeleteHashValuesL( const TInt aMediaserverId, |
|
616 const TInt aSearchIndex ); |
|
617 |
|
618 /** |
|
619 * Update media server info |
|
620 * |
|
621 * @since S60 5.1 |
|
622 * @param aMediaServer, media server |
|
623 * @return TInt, Error code |
|
624 */ |
|
625 IMPORT_C TInt UpdateMediaServerInfo( CCmMediaServerFull* aMediaServer ); |
|
626 |
|
627 /** |
|
628 * Update status of the fill rule ( selected or not ) |
|
629 * |
|
630 * @since S60 5.1 |
|
631 * @param aName, list name |
|
632 * @param aSelected, selection status |
|
633 * @return TInt, Error code |
|
634 */ |
|
635 IMPORT_C TInt UpdateFillRuleSelected( |
|
636 const TDesC8& aName, |
|
637 TInt aSelected ); |
|
638 |
|
639 /** |
|
640 * Update Download history |
|
641 * |
|
642 * @since S60 5.1 |
|
643 * @param aMediaServerId, server id |
|
644 * @param aDownloadData, download data size |
|
645 * @param aDownloadTime, download time |
|
646 * @return TInt, Error code |
|
647 */ |
|
648 IMPORT_C TInt UpdateDownloadHistory( |
|
649 TUint aMediaServerId, |
|
650 TInt64& aDownloadData, |
|
651 TInt64& aDownloadTime ); |
|
652 |
|
653 /** |
|
654 * Update Upload history |
|
655 * |
|
656 * @since S60 5.1 |
|
657 * @param aMediaServerId, server id |
|
658 * @param aUploadData, upload data size |
|
659 * @param aUploadTime, upload time |
|
660 * @return TInt, Error code |
|
661 */ |
|
662 IMPORT_C TInt UpdateUploadHistory( |
|
663 TUint aMediaServerId, |
|
664 TInt64& aUploadData, |
|
665 TInt64& aUploadTime ); |
|
666 |
|
667 /** |
|
668 * Update status values |
|
669 * |
|
670 * @since S60 5.1 |
|
671 * @param aStatusValues, status values of items |
|
672 * @return TInt, Error code |
|
673 */ |
|
674 IMPORT_C TInt UpdateStatusValues( |
|
675 RPointerArray<CCmBaseListItem>& aStatusValues ); |
|
676 |
|
677 /** |
|
678 * Update fill list drive statuses |
|
679 * |
|
680 * @since S60 5.1 |
|
681 * @param aDrive, drive info |
|
682 * @para aDriveSelected, if ETrue drive selected but slot changed |
|
683 * @return None |
|
684 */ |
|
685 IMPORT_C void UpdateFillListDriveStatusesL( |
|
686 CCmDriveInfo* aOrigDrive, |
|
687 CCmDriveInfo* aNewDrive, |
|
688 TBool aDriveSelected ); |
|
689 |
|
690 /** |
|
691 * Update fill list item priorities |
|
692 * |
|
693 * @since S60 5.1 |
|
694 * @param aContainer, fill list container |
|
695 * @return TInt, Error code |
|
696 */ |
|
697 IMPORT_C TInt UpdateFillListItemPriority( |
|
698 CCmFillRuleContainer* aContainer ); |
|
699 |
|
700 /** |
|
701 * Update fill selection state into fill file table |
|
702 * |
|
703 * @since S60 5.1 |
|
704 * @param aListName, fill list name |
|
705 * @param aState, fill list status |
|
706 * @return None |
|
707 */ |
|
708 IMPORT_C void SetFillListStateL( |
|
709 const TUint aListName, |
|
710 TCmFillRuleStatus aState ); |
|
711 |
|
712 /** |
|
713 * |
|
714 * Restoring file statuses |
|
715 * @since S60 5.1 |
|
716 * @param aItems, array of filled items |
|
717 * @param aListName, list name |
|
718 * @return None |
|
719 */ |
|
720 IMPORT_C void RestoreFileStatusesL( |
|
721 const RPointerArray<CCmFillListItem>& aItems, |
|
722 const TDesC8& aListName ); |
|
723 |
|
724 /** |
|
725 * |
|
726 * Increment image shrinking history info |
|
727 * |
|
728 * @since S60 5.1 |
|
729 * @param aImageCount, image count |
|
730 * @param aMilliSeconds, shrinking time |
|
731 * @return TInt, Error code |
|
732 */ |
|
733 IMPORT_C TInt IncrementShrinkTimeL( |
|
734 TInt aImageCount, |
|
735 TInt aMilliSeconds ); |
|
736 |
|
737 /** |
|
738 * Returns size of the named list |
|
739 * |
|
740 * @since S60 5.1 |
|
741 * @param aType, List type |
|
742 * @param aListName, list name |
|
743 * @param aStatus, list status |
|
744 * @return TInt64, Size in bytes |
|
745 */ |
|
746 IMPORT_C TInt64 ListSize( |
|
747 TCmRuleType aType, |
|
748 const TDesC8& aListName, |
|
749 TUint aStatus ); |
|
750 |
|
751 /** |
|
752 * Returns file count which are waiting to be stored |
|
753 * |
|
754 * @since S60 5.1 |
|
755 * @param aStatus, file status |
|
756 * @return TInt, File count |
|
757 */ |
|
758 IMPORT_C TInt StoreFileCount( TUint aStatus ); |
|
759 |
|
760 /** |
|
761 * Returns file count which are waiting to be stored |
|
762 * |
|
763 * @since S60 5.1 |
|
764 * @param None |
|
765 * @return size of the list |
|
766 */ |
|
767 IMPORT_C TInt StoreFileCountNoDuplicates(); |
|
768 |
|
769 /** |
|
770 * Returns file count which are waiting to be filled |
|
771 * |
|
772 * @since S60 5.1 |
|
773 * @param aStatus, file status |
|
774 * @return TInt, File count |
|
775 */ |
|
776 IMPORT_C TInt FillFileCount( TUint aStatus ); |
|
777 |
|
778 /** |
|
779 * Returns data amount filled |
|
780 * @since S60 5.1 |
|
781 * @param aID id of fill rule |
|
782 * @return sum of file sizes |
|
783 */ |
|
784 IMPORT_C TInt64 BytesFilled( |
|
785 TUint aID ); |
|
786 |
|
787 /** |
|
788 * Returns data amount to be filled |
|
789 * @since S60 5.1 |
|
790 * @param aMediaServerId, media server id |
|
791 * @param aStatus, file status |
|
792 * @return TInt64, sum of file sizes |
|
793 */ |
|
794 IMPORT_C TInt64 KBytesToBeFilled( |
|
795 TUint8 aMediaServerId, |
|
796 TUint aStatus ); |
|
797 |
|
798 /** |
|
799 * Returns data amount to be stored |
|
800 * |
|
801 * @since S60 5.1 |
|
802 * @param aMediaServerId, media server id |
|
803 * @param aStatus, file status |
|
804 * @return TInt64, sum of file sizes |
|
805 */ |
|
806 IMPORT_C TInt64 KBytesToBeStored( |
|
807 TUint8 aMediaServerId, |
|
808 TUint aStatus ); |
|
809 |
|
810 /** |
|
811 * Updates list size and approx. transfer time |
|
812 * |
|
813 * @since S60 5.1 |
|
814 * @param aService, contentmanager service |
|
815 * @param aCount, item count |
|
816 * @param aTime, transfer time in milliseconds |
|
817 * @return TInt, error code |
|
818 */ |
|
819 IMPORT_C TInt UpdateTransferInfo( |
|
820 TCmService aService, |
|
821 TInt aCount, |
|
822 TInt aTime ); |
|
823 |
|
824 /** |
|
825 * Updates file status |
|
826 * |
|
827 * @since S60 v3.1 |
|
828 * @param aStatus, file status |
|
829 * @param aFid, file id |
|
830 * @param aMsId, server id |
|
831 * @return None |
|
832 */ |
|
833 IMPORT_C void UpdateStoreTransferStatus( |
|
834 TUint aStatus, |
|
835 TInt64 aFid, |
|
836 TInt64 aMsId ); |
|
837 |
|
838 /** |
|
839 * Updates file status |
|
840 * |
|
841 * @since S60 5.1 |
|
842 * @param aStatus, file status |
|
843 * @param aItem, fill list item |
|
844 * @return None |
|
845 */ |
|
846 IMPORT_C void UpdateFillTransferStatus( |
|
847 TUint aStatus, |
|
848 CCmFillListItem* aItem ); |
|
849 |
|
850 /** |
|
851 * Get list size and approx. transfer time |
|
852 * |
|
853 * @since S60 5.1 |
|
854 * @param aService, content manager service |
|
855 * @param aCount pieces, item count |
|
856 * @param aTime, transfer time in milliseconds |
|
857 * @return TInt, error code |
|
858 */ |
|
859 IMPORT_C TInt GetTransferInfo( |
|
860 TCmService aService, |
|
861 TInt& aCount, |
|
862 TInt& aTime ); |
|
863 |
|
864 /** |
|
865 * Files to be stored and included into specified list |
|
866 * |
|
867 * @since S60 5.1 |
|
868 * @param aListName, store list name |
|
869 * @param aStatus, list status |
|
870 * @param aCount, item count |
|
871 * @return TInt, error code |
|
872 */ |
|
873 IMPORT_C TInt GetStoreFileCount( |
|
874 const TDesC8& aListName, |
|
875 TUint aStatus, |
|
876 TInt& aCount ); |
|
877 |
|
878 /** |
|
879 * Files to be filled and included into specified list |
|
880 * |
|
881 * @since S60 5.1 |
|
882 * @param aListName, fill list name |
|
883 * @param aStatus, list status |
|
884 * @param aCount, item count |
|
885 * @return TInt, error code |
|
886 */ |
|
887 IMPORT_C TInt GetFillFileCount( |
|
888 const TDesC8& aListName, |
|
889 TUint aStatus, |
|
890 TInt& aCount ); |
|
891 |
|
892 /** |
|
893 * Files to be store |
|
894 * |
|
895 * @since S60 5.1 |
|
896 * @param aCount, file count |
|
897 * @param aStatus, file status |
|
898 * @return None |
|
899 */ |
|
900 IMPORT_C void GetStoreFileCountNoDuplicatesL( |
|
901 TInt& aCount, |
|
902 TUint aStatus ); |
|
903 |
|
904 /** |
|
905 * Sets fill list real information |
|
906 * |
|
907 * @since S60 5.1 |
|
908 * @param aListId, list id |
|
909 * @param aRealCount, item count |
|
910 * @param aRealSize, list size |
|
911 * @return None |
|
912 */ |
|
913 IMPORT_C void SetFillListRealCountAndSizeL( |
|
914 TInt64 aListId, |
|
915 TInt64 aRealCount, |
|
916 TInt64 aRealSize ); |
|
917 |
|
918 /** |
|
919 * update the fill rule realsize and realcount field |
|
920 * |
|
921 * @since S60 5.1 |
|
922 * @return TInt, error code |
|
923 */ |
|
924 IMPORT_C TInt UpdateFillRuleGroupInfo(); |
|
925 |
|
926 private: |
|
927 |
|
928 /** |
|
929 * Performs the first phase of two phase construction. |
|
930 */ |
|
931 CCmDmMain(); |
|
932 |
|
933 /** |
|
934 * Performs the second phase construction. |
|
935 */ |
|
936 void ConstructL(); |
|
937 |
|
938 |
|
939 private: |
|
940 |
|
941 /** |
|
942 * Pointer to SQLite connection class |
|
943 */ |
|
944 CCmDmSQLiteConnection* iConnection; // owned |
|
945 |
|
946 /** |
|
947 * Pointer to database maintenance class |
|
948 */ |
|
949 CCmDmSqlDbMaintenance* iMaintenance; // owned |
|
950 }; |
|
951 |
|
952 #endif // C_CMDMMAIN_H |
|