|
1 /* |
|
2 * Copyright (c) 2007-2007 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 the License "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: This Class provides information of particular package installed on phone. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef _PKGINFO_H__ |
|
21 #define _PKGINFO_H__ |
|
22 |
|
23 //Loesh : Moves these .h files from here |
|
24 //why some .h files coming in cpas |
|
25 |
|
26 #include <swi/sisregistrysession.h> |
|
27 #include <swi/sisregistryentry.h> |
|
28 #include<javaregistry.h> |
|
29 #include<javaregistryentry.h> |
|
30 #include<javaregistrypackageentry.h> |
|
31 |
|
32 #include <AppVersion.h> |
|
33 #include <BADESCA.H> // CDesC16Array |
|
34 |
|
35 #include "appManagercommon.h" |
|
36 |
|
37 |
|
38 |
|
39 _LIT8(KPkgName,"PackageName"); |
|
40 _LIT8(KUid,"Uid"); |
|
41 _LIT8(KVersion,"Version"); |
|
42 _LIT8(KVendor,"Vendor"); |
|
43 _LIT8(KDrive,"Drive"); |
|
44 _LIT( KDriveC, "C"); |
|
45 _LIT( KDrivec, "c"); |
|
46 _LIT( KDriveZ, "Z"); |
|
47 _LIT( KDrivez, "z"); |
|
48 |
|
49 |
|
50 /** |
|
51 * This Class provides the information of the User installed package |
|
52 * |
|
53 * @since Series60 v3.2 |
|
54 |
|
55 */ |
|
56 class CPkgInfo : public CBase , public MInfoMap |
|
57 { |
|
58 |
|
59 public: |
|
60 |
|
61 /** |
|
62 * Returns the instance of CPkgInfo. |
|
63 * @since Series60 v3.2 |
|
64 * @param aSisRegSession Pointer to the instance of Swi::RSisRegistrySession session |
|
65 * @return CPkgInfo* return the instance of CPkgInfo class |
|
66 */ |
|
67 |
|
68 |
|
69 static CPkgInfo* NewL( Swi::RSisRegistrySession* aSisRegSession); |
|
70 |
|
71 /** |
|
72 * Returns the instance of CPkgInfo. |
|
73 * @since Series60 v3.2 |
|
74 * @param aJavaReg Pointer to the instance of Java::CJavaRegistry session |
|
75 * @return CPkgInfo* return the instance of CPkgInfo class |
|
76 */ |
|
77 |
|
78 |
|
79 static CPkgInfo* NewL(Java::CJavaRegistry* aJavaReg); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 ~CPkgInfo(); |
|
85 |
|
86 /** |
|
87 * This function finds the value as per key given in argument. |
|
88 * @param aKey Key given to find corresponding value. |
|
89 * @param aVal value as per key. |
|
90 * @return TBool ETrue in case of key - value is found else EFalse. |
|
91 * @since Series60 v3.2 |
|
92 */ |
|
93 |
|
94 |
|
95 virtual TBool FindL(const TDesC8& aKey, TPtrC& aVal ); |
|
96 |
|
97 /** |
|
98 * This function gives the key value at a given index |
|
99 * @param aIndex TInt index value |
|
100 * @param aKeyVal Pointer to descriptor containing key . |
|
101 * @return TBool ETrue in case of key is found else EFalse. |
|
102 * @since Series60 v3.2 |
|
103 */ |
|
104 virtual TBool AtL( TInt aIndex, TDes8& aKeyVal ); |
|
105 |
|
106 /** |
|
107 * This function gives the number of keys |
|
108 * @param void |
|
109 * @return TInt Number of keys |
|
110 * @since Series60 v3.2 |
|
111 */ |
|
112 virtual TInt Count()const; |
|
113 |
|
114 /** |
|
115 * This function sets the appropriate entry as per uid |
|
116 * @param aUid TUid |
|
117 * @param aErrflg TBool ETrue if appropriate entry is found else false |
|
118 * @return void |
|
119 * @since Series60 v3.2 |
|
120 */ |
|
121 void SetEntryL( TUid aUid, TBool& aErrflg ); |
|
122 |
|
123 |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * Constructor |
|
129 * @param aSisRegSession Instance of Swi::RSisRegistrySession class |
|
130 * @since Series60 v3.2 |
|
131 */ |
|
132 CPkgInfo( Swi::RSisRegistrySession* aSisRegSession); |
|
133 |
|
134 /** |
|
135 * Constructor |
|
136 * @param aJavaReg Instance of Java::CJavaRegistry class |
|
137 * @since Series60 v3.2 |
|
138 */ |
|
139 CPkgInfo(Java::CJavaRegistry* aJavaReg); |
|
140 |
|
141 /** |
|
142 * Two-phased constructor |
|
143 * @return void |
|
144 * @since Series60 v3.2 |
|
145 */ |
|
146 void ConstructL(); |
|
147 |
|
148 /** |
|
149 * Gives the value as per key input for java installed packages |
|
150 * @param aKey Key |
|
151 * @param aVal Value as per key input |
|
152 * @return TBool |
|
153 * @since Series60 v3.2 |
|
154 */ |
|
155 TBool GetJavaInfoL(const TDesC8& aKey, TPtrC& aVal); |
|
156 |
|
157 /** |
|
158 * Gives the value as per key input for Series60(Sisx) installed packages |
|
159 * @param aKey Key |
|
160 * @param aVal Value as per key input |
|
161 * @return TBool |
|
162 * @since Series60 v3.2 |
|
163 */ |
|
164 TBool GetSisxInfoL(const TDesC8& aKey, TPtrC& aVal); |
|
165 |
|
166 private: |
|
167 |
|
168 /** |
|
169 * Uid of the package |
|
170 */ |
|
171 TUid iUid; |
|
172 /** |
|
173 * Instance of Swi::RSisRegistrySession class |
|
174 */ |
|
175 Swi::RSisRegistrySession* iSisRegSession; |
|
176 /** |
|
177 * Instance of Swi::RSisRegistryEntry class |
|
178 */ |
|
179 Swi::RSisRegistryEntry iSisRegEntry; |
|
180 |
|
181 /** |
|
182 * Instance of Java::CJavaRegistry class |
|
183 */ |
|
184 Java::CJavaRegistry* iJavaReg; |
|
185 |
|
186 /** |
|
187 * Instance of Java::CJavaRegistryEntry class |
|
188 */ |
|
189 Java::CJavaRegistryEntry* iJavaRegEntry; |
|
190 |
|
191 /** |
|
192 * Pointer to the array containing keys |
|
193 */ |
|
194 CDesC8Array* iKeyArray; |
|
195 |
|
196 RPointerArray<HBufC> iKeyValArray; |
|
197 |
|
198 }; |
|
199 |
|
200 |
|
201 #endif |