30
|
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 |
* @param aInstallUdaEmmc is set if UDA and eMMC drives should be utilized
|
|
53 |
* @return A pointer to the created instance of ChspsRomInstaller.
|
|
54 |
*/
|
|
55 |
static ChspsRomInstaller* NewL(
|
|
56 |
ChspsThemeServer& aThemeServer,
|
|
57 |
RFs& aFsSession,
|
|
58 |
const TBool aInstallUdaEmmc = ETrue );
|
|
59 |
|
|
60 |
|
|
61 |
/**
|
|
62 |
* ~ChspsRomInstaller.
|
|
63 |
* Destructor.
|
|
64 |
* Destroys the object and release all memory objects.
|
|
65 |
* @since S60 5.0
|
|
66 |
*/
|
|
67 |
virtual ~ChspsRomInstaller();
|
|
68 |
|
|
69 |
public: // New functions
|
|
70 |
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Installs all plugin configurations which can be found from the
|
|
74 |
* internal drives.
|
|
75 |
* @since S60 5.2
|
|
76 |
*/
|
|
77 |
void InstallL();
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Installs a plugin configuration from the provided manifest file (synchronous).
|
|
81 |
* @since S60 5.0
|
|
82 |
* @param aFileName is name of the manifest file to be installed.
|
|
83 |
* @return ThspsServiceCompletedMessage error code
|
|
84 |
*/
|
|
85 |
ThspsServiceCompletedMessage InstallThemeL(
|
|
86 |
const TDesC& aFileName );
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Re-installs an application plugin configuration (synchronous).
|
|
90 |
* @since S60 5.0
|
|
91 |
* @param aAppUid is UID of an application
|
|
92 |
* @param aConfigurationUid is UID of an application plugin configuration
|
|
93 |
* @return ThspsServiceCompletedMessage error code
|
|
94 |
*/
|
|
95 |
ThspsServiceCompletedMessage ReinstallThemeL(
|
|
96 |
const TInt aAppUid,
|
|
97 |
const TInt aConfigurationUid );
|
|
98 |
|
|
99 |
#ifdef HSPS_LOG_ACTIVE
|
|
100 |
/**
|
|
101 |
* Set log bus.
|
|
102 |
*/
|
|
103 |
void SetLogBus( ChspsLogBus* aLogBus );
|
|
104 |
#endif
|
|
105 |
|
|
106 |
protected: // Functions from base classes
|
|
107 |
|
|
108 |
/**
|
|
109 |
* RunL.
|
|
110 |
* From CActive, callback function.
|
|
111 |
* Invoked to handle responses from the server.
|
|
112 |
* @since S60 5.0
|
|
113 |
*/
|
|
114 |
void RunL();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* DoCancel.
|
|
118 |
* From CActive, cancels any outstanding operation.
|
|
119 |
* @since S60 5.0
|
|
120 |
*/
|
|
121 |
void DoCancel();
|
|
122 |
|
|
123 |
/**
|
|
124 |
* RunError.
|
|
125 |
* From CActive Called when asynchronous request has failed
|
|
126 |
* @since S60 5.0
|
|
127 |
*/
|
|
128 |
TInt RunError(
|
|
129 |
TInt aError );
|
|
130 |
|
|
131 |
protected:
|
|
132 |
|
|
133 |
/**
|
|
134 |
* ChspsRomInstaller.
|
|
135 |
* Performs the first phase of two phase construction.
|
|
136 |
* @since S60 5.0
|
|
137 |
* @param aObserver The object to be used to handle updates from the server.
|
|
138 |
* @param aFsSession is a reference to file server instance
|
|
139 |
* @param aInstallUdaEmmc is set if UDA and eMMC drives should be utilized
|
|
140 |
*/
|
|
141 |
ChspsRomInstaller(
|
|
142 |
ChspsThemeServer& aThemeServer,
|
|
143 |
RFs& aFsSession,
|
|
144 |
const TBool aInstallUdaEmmc );
|
|
145 |
|
|
146 |
/**
|
|
147 |
* ConstructL.
|
|
148 |
* Performs the second phase construction of a ChspsRomInstaller object.
|
|
149 |
* @since S60 5.0
|
|
150 |
*/
|
|
151 |
void ConstructL();
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Retrieves manifest files from all internal drives under the
|
|
155 |
* \\private\200159C0\install\ path.
|
|
156 |
* @since S60 5.2
|
|
157 |
* @param aFileArray An array of file names
|
|
158 |
*/
|
|
159 |
void FindInstallFilesL(
|
|
160 |
RPointerArray<HBufC>& aFileArray );
|
|
161 |
void DoFindInstallFilesL(
|
|
162 |
RPointerArray<HBufC>& aFileArray,
|
|
163 |
const TDesC& aPath );
|
|
164 |
|
|
165 |
/**
|
|
166 |
* Retrieves manifest files from all internal drives under the
|
|
167 |
* \\private\200159C0\import\ path.
|
|
168 |
* @since S60 5.2
|
|
169 |
* @param aFileArray An array of file names
|
|
170 |
*/
|
|
171 |
void FindImportFilesL(
|
|
172 |
RPointerArray<HBufC>& aFileArray );
|
|
173 |
void DoFindImportFilesL(
|
|
174 |
RPointerArray<HBufC>& aFileArray,
|
|
175 |
const TDesC& aPath );
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Finds an installation file from a directory structure
|
|
179 |
* which has UID in hex format as folder name.
|
|
180 |
* @since S60 5.2
|
|
181 |
* @param aConfigurationUid Configuration to be found
|
|
182 |
* @param aManifest Found manifest file
|
|
183 |
*/
|
|
184 |
void FindInstallationFileL(
|
|
185 |
const TInt aConfigurationUid,
|
|
186 |
TFileName& aManifest );
|
|
187 |
|
|
188 |
private: // Data
|
|
189 |
|
|
190 |
ChspsThemeServer& iThemeServer;
|
|
191 |
|
|
192 |
// Required by the file copying process
|
|
193 |
RFs& iFsSession;
|
|
194 |
|
|
195 |
// Installation handler
|
|
196 |
ChspsInstallationHandler* iInstallationHandler;
|
|
197 |
|
|
198 |
// Required by the installation process
|
|
199 |
TBuf8<KMaxHeaderDataLength8> iHeaderData;
|
|
200 |
|
|
201 |
// Results of the previous installation
|
|
202 |
ThspsServiceCompletedMessage iRet;
|
|
203 |
|
|
204 |
#ifdef HSPS_LOG_ACTIVE
|
|
205 |
/**
|
|
206 |
* Log bus. Not owned.
|
|
207 |
*/
|
|
208 |
ChspsLogBus* iLogBus;
|
|
209 |
#endif
|
|
210 |
|
|
211 |
// Set if plug-ins should be installed from UDA and eMMC drives
|
|
212 |
TBool iInstallUdaEmmc;
|
|
213 |
};
|
|
214 |
|
|
215 |
|
|
216 |
#endif //__hspsROMINSTALLER_H__
|
|
217 |
|
|
218 |
// End of File
|