|
1 /* |
|
2 * Copyright (c) 2006 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 |
|
19 #ifndef _PREVIOUSLYINSTALLEDAPPSCACHE_H |
|
20 #define _PREVIOUSLYINSTALLEDAPPSCACHE_H |
|
21 #include <e32base.h> |
|
22 #include <e32cmn.h> |
|
23 |
|
24 // @released |
|
25 // @publishedPartner |
|
26 |
|
27 //class RFs; |
|
28 // It is assumed there is only ever ONE instance of this class |
|
29 class CPreviouslyInstalledAppsCache : public CBase |
|
30 { |
|
31 public: |
|
32 static CPreviouslyInstalledAppsCache *NewL(); |
|
33 ~CPreviouslyInstalledAppsCache(); |
|
34 |
|
35 /** |
|
36 * Read the cache from disk |
|
37 * |
|
38 * nb. Cache file absense is not counted as an error. |
|
39 */ |
|
40 void InitFromCacheFileL(); |
|
41 |
|
42 /** |
|
43 * Query the SIS registry and make sure ALL listed packages (not |
|
44 * augmentations) are in our cache. Does not flush to disk |
|
45 * |
|
46 * This needs ReadUserData |
|
47 */ |
|
48 void UpdateAllL(); |
|
49 |
|
50 /** |
|
51 * Query the SIS registry to check if the specified package is |
|
52 * registered add it to the cache. Does not flush to disk |
|
53 * |
|
54 * This does not need any capabilities. |
|
55 */ |
|
56 void UpdateAddL(TUid aUid); |
|
57 |
|
58 |
|
59 /** |
|
60 * Query if the specified package has ever been cached as installed. |
|
61 * |
|
62 * @param UID of package to query |
|
63 * @retval TBool ETrue if previously cached as installed |
|
64 */ |
|
65 TBool HasBeenPreviouslyInstalled(TUid aPackageId) const; |
|
66 |
|
67 /** |
|
68 * Flush cache to disk. |
|
69 */ |
|
70 void FlushToDiskL(); |
|
71 private: |
|
72 CPreviouslyInstalledAppsCache(); |
|
73 void ConstructL(); |
|
74 RArray<TUid> iPrevPkgUids; |
|
75 RFs iFs; |
|
76 }; |
|
77 |
|
78 #endif |