author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:53:46 +0300 | |
branch | RCL_3 |
changeset 130 | 67f2ed48ad91 |
parent 118 | 8baec10861af |
permissions | -rw-r--r-- |
114 | 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: |
|
15 |
* |
|
16 |
* Installation Handler. |
|
17 |
* |
|
18 |
* |
|
19 |
* ChspsInstallatioHandler is a server-side implementation of HSPS Configuration |
|
20 |
* Management Services. |
|
21 |
* The Installation Service is intended to serve the HSPS SAPI client only. |
|
22 |
* |
|
23 |
* Services: |
|
24 |
* 1) reads installation instructions from a manifest-file |
|
25 |
* 2) parses and updates xml configuration into a binary representation (ODT's DOM) |
|
26 |
* 3) stores various resources, localized and common, into Plug-in Repository |
|
27 |
* (a.k.a. Definition Repository) |
|
28 |
* |
|
29 |
* When installation is successful, Installation Handler utilizes HSPS Definition |
|
30 |
* Repository to store the results. All resources are stored on Definition Repository |
|
31 |
* and their related information is stored on the list of ChspsResource-objects |
|
32 |
* - a resource list. This list of ChspsResource-objects is called Resource List. |
|
33 |
* For more information, see hspsResource documentation. |
|
34 |
* |
|
35 |
* On theme updates, Installation Handler deploys ChspsSecurityEnforcer to control |
|
36 |
* update rights. For more information, see ChspsSecurityEnforcer documentation |
|
37 |
* and ChspsInstallatioHandler documentation |
|
38 |
* |
|
39 |
* |
|
40 |
*/ |
|
41 |
||
42 |
||
43 |
||
44 |
#ifndef __hspsINSTALLATIONHANDLER_H__ |
|
45 |
#define __hspsINSTALLATIONHANDLER_H__ |
|
46 |
||
47 |
#include <contenthandler.h> |
|
48 |
#include <parser.h> |
|
49 |
||
50 |
#include "hspsthememanagement.h" |
|
51 |
#include "hspsresource.h" |
|
52 |
#include "hspsresult.h" |
|
53 |
||
54 |
#ifdef HSPS_LOG_ACTIVE |
|
55 |
class ChspsLogBus; |
|
56 |
#endif |
|
57 |
class CRepository; |
|
58 |
class ChspsThemeServer; |
|
59 |
class ChspsDefinitionRepository; |
|
60 |
class ChspsDefinitionEngineInterface; |
|
61 |
class ChspsODT; |
|
62 |
class ChspsDomNode; |
|
63 |
class ChspsDomStringPool; |
|
64 |
class ChspsSecurityEnforcer; |
|
65 |
class ChspsResource; |
|
66 |
class ChspsDomList; |
|
67 |
||
68 |
using namespace Xml; |
|
69 |
||
70 |
#if defined(WINSCW) || defined(__WINS__) |
|
71 |
const ThspsFamily KDefaultFamily = EhspsFamilyQhd_tch; |
|
72 |
#endif |
|
73 |
||
74 |
enum TInstallationMode |
|
75 |
{ |
|
76 |
EAsynchronousObject, |
|
77 |
EServiceHandler |
|
78 |
}; |
|
79 |
||
80 |
/** |
|
81 |
* Class ChspsInstallationHandler. |
|
82 |
* ChspsInstallationHandler performs all theme installation related functionality for hspsThemeServer. |
|
83 |
* |
|
84 |
* Class inheritance: |
|
85 |
* ================== |
|
86 |
* ChspsInstallationHandler implements MhspsInstallationService from HSPS Theme Management Service |
|
87 |
* and MContentHandler for XML-parsing of manifest file. For more information, see the architecture |
|
88 |
* description in the beginning of this file. |
|
89 |
* |
|
90 |
* Functionality: |
|
91 |
* ============== |
|
92 |
* ChspsInstallationHandler offer high- and low-level API-functionality. High-level and low-level |
|
93 |
* calls are diffrentiated by their parametrization. High-level parametrization is directed to the |
|
94 |
* be used by applications which need human readable data and offer a user interface. Low-level |
|
95 |
* parametrization is directed to the machine-originated requestors like OTA Push or DM (Device |
|
96 |
* Management) sub-systems where data is not needed to understand semanticly. |
|
97 |
* Processing the installation task can be synchronous or asynchronous. Synchronous mode is |
|
98 |
* applied everytime an installation is initiated. Application Theme may include resources. |
|
99 |
* Importing these resources to the target device may need conversions. Such resources like some |
|
100 |
* audio files etc., can be imported directly, however, most of the image-resources must be fitted |
|
101 |
* for the target device because target screen device's color depth and/or pixel density varies. |
|
102 |
* In this case, the needed conversions will be executed asynchronously. Asynchronous installation |
|
103 |
* is executed in phases - resource by resource. Client application must initiate asynchronous mode |
|
104 |
* by calling hspsInstallNextPhaseL() after testing that the synchronous call hspsInstallTheme() |
|
105 |
* has returned EhspsInstallPhaseSuccess return code. This means that there are resources to convert |
|
106 |
* asynchronoulsly. The rest of the asynchronous installation phases will be executed automatically, |
|
107 |
* however, installation can be interrupted by calling hspsCancelInstallTheme() at any time. |
|
108 |
* If installation is canceled, installation handler initiates roll-back functionality removing |
|
109 |
* inconsistent installation. |
|
110 |
* Installation Service uses specific manifest-file format to get informed about the xml, css, dtd, |
|
111 |
* and resource files to be installed. Resource files might be locale-specific or generic as well. |
|
112 |
* HSPS Definition Repository takes care of saving everything on their appropriate places in the |
|
113 |
* target device. Repository, i.e. theme storage, is loacted on hspsThemeServer's private-folder. |
|
114 |
* The storage is organized by the information contained in ODT-header. |
|
115 |
* Locales are instructed in manifest file also. Manifest file's file-extension must be .dat, but |
|
116 |
* actually, the file-name can be whatever, however, when low-level parametrization is used, the |
|
117 |
* name must be "manifest.dat" and it must be the last file extracted from the installation package. |
|
118 |
* For more information of manifest-file format, see "HSPS Manifest File User Guide.doc". |
|
119 |
* |
|
120 |
* Installation functions can return one of the following ThspsServiceCompletedMessage-codes: |
|
121 |
* - EhspsInstallThemeSuccess, |
|
122 |
* - EhspsInstallPhaseSuccess, or |
|
123 |
* - EhspsInstallThemeFailed. |
|
124 |
* |
|
125 |
* Client application must implement MhspsThemeManagementServiceObserver-interface and listen the |
|
126 |
* messages mentionaed. Let it be emphasised that both synchronous and asynchronous calls can return |
|
127 |
* the codes above. Installation functions may also return one of the following codes: |
|
128 |
* - EhspsServiceRequestSheduled, or |
|
129 |
* - EhspsServiceRequestError. |
|
130 |
* |
|
131 |
* For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. |
|
132 |
* |
|
133 |
* @ingroup group_hspsserversession |
|
134 |
* @lib hspsThemeServer.exe |
|
135 |
* @since S60 5.0 |
|
136 |
*/ |
|
137 |
class ChspsInstallationHandler : public CBase, |
|
138 |
public MhspsInstallationService, |
|
139 |
public MContentHandler |
|
140 |
{ |
|
141 |
public: |
|
142 |
||
143 |
public: |
|
144 |
/** |
|
145 |
* Two-phased constructor. |
|
146 |
*/ |
|
147 |
static ChspsInstallationHandler* NewL( ChspsThemeServer& aThemeServer ); |
|
148 |
static ChspsInstallationHandler* NewLC( ChspsThemeServer& aThemeServer ); |
|
149 |
||
150 |
/** |
|
151 |
* Destructor. |
|
152 |
*/ |
|
153 |
~ChspsInstallationHandler(); |
|
154 |
||
155 |
public: // New functions |
|
156 |
||
157 |
/** |
|
158 |
* ServiceInstallThemeL |
|
159 |
* Starts the actual installation in ChspsInstallationHandler. |
|
160 |
* @since S60 5.0 |
|
161 |
* @param aMessage Message from client |
|
162 |
*/ |
|
163 |
void ServiceInstallThemeL( |
|
164 |
const RMessage2& aMessage); |
|
165 |
||
166 |
/** |
|
167 |
* ServiceInstallNextPhaseL |
|
168 |
* Starts subsequent installation phases. |
|
169 |
* @since S60 5.0 |
|
170 |
* @param aMessage Message from client |
|
171 |
*/ |
|
172 |
void ServiceInstallNextPhaseL( |
|
173 |
const RMessage2& aMessage); |
|
174 |
||
175 |
/** |
|
176 |
* hspsInstallNextPhase |
|
177 |
* @since S60 5.0 |
|
178 |
* This is server-side only function. |
|
179 |
* @param aHeaderData will return ODT-header of the latest installation phase in serialized |
|
180 |
* (i.e. marshalled) |
|
181 |
* data mode. This follows the low-level parametrization schema. |
|
182 |
* @param aRequestStatus will return the status of the asynchronous request returned by |
|
183 |
* installer. |
|
184 |
* @return TInthspsServiceCompletedMessage expressing the result of the call. |
|
185 |
*/ |
|
186 |
void hspsInstallNextPhaseL( |
|
187 |
TDes8& aHeaderData, |
|
188 |
TRequestStatus& aRequestStatus ); |
|
189 |
||
190 |
/** |
|
191 |
* CheckAutoInstallationValidityL |
|
192 |
* Checks if auto installation of a theme is permitted |
|
193 |
* @since S60 5.0 |
|
194 |
* This is server-side only function. |
|
195 |
* @return TBool ETrue if auto installation can proceed. |
|
196 |
*/ |
|
197 |
TBool CheckAutoInstallationValidityL(); |
|
198 |
||
199 |
#ifdef HSPS_LOG_ACTIVE |
|
200 |
/** |
|
201 |
* Set log bus. |
|
202 |
*/ |
|
203 |
void SetLogBus( ChspsLogBus* aLogBus ); |
|
204 |
#endif |
|
205 |
||
206 |
/** |
|
207 |
* Disables "configuration was installed" notifications |
|
208 |
* @since S60 5.0 |
|
209 |
*/ |
|
210 |
void DisableNotifications(); |
|
211 |
||
212 |
/** |
|
213 |
* Disables installation of UDA and eMMC content. |
|
214 |
* @since S60 5.2 |
|
215 |
*/ |
|
216 |
void DisableUdaEmmcInstallations(); |
|
217 |
||
218 |
public: // Functions from base classes |
|
219 |
||
220 |
/** |
|
221 |
* From MhspsInstallationService hspsInstallTheme |
|
222 |
* |
|
223 |
* @since S60 5.0 |
|
224 |
* @param aManifestFileName is the full path to the installation script file - a manifest |
|
225 |
* file. |
|
226 |
* @param aHeader is an empty ChspsODT-object in which a valid ODT-header of the newly |
|
227 |
* installed theme will be returned if the request is successful. The use of |
|
228 |
* ChspsODT-type parameter follows the high-level parametrization schema. |
|
229 |
* @return ThspsServiceCompletedMessage expressing the result of the call. |
|
230 |
*/ |
|
231 |
inline ThspsServiceCompletedMessage hspsInstallTheme( |
|
232 |
const TDesC& /*aManifestFileName*/, |
|
233 |
ChspsODT& /*aHeader*/ ); |
|
234 |
||
235 |
/** |
|
236 |
* From MhspsInstallationService hspsInstallTheme |
|
237 |
* |
|
238 |
* @since S60 5.0 |
|
239 |
* @param aManifestFileName is full path of the installation script file - a manifest file |
|
240 |
* @param aHeaderData will return ODT-header of the newly installed theme in serialized |
|
241 |
* (i.e. marshalled) |
|
242 |
* data mode. This follows the low-level parametrization schema. |
|
243 |
* @return ThspsServiceCompletedMessage expressing the result of the call. |
|
244 |
*/ |
|
245 |
ThspsServiceCompletedMessage hspsInstallTheme( |
|
246 |
const TDesC& aManifestFileName, |
|
247 |
TDes8& aHeaderData ); |
|
248 |
||
249 |
/** |
|
250 |
* Parses the manifest file and requests installation of next phases. |
|
251 |
* @since S60 5.2 |
|
252 |
* @param aManifest is full path of the installation script file - a manifest file |
|
253 |
*/ |
|
254 |
void DoInstallThemeL( |
|
255 |
const TDesC& aManifest ); |
|
256 |
||
257 |
/** |
|
258 |
* From MhspsInstallationService hspsInstallNextPhaseL |
|
259 |
* |
|
260 |
* @since S60 5.0 |
|
261 |
* @param aHeader is an empty ChspsODT-object in which a valid ODT-header of the latest |
|
262 |
* installation phase completed if the request was successful. The use of ChspsODT-type |
|
263 |
* parameter follow the high-level parametrization schema. |
|
264 |
* @return ThspsServiceCompletedMessage expressing the result of the call. |
|
265 |
*/ |
|
266 |
inline ThspsServiceCompletedMessage hspsInstallNextPhaseL( |
|
267 |
ChspsODT& /*aHeader*/ ); |
|
268 |
||
269 |
/** |
|
270 |
* From MhspsInstallationService hspsInstallNextPhaseL |
|
271 |
* |
|
272 |
* @since S60 5.0 |
|
273 |
* @param aHeaderData will return ODT-header of the latest installation phase in |
|
274 |
* serialized (i.e. marshalled) data mode. This follows the low-level |
|
275 |
* parametrization schema. |
|
276 |
* @return ThspsServiceCompletedMessage expressing the result of the call. |
|
277 |
*/ |
|
278 |
ThspsServiceCompletedMessage hspsInstallNextPhaseL( |
|
279 |
TDes8& aHeaderData ); |
|
280 |
||
281 |
/** |
|
282 |
* From MhspsInstallationService hspsCancelInstallTheme |
|
283 |
* |
|
284 |
* @since S60 5.0 |
|
285 |
* @return ThspsServiceCompletedMessage expressing the result of the call. |
|
286 |
*/ |
|
287 |
ThspsServiceCompletedMessage hspsCancelInstallTheme(); |
|
288 |
||
289 |
//From MContentHandler |
|
290 |
||
291 |
/** |
|
292 |
* OnStartDocumentL |
|
293 |
* @since S60 5.0 |
|
294 |
* This method is a callback to indicate the start of the document. |
|
295 |
* @param aDocParam Specifies the various parameters of the document. |
|
296 |
* @arg aDocParam.iCharacterSetName The character encoding of the document. |
|
297 |
* @param aErrorCode is the error code. |
|
298 |
* If this is not KErrNone then special action may be required. |
|
299 |
*/ |
|
300 |
inline void OnStartDocumentL( |
|
301 |
const RDocumentParameters& aDocParam, |
|
302 |
TInt aErrorCode); |
|
303 |
||
304 |
/** |
|
305 |
* OnEndDocumentL |
|
306 |
* @since S60 5.0 |
|
307 |
* This method is a callback to indicate the end of the document. |
|
308 |
* @param aErrorCode is the error code. |
|
309 |
* If this is not KErrNone then special action may be required. |
|
310 |
*/ |
|
311 |
inline void OnEndDocumentL( |
|
312 |
TInt aErrorCode); |
|
313 |
||
314 |
/** |
|
315 |
* OnStartElementL |
|
316 |
* @since S60 5.0 |
|
317 |
* This method is a callback to indicate an element has been parsed. |
|
318 |
* @param aElement is a handle to the element's details. |
|
319 |
* @param aAttributes contains the attributes for the element. |
|
320 |
* @param aErrorCode is the error code. |
|
321 |
* If this is not KErrNone then special action may be required. |
|
322 |
*/ |
|
323 |
void OnStartElementL( |
|
324 |
const RTagInfo& aElement, |
|
325 |
const RAttributeArray& aAttributes, |
|
326 |
TInt aErrorCode); |
|
327 |
||
328 |
/** |
|
329 |
* OnEndElementL |
|
330 |
* @since S60 5.0 |
|
331 |
* This method is a callback to indicate the end of the element has been reached. |
|
332 |
* @param aElement is a handle to the element's details. |
|
333 |
* @param aErrorCode is the error code. |
|
334 |
* If this is not KErrNone then special action may be required. |
|
335 |
*/ |
|
336 |
void OnEndElementL( |
|
337 |
const RTagInfo& aElement, |
|
338 |
TInt aErrorCode); |
|
339 |
||
340 |
/** |
|
341 |
* OnContentL |
|
342 |
* @since S60 5.0 |
|
343 |
* This method is a callback that sends the content of the element. |
|
344 |
* Not all the content may be returned in one go. The data may be sent in chunks. |
|
345 |
* When an OnEndElementL is received this means there is no more content to be sent. |
|
346 |
* @param aBytes is the raw content data for the element. |
|
347 |
* The client is responsible for converting the data to the |
|
348 |
* required character set if necessary. |
|
349 |
* In some instances the content may be binary and must not be converted. |
|
350 |
* @param aErrorCode is the error code. |
|
351 |
* If this is not KErrNone then special action may be required. |
|
352 |
*/ |
|
353 |
void OnContentL( |
|
354 |
const TDesC8& aBytes, |
|
355 |
TInt aErrorCode); |
|
356 |
||
357 |
/** |
|
358 |
* OnStartPrefixMappingL |
|
359 |
* @since S60 5.0 |
|
360 |
* This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping. |
|
361 |
* This method is always called before the corresponding OnStartElementL method. |
|
362 |
* @param aPrefix is the Namespace prefix being declared. |
|
363 |
* @param aUri is the Namespace URI the prefix is mapped to. |
|
364 |
* @param aErrorCode is the error code. |
|
365 |
* If this is not KErrNone then special action may be required. |
|
366 |
*/ |
|
367 |
inline void OnStartPrefixMappingL( |
|
368 |
const RString& aPrefix, |
|
369 |
const RString& aUri, |
|
370 |
TInt aErrorCode); |
|
371 |
||
372 |
/** |
|
373 |
* OnEndPrefixMappingL |
|
374 |
* @since S60 5.0 |
|
375 |
* This method is a notification of the end of the scope of a prefix-URI mapping. |
|
376 |
* This method is called after the corresponding DoEndElementL method. |
|
377 |
* @param aPrefix is the Namespace prefix that was mapped. |
|
378 |
* @param aErrorCode is the error code. |
|
379 |
* If this is not KErrNone then special action may be required. |
|
380 |
*/ |
|
381 |
inline void OnEndPrefixMappingL( |
|
382 |
const RString& aPrefix, |
|
383 |
TInt aErrorCode); |
|
384 |
||
385 |
/** |
|
386 |
* OnIgnorableWhiteSpaceL |
|
387 |
* @since S60 5.0 |
|
388 |
* This method is a notification of ignorable whitespace in element content. |
|
389 |
* @param aBytes are the ignored bytes from the document being parsed. |
|
390 |
* @param aErrorCode is the error code. |
|
391 |
* If this is not KErrNone then special action may be required. |
|
392 |
*/ |
|
393 |
inline void OnIgnorableWhiteSpaceL( |
|
394 |
const TDesC8& aBytes, |
|
395 |
TInt aErrorCode); |
|
396 |
||
397 |
/** |
|
398 |
* OnSkippedEntityL |
|
399 |
* @since S60 5.0 |
|
400 |
* This method is a notification of a skipped entity. If the parser encounters an |
|
401 |
* external entity it does not need to expand it - it can return the entity as aName |
|
402 |
* for the client to deal with. |
|
403 |
* @param aName is the name of the skipped entity. |
|
404 |
* @param aErrorCode is the error code. |
|
405 |
* If this is not KErrNone then special action may be required. |
|
406 |
*/ |
|
407 |
inline void OnSkippedEntityL( |
|
408 |
const RString& aName, |
|
409 |
TInt aErrorCode); |
|
410 |
||
411 |
/** |
|
412 |
* OnProcessingInstructionL |
|
413 |
* @since S60 5.0 |
|
414 |
* This method is a receive notification of a processing instruction. |
|
415 |
* @param aTarget is the processing instruction target. |
|
416 |
* @param aData is the processing instruction data. If empty none was supplied. |
|
417 |
* @param aErrorCode is the error code. |
|
418 |
* If this is not KErrNone then special action may be required. |
|
419 |
*/ |
|
420 |
inline void OnProcessingInstructionL( |
|
421 |
const TDesC8& aTarget, |
|
422 |
const TDesC8& aData, |
|
423 |
TInt aErrorCode); |
|
424 |
||
425 |
/** |
|
426 |
* OnError |
|
427 |
* @since S60 5.0 |
|
428 |
* This method indicates an error has occurred. |
|
429 |
* @param aError is the error code |
|
430 |
*/ |
|
431 |
inline void OnError( |
|
432 |
TInt aErrorCode); |
|
433 |
||
434 |
/** |
|
435 |
* GetExtendedInterface |
|
436 |
* @since S60 5.0 |
|
437 |
* This method obtains the interface matching the specified uid. |
|
438 |
* @return 0 if no interface matching the uid is found. |
|
439 |
* Otherwise, the this pointer cast to that interface. |
|
440 |
* @param aUid the uid identifying the required interface. |
|
441 |
*/ |
|
442 |
inline TAny* GetExtendedInterface( |
|
443 |
const TInt32 aUid); |
|
444 |
||
445 |
protected: // New functions |
|
446 |
||
447 |
/** |
|
448 |
* Rolls back the installation if it fails or is cancelled. |
|
449 |
* @since S60 5.0 |
|
450 |
* @param aOdt The ODT of the theme |
|
451 |
*/ |
|
452 |
void RollBackL( ChspsODT& aOdt ); |
|
453 |
||
454 |
private: |
|
455 |
/** |
|
456 |
* C++ default constructor. |
|
457 |
* @since S60 5.0 |
|
458 |
*/ |
|
459 |
ChspsInstallationHandler( |
|
460 |
ChspsThemeServer& aThemeServer ); |
|
461 |
||
462 |
/** |
|
463 |
* By default Symbian 2nd phase constructor is private. |
|
464 |
* @since S60 5.0 |
|
465 |
*/ |
|
466 |
void ConstructL(); |
|
467 |
||
468 |
/** |
|
469 |
* CheckHeaderL |
|
470 |
* Checks the header information and stores it to iOdt |
|
471 |
* @since S60 5.0 |
|
472 |
*/ |
|
473 |
void CheckHeaderL(); |
|
474 |
||
475 |
/** |
|
476 |
* InstallOdtL |
|
477 |
* Installs the theme skeleton |
|
478 |
* @since S60 5.0 |
|
479 |
*/ |
|
480 |
void InstallSkeletonL( |
|
481 |
ThspsServiceCompletedMessage& aReturnMsg ); |
|
482 |
||
483 |
/** |
|
484 |
* Adds parsed resource into a temporary resource list, from which the resources |
|
485 |
* are applied to an ODT instance at later phase |
|
486 |
* @since S60 5.0 |
|
487 |
* @param aArray is either iResourceArray or iLocalizedResourceArray instance |
|
488 |
* @param aFilename is full path and filename to the resource in an installation folder |
|
489 |
* @param aLanguage is language of the resource (use ELangNone if it's a common resource) |
|
490 |
* @param aResourceType is MIME type or NULL |
|
491 |
* @param aMimetype (Optional) |
|
492 |
* @param aTag (Optional) |
|
493 |
*/ |
|
494 |
void AddResourceL( |
|
495 |
CArrayPtrSeg<ChspsResource>& aArray, |
|
496 |
const TPtrC aFilename, |
|
497 |
const TLanguage aLanguage, |
|
498 |
const ThspsResourceType aResourceType, |
|
499 |
const TPtrC8 aMimetype, |
|
500 |
const TPtrC8 aTag ); |
|
501 |
||
502 |
/** |
|
503 |
* CleanupL |
|
504 |
* Executes cleaning of the target folder prior to the installation process |
|
505 |
* @since S60 5.0 |
|
506 |
*/ |
|
507 |
void CleanupL( |
|
508 |
const ChspsODT& aUpdateMask ); |
|
509 |
||
510 |
/** |
|
511 |
* ImportPluginsL |
|
512 |
* Imports plug-in DOMs referenced by application configuration, other |
|
513 |
* configuration types are ignored. |
|
514 |
* @since S60 5.0 |
|
515 |
*/ |
|
516 |
void ImportPluginsL( ); |
|
517 |
||
518 |
/** |
|
519 |
* ParseDocumentL |
|
520 |
* Calls the definition engine to create the dom |
|
521 |
* @since S60 5.0 |
|
522 |
*/ |
|
523 |
void ParseDocumentL( |
|
524 |
ChspsODT& aOdt ); |
|
525 |
||
526 |
/** |
|
527 |
* CompleteRequestL |
|
528 |
* Completes the request message |
|
529 |
* @since S60 5.0 |
|
530 |
*/ |
|
531 |
void CompleteRequestL(const ThspsServiceCompletedMessage aReturnMessage, |
|
532 |
const TDesC8& aHeaderData = KNullDesC8 ); |
|
533 |
||
534 |
/** |
|
535 |
* Send update notifications if necessary. |
|
536 |
* @since S60 5.0 |
|
537 |
*/ |
|
538 |
void NotifyOdtUpdatedL(); |
|
539 |
||
540 |
/** |
|
541 |
* Get active application configurations. |
|
542 |
* @since S60 5.0 |
|
543 |
* @param aActiveAppConfs Target list for active application configurations. |
|
544 |
*/ |
|
545 |
void GetActiveAppConfsL( CArrayPtrSeg<ChspsODT>& aActiveAppConfs ); |
|
546 |
||
547 |
/** |
|
548 |
* SetODTAsResourceL |
|
549 |
* Stores the given ODT as a resources on the resource list |
|
550 |
* @since S60 5.0 |
|
551 |
*/ |
|
552 |
void SetODTAsResourceL( |
|
553 |
ChspsODT& aOdt ); |
|
554 |
||
555 |
/** |
|
556 |
* ActivateThemeL |
|
557 |
* Activates the installed theme. |
|
558 |
* @since S60 5.0 |
|
559 |
*/ |
|
560 |
void ActivateThemeL(); |
|
561 |
||
562 |
/** |
|
563 |
* Parses given DOM document and appends it with a content from possible plugin DOMs. |
|
564 |
* @since S60 5.0 |
|
565 |
* @param aAppODT is the ODT which should be modified |
|
566 |
*/ |
|
567 |
void AppendPluginConfigurationsL( |
|
568 |
ChspsODT& aAppODT ); |
|
569 |
||
570 |
/** |
|
571 |
* Resets memeber variables. |
|
572 |
* Used by the autoinstaller when installation handler is created only once. |
|
573 |
* @since S60 5.0 |
|
574 |
*/ |
|
575 |
void ResetL(); |
|
576 |
||
577 |
/** |
|
578 |
* Finds locale specific subdirectories and resources and appends those |
|
579 |
* into the resource array |
|
580 |
* |
|
581 |
* @since S60 5.0 |
|
582 |
* @param aPath is a directory where the locale specific subdirectories exits |
|
583 |
* @param aProcessOnlyDTD If ETrue, then only DTD files are processed. |
|
584 |
*/ |
|
585 |
void AddLocalesL( |
|
586 |
const TDesC& aPath, |
|
587 |
const TBool aProcessOnlyDTD ); |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
588 |
|
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
589 |
void DoAddLocalesL( |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
590 |
const TDesC& aPath, |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
591 |
const TLanguage aLanguage, |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
592 |
const TBool aProcessOnlyDTD ); |
114 | 593 |
|
594 |
/** |
|
595 |
* Adds localized dtd resources from the provided subdirectory |
|
596 |
* |
|
597 |
* @since S60 5.0 |
|
598 |
* @param aPath Path to the subdirectory where the locale specific resources can be found |
|
599 |
* @param aLanguage Name of the subdirectory |
|
600 |
*/ |
|
601 |
void AddDtdFileL( |
|
602 |
const TDesC& aPath, |
|
603 |
const TLanguage aLanguage ); |
|
604 |
||
605 |
/** |
|
606 |
* Returns a path if V2 directory structure is in use |
|
607 |
* and if an interface uid is known. |
|
608 |
* @return path to a Xuikon etc folder or an empty string |
|
609 |
*/ |
|
610 |
TFileName GetInterfacePath(); |
|
611 |
||
612 |
/** |
|
613 |
* Finds all language specific folders and resources |
|
614 |
* under the interface path in ROM or UDA drive. |
|
615 |
* @since S60 5.0 |
|
616 |
* @path aPath Xuikon path |
|
617 |
*/ |
|
618 |
void AddInterfaceResourcesV2L( |
|
619 |
const TDesC& aPath ); |
|
620 |
||
621 |
/** |
|
622 |
* Validates manifest contents and installs files into the Plug-in Repository. |
|
623 |
* @since S60 5.0 |
|
624 |
*/ |
|
625 |
void FinalizeParsingL(); |
|
626 |
||
627 |
/** |
|
628 |
* Validates provided UID value. |
|
629 |
* @param aUid Value to be checked |
|
630 |
*/ |
|
631 |
void ApplyUidRangeTestsL( const TUint aUid ); |
|
632 |
||
633 |
/** |
|
634 |
* Indicated whether installed plugin was instansiated |
|
635 |
* in one or more application configurations. |
|
636 |
* @since S60 5.0 |
|
637 |
* @return ETrue if the plugin was in use |
|
638 |
*/ |
|
639 |
TBool IsPluginUsedInAppConfsL(); |
|
640 |
||
641 |
/** |
|
642 |
* Parser for the filelogo and filepreview elements in manifest files. |
|
643 |
* If an icon was provided, it is added to an resource array for copying |
|
644 |
* to client's private folder. Allocates heap for the result. |
|
645 |
* Supported values: |
|
646 |
* - skin(<major id> <minor id>):mif(<path> <bitmapid> <maskid>) |
|
647 |
* - mif(<path> <bitmapid> <maskid>) |
|
648 |
* - uid(<application uid>) |
|
649 |
* - <file name>.<png/svg> |
|
650 |
* @param aValue8 Value of the element |
|
651 |
* @param aTag A tag for the file resource |
|
652 |
* @param aResultString Fixed declaration with a valid path reference |
|
653 |
*/ |
|
654 |
void ParseIconDeclarationL( |
|
655 |
HBufC8& aValue8, |
|
656 |
const TDesC8& aTag, |
|
657 |
HBufC*& aResultString ); |
|
658 |
||
659 |
||
660 |
/** |
|
661 |
* Find resource files |
|
662 |
* @since S60 5.0 |
|
663 |
* @param aPath Path to files |
|
664 |
* @param aRecursive Is recursive search |
|
665 |
* @param aDriveArray Drives to search |
|
666 |
* @param aDeviceLanguages Required languages |
|
667 |
*/ |
|
668 |
||
669 |
void ChspsInstallationHandler::FindResourceFilesL( const TDesC& aPath, |
|
670 |
const TBool aRecursive, |
|
671 |
RArray<TInt>& aDriveArray, |
|
672 |
CArrayFixFlat<TInt>* aDeviceLanguages ); |
|
673 |
||
674 |
public: |
|
675 |
||
676 |
ChspsResult* iResult; |
|
677 |
||
678 |
private:// Data |
|
679 |
||
680 |
// Stores the current message being processed during asynchronous conversion |
|
681 |
RMessagePtr2 iMessagePtr; |
|
682 |
||
683 |
// Result data |
|
684 |
TBuf8<KMaxResultDataLength8> iResultData; |
|
685 |
||
686 |
// Maintains the phases in which the installation currently is |
|
687 |
ThspsInstallationPhase iInstallationPhase; |
|
688 |
||
689 |
// Maintains the request status in asynchronous object installation mode |
|
690 |
TRequestStatus* iRequestStatus; |
|
691 |
||
692 |
// Flag that indicates that the installation service is used as asynchronous object, |
|
693 |
TInstallationMode iInstallationMode; |
|
694 |
||
695 |
// Pointer to definition engine |
|
696 |
ChspsDefinitionEngineInterface* iDefEngine; |
|
697 |
||
698 |
// Pointer to xml parser |
|
699 |
Xml::CParser* iXmlParser; |
|
700 |
||
701 |
// Pointer to ODT of the theme currently being installed |
|
702 |
ChspsODT* iOdt; |
|
703 |
||
704 |
// Contains the ODT's header information in marshalled form |
|
705 |
HBufC8* iHeaderData; |
|
706 |
||
707 |
// Contains all the resources of an ODT instance when installing has finished |
|
708 |
CArrayPtrSeg<ChspsResource>* iResourceList; |
|
709 |
||
710 |
// Contains names of the resource files under the locale specific subdirectories |
|
711 |
CArrayPtrSeg<ChspsResource>* iTempLocalizedResourceList; |
|
712 |
||
713 |
HBufC8* iMediaType; |
|
714 |
||
715 |
// Tag value from a resource file |
|
716 |
HBufC8* iResourceTag; |
|
717 |
||
718 |
// True if parsing localized resources (assumes that elements are always in predefined order) |
|
719 |
TBool iLocalized; |
|
720 |
||
721 |
// Holds the default language (applied if there is no DTD for the device language) |
|
722 |
TLanguage iDefaultSpecification; |
|
723 |
TBool iDefaultSpecificationSet; |
|
724 |
||
725 |
// Path to installation files |
|
726 |
TPath iThemeFilePath; |
|
727 |
||
728 |
// Application or interface UID of the installed theme |
|
729 |
TUint iRootUid; |
|
730 |
||
731 |
// Provider UID of the installed theme |
|
732 |
TUint iProviderUid; |
|
733 |
||
734 |
// Theme UID of the installed theme |
|
735 |
TUint iThemeUid; |
|
736 |
||
737 |
// Full name of the installed theme |
|
738 |
HBufC* iThemeFullName; |
|
739 |
||
740 |
// Short name of the installed theme |
|
741 |
HBufC8* iThemeShortName; |
|
742 |
||
743 |
// Version of the installed theme |
|
744 |
HBufC8* iThemeVersion; |
|
745 |
||
746 |
// Description of the widget |
|
747 |
HBufC8* iThemeDesc; |
|
748 |
||
749 |
// Version of the requested parser |
|
750 |
HBufC* iPackageVersion; |
|
751 |
||
752 |
// Family mask for different resolutions and interfaces (vga, vga_tch, qhd_tch, etc) |
|
753 |
TUint32 iFamilyMask; |
|
754 |
||
755 |
// Type of the installed application (for example "Hitchcock") |
|
756 |
HBufC8* iApplicationType; |
|
757 |
||
758 |
// XML file name of the installed theme |
|
759 |
HBufC* iXmlFile; |
|
760 |
||
761 |
// Name of the DTD file (same for each locale) |
|
762 |
HBufC* iDtdFile; |
|
763 |
||
764 |
// Stores the content during parsing of the manifest file |
|
765 |
HBufC8* iContent; |
|
766 |
||
767 |
// Handle to the file server session |
|
768 |
RFs iFsSession; |
|
769 |
||
770 |
// Stores the resource during asynchronous conversion |
|
771 |
ChspsResource* iResource; |
|
772 |
||
773 |
// Stores the configuration type |
|
774 |
ThspsConfigurationType iConfigurationType; |
|
775 |
||
776 |
// Stores the theme status during installation |
|
777 |
TUint32 iThemeStatus; |
|
778 |
||
779 |
// Flag that indicates a missing file during installation -> installation fails |
|
780 |
TBool iFileNotFound; |
|
781 |
||
782 |
// Reference to Theme Server |
|
783 |
ChspsThemeServer& iThemeServer; |
|
784 |
||
785 |
// Reference to definition repository |
|
786 |
ChspsDefinitionRepository& iDefinitionRepository; |
|
787 |
||
788 |
// Reference to security enforcer |
|
789 |
ChspsSecurityEnforcer& iSecurityEnforcer; |
|
790 |
||
791 |
// Reference to central repository |
|
792 |
CRepository& iCentralRepository; |
|
793 |
||
794 |
// header list cache |
|
795 |
CArrayPtrSeg<ChspsODT>& iHeaderListCache; |
|
796 |
||
797 |
// Set if the package being installed is supported by the server |
|
798 |
TBool iPackageVerSupported; |
|
799 |
||
800 |
// Set if "EhspsODTAdded" -notifications should be blocked (e.g. ROM installations) |
|
801 |
TBool iDisableNotifications; |
|
802 |
||
803 |
// Set if installation files are located in ROM or in UDA, validation is not required |
|
804 |
TBool iTrustedInstallation; |
|
805 |
||
806 |
// Set if installation files should be searched from UDA and eMMC drives |
|
807 |
TBool iInstallFromUDAEmmc; |
|
808 |
||
809 |
// Set if widget mutliinstance flag |
|
810 |
TInt32 iMultiInstance; |
|
811 |
||
812 |
// Set if the multiinstance element is present in the manifest.dat file |
|
813 |
TBool iMultiInstanceFound; |
|
814 |
||
815 |
#ifdef HSPS_LOG_ACTIVE |
|
816 |
/** |
|
817 |
* Log bus. |
|
818 |
*/ |
|
819 |
ChspsLogBus* iLogBus; |
|
820 |
#endif |
|
821 |
||
822 |
/** |
|
823 |
* Installation type. |
|
824 |
*/ |
|
825 |
enum TInstallationType |
|
826 |
{ |
|
827 |
EInstallationTypeNew = 0, // New installation. |
|
828 |
EInstallationTypeUpdate // Update. |
|
829 |
}; |
|
830 |
||
831 |
// Installation type for currently active installation. |
|
832 |
TInstallationType iInstallationType; |
|
833 |
}; |
|
834 |
||
835 |
#include "hspsinstallationhandler.inl" |
|
836 |
||
837 |
#endif //__hspsINSTALLATIONHANDLER_H__ |