|
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: Auto-installs configurations from ROM drive to the C drive. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __hspsROMINSTALLER_H__ |
|
21 #define __hspsROMINSTALLER_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 #include "hspsthememanagement.h" |
|
27 |
|
28 #ifdef HSPS_LOG_ACTIVE |
|
29 class ChspsLogBus; |
|
30 #endif |
|
31 class ChspsThemeServer; |
|
32 class ChspsInstallationHandler; |
|
33 |
|
34 |
|
35 /** |
|
36 * @ingroup group_hspsserver |
|
37 * ROM installer |
|
38 * @lib hspsThemeServer.exe |
|
39 * @since S60 5.0 |
|
40 */ |
|
41 class ChspsRomInstaller : public CActive |
|
42 { |
|
43 public: // Constructors and destructors |
|
44 /** |
|
45 * NewL. |
|
46 * Two-phased constructor. |
|
47 * Creates a ChspsRomInstaller object using two phase construction, |
|
48 * and return a pointer to the created object. |
|
49 * @since S60 5.0 |
|
50 * @param aThemeServer is a reference to theme server instance |
|
51 * @param aFsSession is a reference to file server instance |
|
52 * @return A pointer to the created instance of ChspsRomInstaller. |
|
53 */ |
|
54 static ChspsRomInstaller* NewL( |
|
55 ChspsThemeServer& aThemeServer, |
|
56 RFs& aFsSession ); |
|
57 |
|
58 /** |
|
59 * NewLC. |
|
60 * Two-phased constructor. |
|
61 * Creates a ChspsClinet object using two phase construction, |
|
62 * and return a pointer to the created object. |
|
63 * @since S60 5.0 |
|
64 * @param aObserver The object to be used to handle updates from the server. |
|
65 * @return a pointer to the created instance of ChspsRomInstaller. |
|
66 */ |
|
67 static ChspsRomInstaller* NewLC( |
|
68 ChspsThemeServer& aThemeServer, |
|
69 RFs& aFsSession ); |
|
70 |
|
71 /** |
|
72 * ~ChspsRomInstaller. |
|
73 * Destructor. |
|
74 * Destroys the object and release all memory objects. |
|
75 * @since S60 5.0 |
|
76 */ |
|
77 virtual ~ChspsRomInstaller(); |
|
78 |
|
79 public: // New functions |
|
80 |
|
81 /** |
|
82 * Finds plugin_*.dat and app_*.dat files from Z\private\200159C0\install |
|
83 * File names are stored into iImportsArrayV1 member array |
|
84 * @since S60 5.0 |
|
85 */ |
|
86 void FindImportsV1L(); |
|
87 |
|
88 /** |
|
89 * Imports. |
|
90 * Returns a reference to the imports list, which is maintained by the class. |
|
91 * Contents of the list is set in FindImportsL() function. |
|
92 * @since S60 5.0 |
|
93 * @return an array of *.DAT files which were found from the ROM drive. |
|
94 */ |
|
95 const RPointerArray<HBufC>& ImportsV1(); |
|
96 |
|
97 /** |
|
98 * InstallTheme |
|
99 * Synchronous service for installing configurations from provided manifest files. |
|
100 * @since S60 5.0 |
|
101 * @param aFileName is name of the manifest file to be installed. |
|
102 * @return ThspsServiceCompletedMessage error code |
|
103 */ |
|
104 ThspsServiceCompletedMessage InstallThemeL( |
|
105 const TDesC& aFileName ); |
|
106 |
|
107 /** |
|
108 * ReinstallThemeL. |
|
109 * Synchronous service for re-installing corrupted application configurations |
|
110 * from an import (imports\app_*.dat file). |
|
111 * @since S60 5.0 |
|
112 * @param aAppUid is UID of an application |
|
113 * @param aConfigurationUid is UID of a HSPS configuration |
|
114 * @return ThspsServiceCompletedMessage error code |
|
115 */ |
|
116 ThspsServiceCompletedMessage ReinstallThemeL( |
|
117 const TInt aAppUid, |
|
118 const TInt aConfigurationUid ); |
|
119 |
|
120 /** |
|
121 * Gets names of the folders which should be installed from Z\private\200159C0\install |
|
122 * @since S60 5.0 |
|
123 */ |
|
124 void GetInstallationFoldersL( |
|
125 RPointerArray<HBufC>& aFolders ); |
|
126 |
|
127 #ifdef HSPS_LOG_ACTIVE |
|
128 /** |
|
129 * Set log bus. |
|
130 */ |
|
131 void SetLogBus( ChspsLogBus* aLogBus ); |
|
132 #endif |
|
133 |
|
134 protected: // Functions from base classes |
|
135 |
|
136 /** |
|
137 * RunL. |
|
138 * From CActive, callback function. |
|
139 * Invoked to handle responses from the server. |
|
140 * @since S60 5.0 |
|
141 */ |
|
142 void RunL(); |
|
143 |
|
144 /** |
|
145 * DoCancel. |
|
146 * From CActive, cancels any outstanding operation. |
|
147 * @since S60 5.0 |
|
148 */ |
|
149 void DoCancel(); |
|
150 |
|
151 /** |
|
152 * RunError. |
|
153 * From CActive Called when asynchronous request has failed |
|
154 * @since S60 5.0 |
|
155 */ |
|
156 TInt RunError( |
|
157 TInt aError ); |
|
158 |
|
159 protected: |
|
160 |
|
161 /** |
|
162 * ChspsRomInstaller. |
|
163 * Performs the first phase of two phase construction. |
|
164 * @since S60 5.0 |
|
165 * @param aObserver The object to be used to handle updates from the server. |
|
166 * @param aFsSession is a reference to file server instance |
|
167 */ |
|
168 ChspsRomInstaller( |
|
169 ChspsThemeServer& aThemeServer, |
|
170 RFs& aFsSession ); |
|
171 |
|
172 /** |
|
173 * ConstructL. |
|
174 * Performs the second phase construction of a ChspsRomInstaller object. |
|
175 * @since S60 5.0 |
|
176 */ |
|
177 void ConstructL(); |
|
178 |
|
179 /** |
|
180 * SetImportsFilterL. |
|
181 * Finds specific imports ("plugin_*.dat"/"app_*.dat" files) from ROM drive's |
|
182 * import folder. Search results are appended into iImportsArray member. |
|
183 * @since S60 5.0 |
|
184 * @param aFileFilter is a filter for finding the imports |
|
185 * @param |
|
186 * @return ETrue if files were found and added into the array |
|
187 */ |
|
188 TBool SetImportsFilterL( |
|
189 const TDesC& aFileFilter ); |
|
190 |
|
191 private: // Data |
|
192 |
|
193 ChspsThemeServer& iThemeServer; |
|
194 |
|
195 // Required by the file copying process |
|
196 RFs& iFsSession; |
|
197 |
|
198 // Installation handler |
|
199 ChspsInstallationHandler* iInstallationHandler; |
|
200 |
|
201 // Required by the installation process |
|
202 TBuf8<KMaxHeaderDataLength8> iHeaderData; |
|
203 |
|
204 // An array of found *.DAT files |
|
205 RPointerArray<HBufC> iImportsArrayV1; |
|
206 |
|
207 // Results of the previous installation |
|
208 ThspsServiceCompletedMessage iRet; |
|
209 |
|
210 #ifdef HSPS_LOG_ACTIVE |
|
211 /** |
|
212 * Log bus. Not owned. |
|
213 */ |
|
214 ChspsLogBus* iLogBus; |
|
215 #endif |
|
216 }; |
|
217 |
|
218 |
|
219 #endif //__hspsROMINSTALLER_H__ |
|
220 |
|
221 // End of File |