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 * ChspsMaintenanceHandler is a server-side implementation of MhspsMaintenanceService API-definition of |
|
17 * HSPS Theme Management Services. |
|
18 * Theme Maintenance Service is intended to serve HSPS applications as well as S60 legacy |
|
19 * applications - especially Personalisation Application - with Theme Maintenance Services. |
|
20 * Theme maintenance can take place after a set of themes are installed by HSPS Theme |
|
21 * Installation Service. Maintenance services includes theme listings, theme activation, |
|
22 * theme removal, and default theme restoring functionality. |
|
23 * |
|
24 * Maintenance functions deploy Definition Repository and Symbian Central Repository. |
|
25 * Definition Repository keeps Application Themes in save place and Central Repository keeps the |
|
26 * information about which theme is active for what application. Information in Central Repository |
|
27 * is stored in pairs of application UID and active theme UID. |
|
28 * ChspsMaintenanceHandler utilizes ChspsODT class to exchange the information of Application Themes. |
|
29 * DOM-document member of ChspsODT is not attached in theme maintenance operations, only the theme |
|
30 * header. For more information, see HSPS Theme Management Service APIs documentation. |
|
31 * |
|
32 * |
|
33 */ |
|
34 |
|
35 |
|
36 #ifndef __hspsMAINTENANCEHANDLER_H__ |
|
37 #define __hspsMAINTENANCEHANDLER_H__ |
|
38 |
|
39 #ifdef HSPS_LOG_ACTIVE |
|
40 class ChspsLogBus; |
|
41 #endif |
|
42 |
|
43 class MhspsMaintenanceService; |
|
44 class ChspsDefinitionRepository; |
|
45 class ChspsSecurityEnforcer; |
|
46 class ChspsODT; |
|
47 class CRepository; |
|
48 class ChspsThemeServer; |
|
49 class ChspsThemeServerSession; |
|
50 class ChspsResult; |
|
51 class ChspsDomNode; |
|
52 |
|
53 /** |
|
54 * Class ChspsMaintenanceHandler. |
|
55 * ChspsMaintenanceHandler performs all theme maintenance related functionality for hspsThemeServer. |
|
56 * Maintenance services includes theme listing, theme activation, theme removal and default theme |
|
57 * restoring operations. |
|
58 * |
|
59 * Class inheritance: |
|
60 * ================== |
|
61 * ChspsMaintenanceHandler derives CTimer for active timer functionality. It implements |
|
62 * MhspsMaintenanceService-interface from HSPS Theme Management Service APIs. |
|
63 * For more information, see HSPS Theme Management Service API documentation. |
|
64 * |
|
65 * Functionality: |
|
66 * ============== |
|
67 * Maintenance functions are presented in high-level and low-level parametrization mode. |
|
68 * This is the same approach that was introduced with HSPS Theme Installation Service |
|
69 * - to support user-intefaces with human-readable high-level elements and on the other hand, |
|
70 * machine-originated users with low-level data. |
|
71 * Most of the maintenance functions are synchronous, only one is asynchronous; hspsGetNextHeader(). |
|
72 * Others functions are straightforward to use but hspsGetListHeaders(). This will be explained next; synchronous |
|
73 * call hspsGetListHeaders() initiates the theme header listing by passing search mask to HSPS |
|
74 * Theme Server's Maintenance Service. This search mask is called a query. It also passes a list |
|
75 * object in where maintenance service should append theme-header objects (type of ChspsODT-class |
|
76 * without DOM-document) when one is retrieved asychronously. Search mask should be filled with |
|
77 * proper parameters matching the need in hand. If no parameters are given, all headers of |
|
78 * Application Themes available in Definition Repository will be delivered, otherwise, |
|
79 * only sub-set of theme-headers will be delivered. |
|
80 * After the query-call hspsGetListHeaders(), the delivering of the theme-headers is asynchronous. |
|
81 * Asynchronous service must be initiated by calling hspsGetNextHeader() after checking that any |
|
82 * theme matching on current query is found. This action is called a subscription. |
|
83 * To receive theme listing, the client application must implement |
|
84 * MhspsThemeManagementServiceObserver-interface and start to listen call-back messages. |
|
85 * The headers matching on query will be delivered immediately. Query remains until |
|
86 * hspsCancelGetListHeaders() is called by client. If a new Application Theme exist in repository, |
|
87 * it will be delivered. As mentioned, when hspsGetListHeaders() returns, the return value must |
|
88 * be checked. Return value could be one of the following: |
|
89 * - EhspsGetListHeadersSuccess - there is at least one Application Theme available matching on |
|
90 * query. Call first hspsGetNextHeader() to get the headers. Same call |
|
91 * will set the subscribtion of new ones possible coming available |
|
92 * later on. |
|
93 * - EhspsGetListHeadersEmpty - there is no themes matching on the query available at the time, |
|
94 * however, some might be exist later in due to installations. |
|
95 * Client application should retain the subcription. |
|
96 * - EhspsGetListHeadersFailed - service request failed in some reason. Possible reasons are for |
|
97 * e.g. the missing rights to list headers queried. |
|
98 * |
|
99 * In the near future, there will be s.c. Additional Return Code Support feature available in |
|
100 * HSPS. This code will express for e.g. the number of headers to be delivered or possible system |
|
101 * error code in failed cases. |
|
102 * |
|
103 * By MhspsServiceObserver::HandlehspsServiceMessage() call-back function implementation, client |
|
104 * application must listen the following ThspsServiceCompletedMessage-messages: |
|
105 * - EhspsGetListHeadersUpdate - header list on the client side has a new object appended at the end |
|
106 * of the list, |
|
107 * - EhspsGetListHeadersRestart - header list on server side has changed so much that the client must |
|
108 * empty the list printed on screen. New list will be delivered |
|
109 * immediately. The subscription stands. |
|
110 * - EhspsGetListHeadersEmpty - header list on server side is now empty. The client must empty |
|
111 * the list on screen if printed. The subscription stands. |
|
112 * - EhspsGetListHeadersFailed - operation has failed. Client should cancel request and restart, |
|
113 * perhaps. |
|
114 * |
|
115 * Maintenanace functions may also return one of the following codes: |
|
116 * - EhspsServiceRequestSheduled, or |
|
117 * - EhspsServiceRequestError. |
|
118 * |
|
119 * For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. |
|
120 * |
|
121 * @ingroup group_hspsserversession |
|
122 * @lib hspsThemeServer.exe |
|
123 * @since S60 3.1 |
|
124 */ |
|
125 class ChspsMaintenanceHandler : public CTimer, public MhspsMaintenanceService, |
|
126 public MhspsDefinitionRepositoryObserver |
|
127 { |
|
128 public: // Constructors and destructor |
|
129 /** |
|
130 * NewL. |
|
131 * Two-phased constructor. |
|
132 * @since S60 5.0 |
|
133 * @param aThemeServer Server instance |
|
134 * @param aSecureId Identifies the client application which uses the handler |
|
135 */ |
|
136 static ChspsMaintenanceHandler* NewL( |
|
137 ChspsThemeServer& aThemeServer, |
|
138 const TUint aSecureId = 0 ); |
|
139 |
|
140 /** |
|
141 * NewLC. |
|
142 * Two-phased constructor. |
|
143 * @since S60 5.0 |
|
144 * @param aThemeServer Server instance |
|
145 * @param aSecureId Identifies the client application which uses the handler |
|
146 */ |
|
147 static ChspsMaintenanceHandler* NewLC( |
|
148 ChspsThemeServer& aThemeServer, |
|
149 const TUint aSecureId = 0 ); |
|
150 |
|
151 /** |
|
152 * Destructor. |
|
153 */ |
|
154 virtual ~ChspsMaintenanceHandler(); |
|
155 |
|
156 public: // New functions |
|
157 |
|
158 /** |
|
159 * ServiceGetListHeadersL |
|
160 * @since S60 3.1 |
|
161 * @param aMessage contains the data received from the client |
|
162 */ |
|
163 void ServiceGetListHeadersL(const RMessage2& aMessage); |
|
164 |
|
165 /** |
|
166 * ServiceGetNextHeaderL |
|
167 * @since S60 3.1 |
|
168 * @param aMessage contains the data received from the client |
|
169 */ |
|
170 void ServiceGetNextHeaderL(const RMessage2& aMessage); |
|
171 |
|
172 /** |
|
173 * ServiceSetActiveThemeL |
|
174 * @since S60 3.1 |
|
175 * @param aMessage contains the data received from the client |
|
176 */ |
|
177 void ServiceSetActiveThemeL(const RMessage2& aMessage); |
|
178 |
|
179 /** |
|
180 * ServiceRestoreDefaultL |
|
181 * @since S60 3.1 |
|
182 * @param aMessage contains the data received from the client |
|
183 */ |
|
184 void ServiceRestoreDefaultL(const RMessage2& aMessage); |
|
185 |
|
186 /** |
|
187 * ServiceRemoveThemeL |
|
188 * @since S60 3.1 |
|
189 * @param aMessage contains the data received from the client |
|
190 */ |
|
191 void ServiceRemoveThemeL(const RMessage2& aMessage); |
|
192 |
|
193 /** |
|
194 * ServiceAddPluginL |
|
195 * @since S60 5.0 |
|
196 * @param aMessage contains the data received from the client |
|
197 */ |
|
198 void ServiceAddPluginL(const RMessage2& aMessage); |
|
199 |
|
200 /** |
|
201 * ServiceRemovePluginL |
|
202 * @since S60 5.0 |
|
203 * @param aMessage contains the data received from the client |
|
204 */ |
|
205 void ServiceRemovePluginL( const RMessage2& aMessage ); |
|
206 |
|
207 /** |
|
208 * ServiceSetActivePluginL |
|
209 * @since S60 5.0 |
|
210 * @param aMessage contains the data received from the client |
|
211 */ |
|
212 void ServiceSetActivePluginL( const RMessage2& aMessage ); |
|
213 |
|
214 /** |
|
215 * ServiceReplacePluginL |
|
216 * @since S60 5.0 |
|
217 * @param aMessage contains the data received from the client |
|
218 */ |
|
219 void ServiceReplacePluginL( const RMessage2& aMessage ); |
|
220 |
|
221 /** |
|
222 * ServiceSetPluginSettingsL |
|
223 * @since S60 5.0 |
|
224 * @param aMessage contains the data received from the client |
|
225 */ |
|
226 void ServiceSetPluginSettingsL( const RMessage2& aMessage ); |
|
227 |
|
228 /* |
|
229 * ServiceGetPluginOdtL |
|
230 * @since S60 5.0 |
|
231 * @param aMessage contains |
|
232 */ |
|
233 void ServiceGetPluginOdtL( const RMessage2& aMessage ); |
|
234 |
|
235 /** |
|
236 * ServiceMovePluginsL |
|
237 * @since S60 5.0 |
|
238 * @param aMessage contains the data received from the client |
|
239 */ |
|
240 void ServiceMovePluginsL( const RMessage2& aMessage ); |
|
241 |
|
242 /** |
|
243 * ServiceSetConfStateL |
|
244 * @since S60 5.0 |
|
245 * @param aMessage contains the data received from the client |
|
246 */ |
|
247 void ServiceSetConfStateL( const RMessage2& aMessage ); |
|
248 |
|
249 /** |
|
250 * ServiceRestoreActiveAppConfL |
|
251 * @since S60 5.0 |
|
252 * @param aMessage contains the data received from the client |
|
253 */ |
|
254 void ServiceRestoreActiveAppConfL( const RMessage2& aMessage ); |
|
255 |
|
256 #ifdef HSPS_LOG_ACTIVE |
|
257 /** |
|
258 * Set log bus. |
|
259 */ |
|
260 void SetLogBus( ChspsLogBus* aLogBus ); |
|
261 #endif |
|
262 |
|
263 /** |
|
264 * SetServerSession. |
|
265 * @since S60 5.0 |
|
266 * @param @param aServerSession Pointer to owning server session |
|
267 */ |
|
268 void SetServerSession( ChspsThemeServerSession* aServerSession ); |
|
269 |
|
270 /** |
|
271 * ServiceRestoreConfigurationsL |
|
272 * @since S60 5.2 |
|
273 * @param aMessage contains the data received from the client |
|
274 */ |
|
275 void ServiceRestoreConfigurationsL( const RMessage2& aMessage ); |
|
276 |
|
277 public: // Functions from base classes |
|
278 |
|
279 /** |
|
280 * From MhspsMaintenanceService hspsGetListHeaders |
|
281 * @since S60 3.1 |
|
282 * @param aSearchMask is ChspsODT-object which attributes are filled to present search |
|
283 * parameters for theme set queried by client. This parametrisation follows |
|
284 * the high-level schema. |
|
285 * @param aHeaderList is an list object able to carry ChspsODT-objects. |
|
286 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
287 */ |
|
288 ThspsServiceCompletedMessage hspsGetListHeaders(const TDesC8& aSearchMaskData, |
|
289 CArrayPtrSeg<HBufC8>& aHeaderDataList); |
|
290 |
|
291 /** |
|
292 * From MhspsMaintenanceService hspsGetNextHeader |
|
293 * @since S60 3.1 |
|
294 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
295 */ |
|
296 ThspsServiceCompletedMessage hspsGetNextHeader(); |
|
297 |
|
298 /** |
|
299 * From MhspsMaintenanceService hspsCancelGetListHeaders |
|
300 * @since S60 3.1 |
|
301 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
302 */ |
|
303 ThspsServiceCompletedMessage hspsCancelGetListHeaders(); |
|
304 |
|
305 /** |
|
306 * From MhspsMaintenanceService hspsSetActiveTheme |
|
307 * @since S60 3.1 |
|
308 * @param aSetMask represents parameters by which the new theme activation will be done. |
|
309 There must be sufficient set of parameters presented, at least a theme UID. |
|
310 * @param aOdt is an empty ODT-object which will contain the ODT of activated |
|
311 * theme on the return of the call. This parametrisation follows the high-level |
|
312 * schema. There must be sufficient set of parameters presented, at least a theme UID. |
|
313 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
314 */ |
|
315 ThspsServiceCompletedMessage hspsSetActiveTheme( const ChspsODT& aSetMask, ChspsODT& aOdt ); |
|
316 |
|
317 /** |
|
318 * From MhspsMaintenanceService hspsRestoreDefault |
|
319 * @since S60 3.1 |
|
320 * @param aSetMask is an ODT-header parametrized enough to express the theme to be made |
|
321 * active. |
|
322 * @param aHeader is an empty ODT-header object that will contain the header of the theme |
|
323 * actually made active if the request was successful. |
|
324 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
325 */ |
|
326 ThspsServiceCompletedMessage hspsRestoreDefault( const ChspsODT& aSetMask, ChspsODT& aHeader ); |
|
327 |
|
328 /** |
|
329 * From MhspsMaintenanceService hspsRemoveThemeL |
|
330 * @since S60 3.1 |
|
331 * @param aSetMask is an ODT-header parametrized enough to express the theme to be removed. |
|
332 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
333 */ |
|
334 ThspsServiceCompletedMessage hspsRemoveThemeL( const ChspsODT& aSetMask ); |
|
335 |
|
336 /** |
|
337 * From MhspsMaintenanceService hspsGetListHeaders |
|
338 * @since S60 3.1 |
|
339 * @param aSearchMaskData is serialized ChspsODT-object. Before serializing, attributes |
|
340 * in ChspsODT-object were filled to present a search parameters for theme set queried. |
|
341 * Serialized data parametrisation follows the low-level schema. |
|
342 * @param aHeaderList is an list object able to carry serialized ChspsODT-objects. |
|
343 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
344 */ |
|
345 ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& /*aSearchMask*/ |
|
346 , CArrayPtrFlat<ChspsODT>& /*aHeaderList*/); |
|
347 |
|
348 /** |
|
349 * From MhspsMaintenanceService hspsSetActiveTheme |
|
350 * @since S60 3.1 |
|
351 * @param aSetMaskData is externalized version of ChspsODT-object presenting parameters by |
|
352 * which the new theme activation will be done. There must be sufficient set of |
|
353 * parameters presented, at least a theme UID. This parametrisation follows the |
|
354 * low-level schema. |
|
355 * @param aHeaderData is an empty description for externalized ODT-object data. |
|
356 * When internalized, this object will contain the header of newly activated theme |
|
357 * as a result of the call. |
|
358 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
359 */ |
|
360 ThspsServiceCompletedMessage hspsSetActiveTheme(const TDesC8& /*aSetMaskData*/ |
|
361 , TDes8& /*aHeaderData*/); |
|
362 |
|
363 /** |
|
364 * From MhspsMaintenanceService hspsAddPlugin |
|
365 * Not used - see ServiceAddPluginL instead which has a diffrent input |
|
366 * @since S60 5.0 |
|
367 */ |
|
368 ThspsServiceCompletedMessage hspsAddPlugin( |
|
369 const TInt /*aAppUid*/, |
|
370 const TInt /*aParentPluginId*/, |
|
371 const TInt /*aPluginUid*/, |
|
372 const TInt /*aPosition*/, |
|
373 TInt& /*aAddedPluginId*/ ); |
|
374 |
|
375 /** |
|
376 * From MhspsMaintenanceService hspsRemovePlugin |
|
377 * Not used - see ServiceRemovePluginL instead which has a diffrent input |
|
378 */ |
|
379 ThspsServiceCompletedMessage hspsRemovePlugin( |
|
380 const TInt /*aAppUid*/, |
|
381 const TInt /*aPluginId*/ ); |
|
382 |
|
383 /** |
|
384 * From MhspsMaintenanceService hspsSetActivePlugin |
|
385 * Not used - see ServiceRemovePluginL instead which has a diffrent input |
|
386 */ |
|
387 ThspsServiceCompletedMessage hspsSetActivePlugin( |
|
388 const TInt aAppUid, |
|
389 const TInt aPluginId |
|
390 ); |
|
391 |
|
392 /** |
|
393 * From MhspsMaintenanceService hspsReplacePlugin |
|
394 * Not used - see ServiceReplacePluginL instead which has a diffrent input |
|
395 */ |
|
396 ThspsServiceCompletedMessage hspsReplacePlugin( |
|
397 const TInt /*aAppUid*/, |
|
398 const TInt /*aPluginId*/, |
|
399 const TInt /*aConfUid*/ ); |
|
400 |
|
401 /** |
|
402 * From MhspsMaintenanceService hspsSetSettings |
|
403 * Not used - see ServiceRemovePluginL instead which has a diffrent input |
|
404 */ |
|
405 ThspsServiceCompletedMessage hspsSetPluginSettings( |
|
406 const ChspsODT& /*aHeader*/, |
|
407 const TInt /*aPluginId*/, |
|
408 ChspsDomDocument& /*aDom*/, |
|
409 const TBool /*aPluginStoringStatus*/); |
|
410 |
|
411 /** |
|
412 * From MhspsMaintenanceService hspsMovePluginsL |
|
413 * Not used - see ServiceMovePluginsL instead which has a diffrent input |
|
414 */ |
|
415 ThspsServiceCompletedMessage hspsMovePluginsL( |
|
416 const TInt /*aAppUid*/, |
|
417 const TInt /*aConfId*/, |
|
418 const CArrayFixFlat<TInt>& /*aPluginIdList*/ ); |
|
419 |
|
420 TInt UpdatePluginListL( |
|
421 ChspsODT& aAppODT, |
|
422 const TInt aConfigurationId, |
|
423 const CArrayFixFlat<TInt>& aPluginIdList ); |
|
424 |
|
425 /** |
|
426 * From MhspsMaintenanceService hspsSetConfState |
|
427 * Not used - see ServiceSetConfStateL instead which has a diffrent input |
|
428 */ |
|
429 ThspsServiceCompletedMessage hspsSetConfState( |
|
430 const TInt /*aAppUid*/, |
|
431 const TInt /*aConfId*/, |
|
432 const ThspsConfigurationState /*aState*/, |
|
433 const ThspsConfStateChangeFilter /*aFilter*/ ); |
|
434 |
|
435 /** |
|
436 * From MhspsMaintenanceService hspsRestoreActiveAppConf |
|
437 * Not used - see ServiceRestoreActiveAppConfL instead which has a diffrent input |
|
438 */ |
|
439 ThspsServiceCompletedMessage hspsRestoreActiveAppConf( |
|
440 const TInt /*aAppUid*/, |
|
441 const TInt /*aConfUid*/ ); |
|
442 |
|
443 /** |
|
444 * Updates plugin configuration in all application configuration |
|
445 * |
|
446 * @since S60 5.0 |
|
447 * @param apluginUid identifies the plugin configuration |
|
448 * @return ThspsServiceCompletedMessage expressing the result of the call. |
|
449 */ |
|
450 ThspsServiceCompletedMessage hspsPluginUpdateL( |
|
451 const ChspsODT& aOdt ); |
|
452 |
|
453 |
|
454 |
|
455 public: // from MhspsDefinitioRepositoryObserver |
|
456 |
|
457 TBool HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ); |
|
458 |
|
459 protected: // Functions from base classes |
|
460 |
|
461 |
|
462 ChspsMaintenanceHandler( ChspsThemeServer& aThemeServer, const TUint aSecureId ); |
|
463 |
|
464 /** |
|
465 * By default Symbian 2nd phase constructor is private. |
|
466 */ |
|
467 void ConstructL(); |
|
468 |
|
469 /** |
|
470 * From CActive, RunL. |
|
471 * Callback function. |
|
472 * Invoked to handle responses from the server. |
|
473 */ |
|
474 void RunL(); |
|
475 |
|
476 /** |
|
477 * From CActive, DoCancel. |
|
478 * Cancels any outstanding operation. |
|
479 */ |
|
480 void DoCancel(); |
|
481 |
|
482 /** |
|
483 * From CActive Called when asynchronous request has failed |
|
484 * @since S60 3.1 |
|
485 */ |
|
486 TInt RunError( TInt aError ); |
|
487 |
|
488 |
|
489 private: |
|
490 /** |
|
491 * C++ default constructor. |
|
492 */ |
|
493 void GetHeaderListL( CArrayPtrSeg<HBufC8>& aHeaderDataList, const ChspsODT& aSearchMask ); |
|
494 ThspsServiceCompletedMessage GetHeaderListUpdateL(); |
|
495 void RestoredDefaultL( const ChspsODT& aSetMask, ChspsODT& aHeader ); |
|
496 void RemoveThemeL( const ChspsODT& aSetMask ); |
|
497 TBool CompareHeadersL(const TDesC8& aOldHeaderData, const TDesC8& aNewHeaderData); |
|
498 TBool ComparePaths(const ChspsODT& aOldHeader, const ChspsODT& aNewHeader); |
|
499 TBool FilterHeader(const ChspsODT& aMask, const ChspsODT& aHeader); |
|
500 // Completes the request message |
|
501 void CompleteRequest(const ThspsServiceCompletedMessage aReturnMessage, |
|
502 RMessagePtr2& aMessagePtr, const TDesC8& aHeaderData = KNullDesC8 ); |
|
503 |
|
504 /** |
|
505 * Finds last id value from the provided DOM. |
|
506 * @since S60 5.0 |
|
507 * @param aDom is the application configuration in XML format |
|
508 * @param aLastUsedConfId is the largest used configurtion id |
|
509 * @param aLastUsedPluginId is the largest used plugin id |
|
510 */ |
|
511 void GetUsedIdsL( |
|
512 ChspsDomDocument& aDom, |
|
513 TInt& aLastUsedConfId, |
|
514 TInt& aLastUsedPluginId |
|
515 ); |
|
516 |
|
517 /** |
|
518 * Appends an application configuration with an instance of a plugin configuration. |
|
519 * @since S60 5.0 |
|
520 * @param aAppODT is an instance of the the application configuration |
|
521 * @param aPluginODT is an ODT instance of the plugin configuration |
|
522 * @param aConfigurationId is an id of the configuration being modified, identifies a plugins list |
|
523 * @param aNewPosition is an index of the new position in the plugins list |
|
524 * @param aLastConfId is a value of the last configuration id |
|
525 * @param aLastPluginId is a value of the last plugin id |
|
526 * @return KErrNone if the operation succeeded |
|
527 */ |
|
528 TInt AppendConfigurationL( |
|
529 ChspsODT& aAppODT, |
|
530 const ChspsODT& aPluginODT, |
|
531 const TInt aConfigurationId, |
|
532 const TInt aNewPosition, |
|
533 TInt& aLastConfId, |
|
534 TInt& aLastPluginId |
|
535 ); |
|
536 |
|
537 /** |
|
538 * Finds the plugins node of the provided plugin node. |
|
539 * @since S60 5.0 |
|
540 * @param aNode is the plugins node to be searched |
|
541 * @return plugins node or NULL if the node couldn't be found |
|
542 */ |
|
543 ChspsDomNode* FindPluginsNode( |
|
544 ChspsDomNode& aNode |
|
545 ); |
|
546 |
|
547 /** |
|
548 * Appends a plugins list with a new plugin configuration instance. |
|
549 * @since S60 5.0 |
|
550 * @param aAppODT is the application configuration being modified |
|
551 * @param aPluginsNode is the plugins node where the new plugin instance should be added to |
|
552 * @param aPluginODT is an ODT instance of the plugin configuration to be added |
|
553 * @param aNewPosition is an index of the new position in the plugins list |
|
554 * @param aNewPluginId is an id of the new plugin instance |
|
555 * @return KErrNone if the operation succeeded |
|
556 */ |
|
557 TInt AppendPluginConfigurationL( |
|
558 ChspsODT& aAppODT, |
|
559 ChspsDomNode& aPluginsNode, |
|
560 const ChspsODT& aPluginODT, |
|
561 const TInt aNewPosition, |
|
562 const TInt aNewPluginId |
|
563 ); |
|
564 |
|
565 |
|
566 /** |
|
567 * Finds plugin nodes from the plugin configuration being added, |
|
568 * appends referred configurations into the main plugin configuration, |
|
569 * and updates the plugin nodes with unique id attribute values. |
|
570 * @since S60 5.0 |
|
571 * @param aAppODT is an instance of the the application configuration |
|
572 * @param aPluginODT is an instance of the plugin configuration being added |
|
573 * @param aLastConfId is a value of the last configuration id |
|
574 * @param aLastPluginId is a value of the last plugin id |
|
575 * @return KErrNone |
|
576 */ |
|
577 TInt HandlePluginReferencesL( |
|
578 ChspsODT& aAppODT, |
|
579 ChspsODT& aPluginODT, |
|
580 TInt& aLastConfId, |
|
581 TInt& aLastPluginId |
|
582 ); |
|
583 |
|
584 /** |
|
585 * Checks if the provided plugin configuration is a collection of plugin |
|
586 * configurations, e.g. view configuration. |
|
587 * Alternatively, we could check the type from header cache |
|
588 * @since S60 5.2 |
|
589 * @param aPluginNode Plugin node |
|
590 * @return True if it is a view configuration |
|
591 */ |
|
592 TBool IsViewConfiguration( |
|
593 ChspsDomNode& aPluginNode ); |
|
594 |
|
595 /** |
|
596 * Removes an plugin instance from the provided application configuration |
|
597 * @since S60 5.0 |
|
598 * @param aAppODT is an instance of the the application configuration |
|
599 * @param aPluginId is an ID of the plugin instance to be removed |
|
600 * @return KErrNone if succeeded |
|
601 */ |
|
602 TInt RemoveConfigurationL( |
|
603 ChspsODT& aAppODT, |
|
604 const TInt aPluginId ); |
|
605 |
|
606 /** |
|
607 * Removes an plugin instance from the provided application configuration |
|
608 * @since S60 5.0 |
|
609 * @param aAppODT is an instance of the the application configuration |
|
610 * @param aPluginNode is a node of the plugin instance to be removed |
|
611 * @return KErrNone if succeeded |
|
612 */ |
|
613 TInt RemoveConfigurationL( |
|
614 ChspsODT& aAppODT, |
|
615 ChspsDomNode& aPluginNode ); |
|
616 |
|
617 /** |
|
618 * Finds a plugin node with the provided id which is also a children of |
|
619 * the provided plugins node |
|
620 * @since S60 5.0 |
|
621 * @param aPluginsNode is an instance of the plugins node |
|
622 * @param aPluginId is an ID of the plugin instance to be found within the plugins node |
|
623 * @return Pointer to the plugin node or NULL |
|
624 */ |
|
625 ChspsDomNode* FindChildPluginNode( |
|
626 ChspsDomNode& aPluginsNode, |
|
627 const TInt aPluginId ); |
|
628 |
|
629 /** |
|
630 * Returns a count of plugin instances. |
|
631 * @since S60 5.0 |
|
632 * @param aAppODT is an instance of the the application configuration |
|
633 * @param aPluginUid is an UID of the plugin instances to be found |
|
634 * @param aInstanceCount is the return value |
|
635 */ |
|
636 void GetPluginInstanceCountL( |
|
637 const ChspsODT& aAppODT, |
|
638 const TInt aPluginUid, |
|
639 TInt& aInstanceCount ); |
|
640 |
|
641 /** |
|
642 * Removes plugin resources from the provided ODT |
|
643 * @since S60 5.0 |
|
644 * @param aAppODT is an instance of the the application configuration |
|
645 * @param aPluginUid is an UID of the plugin instance |
|
646 * @return KErrNone if succeeded |
|
647 */ |
|
648 TInt RemovePluginResourcesL( |
|
649 ChspsODT& aAppODT, |
|
650 const TInt aPluginUid ); |
|
651 |
|
652 /** |
|
653 * Adds plugin resouces to the provided ODT |
|
654 * @since S60 5.0 |
|
655 * @param aAppODT is an instance of the the application configuration |
|
656 * @param aPluginUid is an UID of the plugin instance |
|
657 */ |
|
658 void AddPluginResourcesL( |
|
659 ChspsODT& aAppODT, |
|
660 const TInt aPluginUid ); |
|
661 |
|
662 /** |
|
663 * Sets Plugin settings |
|
664 * @since S60 5.0 |
|
665 * @param aOdt is an instance of the the application configuration |
|
666 * @param aPluginId is an ID of the plugin instance to be found |
|
667 * @param aDom is a Dom Document of the settings that is going to set/update |
|
668 * @return KErrNone if succeeded |
|
669 */ |
|
670 TInt hspsSetPluginSettingsL( |
|
671 ChspsODT& aOdt, |
|
672 |
|
673 TInt aPluginId, |
|
674 ChspsDomDocument& aDom); |
|
675 |
|
676 /** |
|
677 * Saves Plugin settings |
|
678 * @since S60 5.0 |
|
679 * @param aODT is an instance of the the plugin configuration |
|
680 * @param aDom is a Dom Document of the settings that is going to saved |
|
681 * @return KErrNone if succeeded |
|
682 */ |
|
683 TInt hspsSavePluginSettingsL( |
|
684 ChspsODT& aOdt, |
|
685 ChspsDomDocument& aDom ); |
|
686 /** |
|
687 * Finds a item node with the provided item id |
|
688 * @since S60 5.0 |
|
689 * @param aNodeIdentifier An Tag. |
|
690 * @param aDomNode A Dom node where the target node is searched from. |
|
691 * @return Result node. |
|
692 */ |
|
693 ChspsDomNode& FindNodeByTagL( |
|
694 const TDesC8& aNodeTag, |
|
695 ChspsDomNode& aDomNode ); |
|
696 |
|
697 /** |
|
698 * Gets configuration node with the provided plugin id |
|
699 * @since S60 5.0 |
|
700 * @param aAppODT is an instance of the the application configuration |
|
701 * @param aPluginId is an ID of the plugin instance to be found |
|
702 * @param aPluginUid is an UID of the plugin instance |
|
703 * @param aPluginname is a name of the plugin instance |
|
704 * @return Error code |
|
705 */ |
|
706 TInt GetConfigurationNodeDataL( |
|
707 ChspsODT& aAppODT, |
|
708 const TInt aPluginId, |
|
709 TInt& aPluginUid, |
|
710 TDes& aPluginName ); |
|
711 |
|
712 /** |
|
713 * Set configuration node state attribute value |
|
714 * @since S60 5.0 |
|
715 * @param aAppODT is an instance of the the application configuration |
|
716 * @param aConfId is an ID of the configuration node to be found |
|
717 * @param aState is a new value of the configuration node state attribute |
|
718 * @return void |
|
719 */ |
|
720 void SetConfStateL( |
|
721 ChspsODT& aAppODT, |
|
722 TInt aConfId, |
|
723 ThspsConfigurationState aState, |
|
724 ThspsConfStateChangeFilter aFilter ); |
|
725 |
|
726 /** |
|
727 * Restores default configuration defined for the application |
|
728 * @since S60 5.0 |
|
729 * @param aHeader ODT header which defines the restored configuration |
|
730 * @param aOdt restored application configuration |
|
731 */ |
|
732 void RestoreDefaultAppConfL( |
|
733 ChspsODT*& aHeader, |
|
734 ChspsODT& aOdt ); |
|
735 |
|
736 /** |
|
737 * HandleDefinitionRespositoryEventL |
|
738 * |
|
739 * @since S60 5.0 |
|
740 */ |
|
741 |
|
742 TBool HandleDefinitionRespositoryEventL( ThspsRepositoryInfo aRepositoryInfo ); |
|
743 |
|
744 /** |
|
745 * RemovePluginFromAppConfs |
|
746 * |
|
747 * @since S60 5.0 |
|
748 */ |
|
749 void RemovePluginFromAppConfsL( |
|
750 const ChspsODT& aOdt, |
|
751 RArray<ThspsRepositoryInfo>& aNotificationParams); |
|
752 |
|
753 /** |
|
754 * InvalidateUninstalledPluginInstancesL |
|
755 * Removes uninstalled plugin instances from an inactive |
|
756 * application configuration by changing them to error state. |
|
757 * @since S60 5.2 |
|
758 * @param aAppODT application configuration to be updated |
|
759 * @param aPluginUid plugin to be uninstalled |
|
760 * @param aPluginIds an array on plugin ids to be processed |
|
761 * @return ETrue if the ODT was updated. |
|
762 */ |
|
763 TBool InvalidateUninstalledPluginInstancesL( |
|
764 ChspsODT& aAppODT, |
|
765 const TInt aPluginUid, |
|
766 const RArray<TInt>& aPluginIds ); |
|
767 |
|
768 /** |
|
769 * UpdatePluginFromAppConfsL |
|
770 * |
|
771 * @since S60 5.0 |
|
772 */ |
|
773 void UpdatePluginFromAppConfsL( ChspsODT& aOdt, |
|
774 RArray<ThspsRepositoryInfo>& aNotificationParams ); |
|
775 /** |
|
776 * UpdatePluginConfigurationL |
|
777 * |
|
778 * @since S60 5.0 |
|
779 */ |
|
780 |
|
781 TInt UpdatePluginConfigurationL( |
|
782 ChspsODT& aOdt, |
|
783 ChspsODT& aPluginOdt, |
|
784 RArray<TInt>& aPluginIds ); |
|
785 |
|
786 /** |
|
787 * Replaces plugin configuration in the provided |
|
788 * application configuration |
|
789 * @since S60 5.0 |
|
790 * @param aAppODT is an instance of the the application configuration |
|
791 * @param aPluginId is an id of the plugin to be replaced |
|
792 * @param aPluginODT is an instance of the plugin configuration to be added |
|
793 */ |
|
794 TInt ReplaceConfigurationL( |
|
795 ChspsODT& aAppODT, |
|
796 const TInt aPluginId, |
|
797 const ChspsODT& aPluginODT ); |
|
798 |
|
799 /** |
|
800 * Returns position of a plugin in the plugins list |
|
801 * @since S60 5.0 |
|
802 * @param aPluginNode is a plugin to be found |
|
803 * @return position of -1 |
|
804 */ |
|
805 TInt FindPluginPosition( |
|
806 ChspsDomNode& aPluginNode ); |
|
807 |
|
808 /** |
|
809 * Copies logo icons to Homescreen's private folder |
|
810 * @since S60 5.1 |
|
811 * @param aAppUid Identifies the client process |
|
812 */ |
|
813 void CopyIconsToHomescreenL( |
|
814 const TUint aAppUid ); |
|
815 |
|
816 /** |
|
817 * Appends missing plugin with a dummy configuration where status="Error" |
|
818 * @since S60 5.0 |
|
819 * @param aAppDom is a DOM of an application configuration |
|
820 * @param aMissingPluginNode is a plug-in node which was not found from the Plugin Repository |
|
821 * @param aPluginUid is an UID of the missing plugin |
|
822 */ |
|
823 void AddErrorConfigurationL( |
|
824 ChspsDomDocument& aAppDom, |
|
825 ChspsDomNode& aMissingPluginNode, |
|
826 const TInt aPluginUid ); |
|
827 |
|
828 /** |
|
829 * Removes all plugins from the plugins node and related |
|
830 * resources from the resource array. |
|
831 * @since S60 5.2 |
|
832 * @param aAppODT Application configuration |
|
833 * @return error code |
|
834 */ |
|
835 TInt RestoreActiveViewL( |
|
836 ChspsODT& aAppODT ); |
|
837 |
|
838 /** |
|
839 * Finds a plugin node which is the active view configuration. |
|
840 * @since S60 5.2 |
|
841 * @param aAppODT Application configuration |
|
842 * @return Active plugin node or NULL |
|
843 */ |
|
844 ChspsDomNode* FindActiveView( |
|
845 ChspsODT& aAppODT ); |
|
846 |
|
847 /** |
|
848 * Removes all plugin configurations from the provided |
|
849 * plugin node (view configuration). |
|
850 * @since S60 5.2 |
|
851 * @param aAppODT Application configuration |
|
852 * @param aActivePluginNode Plugin node to be modified |
|
853 * @return error code |
|
854 */ |
|
855 TInt RemovePluginConfigurationsL( |
|
856 ChspsODT& aAppODT, |
|
857 ChspsDomNode& aActivePluginNode ); |
|
858 |
|
859 /** |
|
860 * Removes all unlocked views and reset the active view. |
|
861 * Can leave if DOM is corrupted (objects are not found) or in OOM cases. |
|
862 * @since S60 5.2 |
|
863 * @param aAppODT Application configuration |
|
864 */ |
|
865 void RemoveUnlockedViewsL( |
|
866 ChspsODT& aAppODT ); |
|
867 |
|
868 /** |
|
869 * Checks whether the plugin configuration was locked. |
|
870 * @since S60 5.2 |
|
871 * @param aConfNode Configuration node |
|
872 * @return True if it was locked |
|
873 */ |
|
874 TBool IsConfigurationLocked( |
|
875 ChspsDomNode& aConfNode ); |
|
876 |
|
877 private: // Data |
|
878 RMessagePtr2 iMessagePtr; |
|
879 ChspsResult* iResult; |
|
880 TBuf8<KMaxResultDataLength8> iResultData; |
|
881 ThspsServiceRequestMessage iRequestMessage; |
|
882 ThspsServiceCompletedMessage iCompletedMessage; |
|
883 CArrayPtrSeg<HBufC8>* iHeaderDataList; |
|
884 TBool iSubscription; |
|
885 TInt iDeliveryCount; |
|
886 ChspsODT* iSearchMask; |
|
887 ChspsODT* iSetMask; |
|
888 TLanguage iLanguage; |
|
889 |
|
890 ChspsThemeServer& iThemeServer; |
|
891 // Identifies the client application |
|
892 TUint iSecureId; |
|
893 // Reference to central repository |
|
894 CRepository& iCentralRepository; |
|
895 // Reference to definition repository |
|
896 ChspsDefinitionRepository& iDefinitionRepository; |
|
897 // Reference to security enforcer |
|
898 ChspsSecurityEnforcer& iSecurityEnforcer; |
|
899 CArrayPtrSeg<ChspsODT>& iHeaderListCache; |
|
900 ChspsThemeServerSession* iServerSession; // Not owned. |
|
901 CFileMan* iFileMan; |
|
902 #ifdef HSPS_LOG_ACTIVE |
|
903 /** |
|
904 * Log bus. |
|
905 */ |
|
906 ChspsLogBus* iLogBus; |
|
907 #endif |
|
908 }; |
|
909 |
|
910 |
|
911 #endif //__hspsMAINTENANCEHANDLER_H__ |
|
912 // End of File |
|