31
|
1 |
/*
|
|
2 |
* Copyright (c) 2004-2009 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:
|
|
15 |
* RSisRegistrySession - external client registry session interface
|
|
16 |
* The defined fuctionality is used by clients to access the registry as a whole
|
|
17 |
* and to perform registry global searches.
|
|
18 |
* The access to a specific functionality is depends on the client capabilities
|
|
19 |
* and may be restricted.
|
|
20 |
*
|
|
21 |
*/
|
|
22 |
|
|
23 |
|
|
24 |
/**
|
|
25 |
@file
|
|
26 |
@publishedPartner
|
|
27 |
@released
|
|
28 |
*/
|
|
29 |
|
|
30 |
#ifndef __SISREGISTRYSESSION_H__
|
|
31 |
#define __SISREGISTRYSESSION_H__
|
|
32 |
|
|
33 |
#include <e32std.h>
|
|
34 |
#include <f32file.h>
|
|
35 |
#include <swi/sisregistrylog.h>
|
|
36 |
|
|
37 |
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
|
|
38 |
#include <usif/usifcommon.h>
|
|
39 |
#endif
|
|
40 |
|
|
41 |
// Use Char 0xFF to indicate no drive is selected
|
|
42 |
const TInt KNoDriveSelected = 0xFF;
|
|
43 |
|
|
44 |
namespace Swi
|
|
45 |
{
|
|
46 |
class CHashContainer;
|
|
47 |
class CSisRegistryPackage;
|
|
48 |
|
|
49 |
/**
|
|
50 |
* External client registry session interface
|
|
51 |
*
|
|
52 |
* @publishedPartner
|
|
53 |
* @released
|
|
54 |
*/
|
|
55 |
class RSisRegistrySession : public RSessionBase
|
|
56 |
{
|
|
57 |
public:
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Connect to the server, attempt to start it if it is not yet running
|
|
61 |
*
|
|
62 |
* @return KErrNone if successful or an error code
|
|
63 |
*/
|
|
64 |
IMPORT_C TInt Connect();
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Returns an array of installed uids (excludes augmentations).
|
|
68 |
* The array is supplied by the client which is then populated.
|
|
69 |
* There should be no assumption about the order in which the uids are put
|
|
70 |
* in it as it is implementation dependent.
|
|
71 |
*
|
|
72 |
* @param aUids The array object to be populated.
|
|
73 |
* @capability ReadUserData
|
|
74 |
*
|
|
75 |
*/
|
|
76 |
IMPORT_C void InstalledUidsL(RArray<TUid>& aUids);
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Returns an array of the curently installed packages (including augmentations).
|
|
80 |
*
|
|
81 |
*
|
|
82 |
* @param aPackages The array of installed packages
|
|
83 |
* @capability ReadUserData
|
|
84 |
*
|
|
85 |
*/
|
|
86 |
IMPORT_C void InstalledPackagesL(RPointerArray<CSisRegistryPackage>& aPackages);
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Checks whether or not the package identified by this UID is installed.
|
|
90 |
*
|
|
91 |
* @param aUid The uid to search for
|
|
92 |
*
|
|
93 |
* @return ETrue if the Uid is installed
|
|
94 |
* EFalse otherwise
|
|
95 |
*/
|
|
96 |
IMPORT_C TBool IsInstalledL(TUid aUid);
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Checks whether or not the package, identified by this controller is installed.
|
|
100 |
*
|
|
101 |
* @param aController The controller (as raw binary representation) to search for
|
|
102 |
*
|
|
103 |
* @return ETrue if the controller is installed
|
|
104 |
* EFalse otherwise
|
|
105 |
*/
|
|
106 |
IMPORT_C TBool IsInstalledL(TDesC8& aController);
|
|
107 |
|
|
108 |
/**
|
|
109 |
* Query whether or not a file is tagged as modifiable.
|
|
110 |
* @note The hash value for non-modifiable content should stay the same.
|
|
111 |
*
|
|
112 |
* @param aFileName The filename (incl full path) to be used to search the entries
|
|
113 |
*
|
|
114 |
* @return ETrue if it can be modified
|
|
115 |
* EFalse otherwise
|
|
116 |
*/
|
|
117 |
IMPORT_C TBool ModifiableL(const TDesC& aFileName);
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Returns a pointer to the hash for this file
|
|
121 |
*
|
|
122 |
* @param aFileName The filename (incl full path) to be searched for
|
|
123 |
*
|
|
124 |
* @return A new CHashContainer object representing the hash.
|
|
125 |
*/
|
|
126 |
IMPORT_C CHashContainer* HashL(const TDesC& aFileName);
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Returns a pointer to package containing this Sid
|
|
130 |
*
|
|
131 |
* @param aSid The Sid of an application for which the package is requested
|
|
132 |
*
|
|
133 |
* @return A new CSisRegistryPackage object associated with the Sid.
|
|
134 |
*/
|
|
135 |
IMPORT_C CSisRegistryPackage* SidToPackageL(TUid aSid);
|
|
136 |
|
|
137 |
/**
|
|
138 |
* Queries the registry for an installed filename relating to a specific sid
|
|
139 |
*
|
|
140 |
* @param aSid the sid of a file that was installed
|
|
141 |
* @param aFileName on return the filename found
|
|
142 |
*/
|
|
143 |
IMPORT_C void SidToFileNameL(TUid aSid,TDes& aFileName);
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Queries the registry for an installed filename relating to a specific sid
|
|
147 |
* This function will return only a sid that is associated to a specific drive.
|
|
148 |
* This function leaves with KErrNotFound if not exact macth is found ( Sid associated to drive)
|
|
149 |
*
|
|
150 |
* @param aSid the sid of a file that was installed
|
|
151 |
* @param aFileName on return the filename found
|
|
152 |
* @param aDrive specifies on which drive the sid is expected to be found.
|
|
153 |
*/
|
|
154 |
IMPORT_C void SidToFileNameL(TUid aSid,TDes& aFileName, TDriveUnit aDrive);
|
|
155 |
|
|
156 |
IMPORT_C TBool IsSidPresentL(TUid aSid);
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Retrieve the enteries in log file
|
|
160 |
*
|
|
161 |
* @capability ReadUserData
|
|
162 |
* @param aLogFile The caller supplies an empty array of CLogEntry which is loaded
|
|
163 |
* with a enteries in log file. If Log file is not present then array count will be
|
|
164 |
* zero. The caller is responsible for deleting all memory.
|
|
165 |
*/
|
|
166 |
IMPORT_C void RetrieveLogFileL(RPointerArray<CLogEntry>& aLogFile);
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Returns an array of the currently installed packages which can be removed
|
|
170 |
* (including augmentations).
|
|
171 |
*
|
|
172 |
* @capability ReadUserData
|
|
173 |
* @param aPackages The array of installed packages which are removable
|
|
174 |
*/
|
|
175 |
IMPORT_C void RemovablePackagesL(RPointerArray<CSisRegistryPackage>& aPackages);
|
|
176 |
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Checks to see if a recovery needs to take place. If so, failed
|
|
180 |
* transactions are rolled back, and the cache regenerated.
|
|
181 |
*/
|
|
182 |
IMPORT_C void RecoverL();
|
|
183 |
|
|
184 |
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
|
|
185 |
/**
|
|
186 |
@internalComponent
|
|
187 |
* Verifies whether a file is registered to any existing component. Please note that this function does not support wildcards - both in the file name, and in the list of owned files in the registry.
|
|
188 |
*/
|
|
189 |
IMPORT_C TBool IsFileRegisteredL(const TDesC& aFileName);
|
|
190 |
|
|
191 |
/**
|
|
192 |
@internalAll
|
|
193 |
* Returns the SCR component id for the base component (i.e. not an SP package/augmentation) with the given UID.
|
|
194 |
*/
|
|
195 |
IMPORT_C Usif::TComponentId GetComponentIdForUidL(const TUid& aUid);
|
|
196 |
#endif
|
|
197 |
|
|
198 |
protected:
|
|
199 |
/**
|
|
200 |
* @internalComponent
|
|
201 |
*/
|
|
202 |
HBufC8* SendReceiveBufferLC(TInt aMessage);
|
|
203 |
/**
|
|
204 |
* @internalComponent
|
|
205 |
*/
|
|
206 |
HBufC8* SendReceiveBufferLC(TInt aMessage, TPtrC8 aInputBuffer);
|
|
207 |
/**
|
|
208 |
* @internalComponent
|
|
209 |
*/
|
|
210 |
HBufC8* SendReceiveBufferLC(TInt aMessage, const TDesC& aInputDescriptor);
|
|
211 |
/**
|
|
212 |
* @internalComponent
|
|
213 |
*/
|
|
214 |
HBufC8* SendReceiveBufferLC(TInt aMessage, TPtrC8 aInputBuffer, TInt aThirdArgument);
|
|
215 |
};
|
|
216 |
|
|
217 |
} // namespace
|
|
218 |
#endif
|