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 |
* Utility for common code.
|
|
17 |
*
|
|
18 |
*
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __hspsSERVERUTIL_H__
|
|
23 |
#define __hspsSERVERUTIL_H__
|
|
24 |
|
|
25 |
// Includes
|
|
26 |
#include <e32def.h>
|
|
27 |
#include <e32base.h>
|
|
28 |
|
|
29 |
// Forward declarations.
|
|
30 |
class ChspsODT;
|
|
31 |
class ChspsDomNode;
|
|
32 |
class ChspsResource;
|
|
33 |
|
|
34 |
// Constants.
|
|
35 |
#define RECURSION_DEPTH_INFINITE (-1)
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Class hspsAttribUtil.
|
|
39 |
*
|
|
40 |
* Static utility for maintainance and installation handlers.
|
|
41 |
* @ingroup group_hspsserver
|
|
42 |
* @lib hspsThemeServer.exe
|
|
43 |
*/
|
|
44 |
class hspsServerUtil
|
|
45 |
{
|
|
46 |
public: // New methods.
|
|
47 |
/**
|
|
48 |
* Generates attributes for the Configuration element from manifest data
|
|
49 |
* @since S60 5.0
|
|
50 |
* @param aOdt is an ODT instance to be updated
|
|
51 |
*/
|
|
52 |
static void GenerateConfigurationAttributesL( ChspsODT& aOdt );
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Generates attributes for the Object element from manifest data
|
|
56 |
* @since S60 5.0
|
|
57 |
* @param aOdt is an ODT instance to be updated
|
|
58 |
*/
|
|
59 |
static void GenerateObjectAttributesL( ChspsODT& aOdt );
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Retrieves locale independent path which used by HSPS clients to access resources
|
|
63 |
* in their private application folders.
|
|
64 |
* @since S60 5.0
|
|
65 |
* @param aResourceLanguage is the language of the resource
|
|
66 |
* @param aPath is the path to be unlocalized
|
|
67 |
*/
|
|
68 |
static void GetLocaleIndependentResourcePath(
|
|
69 |
const TLanguage& aResourceLanguage,
|
|
70 |
TFileName& aPath );
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Retrieves relative path of a resource under the themes folder.
|
|
74 |
* @since S60 5.0
|
|
75 |
* @param aSourceFile is the input file
|
|
76 |
* @param aRelativePath is the relative path
|
|
77 |
*/
|
|
78 |
static void GetRelativeResourcePath(
|
|
79 |
const TFileName& aSourceFile,
|
|
80 |
TPath& aRelativePath );
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Creates a new attribute for the provided plugin node.
|
|
84 |
* @since S60 5.0
|
|
85 |
* @param aPluginsNode is the plugins node that should be modified
|
|
86 |
* @param aAttrName is name of the attribute
|
|
87 |
* @param aValue is value of the attribute
|
|
88 |
* @param aFormat is requested value string format
|
|
89 |
* @return KErrNone
|
|
90 |
*/
|
|
91 |
static TInt AddAttributeNumericL(
|
|
92 |
ChspsDomNode& aNode,
|
|
93 |
const TDesC8& aAttrName,
|
|
94 |
const TInt aValue,
|
|
95 |
const TRadix aFormat = EDecimal );
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Creates a new attribute for the provided plugin node.
|
|
99 |
* @since S60 5.0
|
|
100 |
* @param aPluginsNode is the plugins node that should be modified
|
|
101 |
* @param aAttrName is name of the attribute
|
|
102 |
* @param aValue is value of the attribute
|
|
103 |
*/
|
|
104 |
static void AddAttributeDescL(
|
|
105 |
ChspsDomNode& aNode,
|
|
106 |
const TDesC8& aAttrName,
|
|
107 |
const TDesC8& aValue );
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Finds a configuration node with the provided id attribute
|
|
111 |
* @since S60 5.0
|
|
112 |
* @param aOdt is an instance of the ODT class
|
|
113 |
* @param aConfigurationId is an unique identifier of the configuration node
|
|
114 |
* @return plugins node or NULL if the node couldn't be found
|
|
115 |
*/
|
|
116 |
static ChspsDomNode* FindConfigurationNodeL(
|
|
117 |
ChspsODT& aOdt,
|
|
118 |
const TInt aConfigurationId );
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Finds a plugin node with the provided id
|
|
122 |
* @since S60 5.0
|
|
123 |
* @param aOdt is an instance of the ODT class
|
|
124 |
* @param aPluginId is an ID of the plugin instance to be found
|
|
125 |
* @return Pointer to the plugin node or NULL
|
|
126 |
*/
|
|
127 |
static ChspsDomNode* FindPluginNodeL(
|
|
128 |
ChspsODT& aOdt,
|
|
129 |
const TInt aPluginId );
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Gets an attribute value of a configuration element.
|
|
133 |
* @since S60 5.0
|
|
134 |
* @param aOdt is an ODT instance form which the name is fetched
|
|
135 |
* @param aAttr is the attribute to be found
|
|
136 |
* @return value of the name attribute in a configuration node
|
|
137 |
*/
|
|
138 |
static TPtrC8 FindConfigurationAttrL(
|
|
139 |
const ChspsODT& aOdt,
|
|
140 |
const TDesC8& aAttr );
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Removes plug-in resources from the client app.
|
|
144 |
* @since S60 5.2
|
|
145 |
* @param aFilemanager File manager instance
|
|
146 |
* @param aAppUid UID of the application configuration
|
|
147 |
* @param aPluginODT Plugin configuration
|
|
148 |
*/
|
|
149 |
static void RemoveResourceFilesL(
|
|
150 |
CFileMan& aFilemanager,
|
|
151 |
RFs& aFs,
|
|
152 |
const TInt aAppUid,
|
|
153 |
const ChspsODT& aPluginODT );
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Finds language specific resources from a plug-in and handles copying
|
|
157 |
* of the resources to a destination folder.
|
|
158 |
* @since S60 5.0
|
|
159 |
* @param aAppODT Application configuration
|
|
160 |
* @param aFs Reference to OPEN file server session handle.
|
|
161 |
* @param aFilemanager File manager instance
|
|
162 |
* @param aDeviceLanguage Device language
|
|
163 |
* @param aConfUid Idenifies the plug-in which is to be processed
|
|
164 |
* @param aDestination Target path where the files should be copied to
|
|
165 |
* @param aIsRelevant Set if the source file should be copied without the checks
|
|
166 |
*/
|
|
167 |
static TInt CopyResourceFilesL(
|
|
168 |
ChspsODT& aAppODT,
|
|
169 |
RFs& aFs,
|
|
170 |
CFileMan& aFilemanager,
|
|
171 |
const TInt aDeviceLanguage,
|
|
172 |
const TInt aConfUid,
|
|
173 |
const TDesC& aDestination,
|
|
174 |
const TBool aIsRelevant = EFalse );
|
|
175 |
|
|
176 |
/**
|
|
177 |
* Copies a file to a target path when neccessary.
|
|
178 |
* Target path is created if it's missing.
|
|
179 |
* File is copied if the target's size or date are different or
|
|
180 |
* if the file is missing.
|
|
181 |
* @since S60 5.0
|
|
182 |
* @param aFs Reference to OPEN file server session handle.
|
|
183 |
* @param aFilemanager Referemce to file manager instance
|
|
184 |
* @param aTargetPath Path where the file should be copied to
|
|
185 |
* @param aFilename Path and name of the file to be copied
|
|
186 |
* @param aIsRelevant Set if the source file should be copied without the checks
|
|
187 |
* @return error code
|
|
188 |
*/
|
|
189 |
static TInt CopyResourceFileL(
|
|
190 |
RFs& aFs,
|
|
191 |
CFileMan& aFilemanager,
|
|
192 |
const TPath& aTargetPath,
|
|
193 |
const TFileName& aSourceFile,
|
|
194 |
const TBool aIsRelevant = EFalse );
|
|
195 |
|
|
196 |
/**
|
|
197 |
* Checks:
|
|
198 |
* - Is there enough space for target file?
|
|
199 |
* - Do source and target files have same timestamp and size
|
|
200 |
* (if target file exists)?
|
|
201 |
*
|
|
202 |
* @param aSource Full path to source file.
|
|
203 |
* @param aTarget Full path to target file.
|
|
204 |
* @param aFs Reference to OPEN file server session handle.
|
|
205 |
* @return TBool ETrue if copy can continue, EFalse if copy not needed.
|
|
206 |
*/
|
|
207 |
static TBool ResourceCopyIsRelevantL(
|
|
208 |
const TDesC& aSource,
|
|
209 |
const TDesC& aTarget,
|
|
210 |
RFs& aFs );
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Check configuration states
|
|
214 |
* @since S60 5.0
|
|
215 |
* @param aOdt ODT instance to be checked
|
|
216 |
* @param aConfState Old state to be replaced
|
|
217 |
* @param aNextConfState New state
|
|
218 |
* @param aOdtUpdated ODT update status
|
|
219 |
*/
|
|
220 |
|
|
221 |
static void UpdateConfigurationStateL(
|
|
222 |
ChspsODT& aOdt,
|
|
223 |
TDesC8& aConfState,
|
|
224 |
TDesC8& aNextConfState,
|
|
225 |
TBool& aOdtUpdated );
|
|
226 |
|
|
227 |
/**
|
|
228 |
* Check state of an application configuration
|
|
229 |
* @since S60 5.0
|
|
230 |
* @param aOdt ODT instance to be checked
|
|
231 |
* @param aConfState Old state to be replaced
|
|
232 |
* @param aNextConfState New state
|
|
233 |
*/
|
|
234 |
static void UpdateAppConfigurationStateL(
|
|
235 |
ChspsODT& aAppOdt,
|
|
236 |
const TDesC8& aConfState,
|
|
237 |
const TDesC8& aNextConfState );
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Finds a defined node with defined attribute value
|
|
241 |
* @since S60 5.0
|
|
242 |
* @param aOdt is an instance of the ODT class
|
|
243 |
* @param aAttrName is name of the attribute to be found
|
|
244 |
* @param aAttrValue is the value which the attribute should hold
|
|
245 |
*/
|
|
246 |
static ChspsDomNode* FindNodeByAttributeL(
|
|
247 |
ChspsODT& aOdt,
|
|
248 |
const TDesC8& aNodeName,
|
|
249 |
const TDesC8& aAttrName,
|
|
250 |
const TDesC8& aAttrValue );
|
|
251 |
|
|
252 |
/**
|
|
253 |
* Retrieves all unique plugin uids from a configuration.
|
|
254 |
* @since S60 5.0
|
|
255 |
* @param aOdt holds the configuration from which the plugins are searched from
|
|
256 |
* @param aPluginArray is an array of found plugin uids
|
|
257 |
*/
|
|
258 |
static void FindUniquePluginsL(
|
|
259 |
ChspsODT& aOdt,
|
|
260 |
RArray<TInt>& aPluginArray );
|
|
261 |
|
|
262 |
|
|
263 |
/**
|
|
264 |
* Converts a hex value string (0xXXXX) to TUint.
|
|
265 |
*
|
|
266 |
* @param aStr String containing hex value.
|
|
267 |
* @param aTrg Reference to target TUint. Will be modified only
|
|
268 |
* if conversion is successful.
|
|
269 |
* @return KErrNone if successfull. Otherwise related symbian error code.
|
|
270 |
*/
|
|
271 |
static TInt HexString2Uint(
|
|
272 |
const TDesC8& aStr,
|
|
273 |
TUint& aTrg );
|
|
274 |
|
|
275 |
/**
|
|
276 |
* Converts a decimal value string to TInt
|
|
277 |
* @param aStr String containing hex value
|
|
278 |
* @return corresponding TInt
|
|
279 |
*/
|
|
280 |
static TInt DecString2Int(
|
|
281 |
const TDesC8& aStr );
|
|
282 |
|
|
283 |
/**
|
|
284 |
* Returns a count of plugin instances.
|
|
285 |
* @since S60 5.0
|
|
286 |
* @param aAppODT is an instance of the the application configuration
|
|
287 |
* @param aPluginUid is an UID of the plugin instances to be found
|
|
288 |
* @param aInstanceCount is the return value
|
|
289 |
*/
|
|
290 |
static void PluginInstanceCountL(
|
|
291 |
const ChspsODT& aAppODT,
|
|
292 |
const TInt aPluginUid,
|
|
293 |
TInt& aInstanceCount );
|
|
294 |
/**
|
|
295 |
* Converts UID in DesC8 format into TUid format.
|
|
296 |
* @since S60 5.0
|
|
297 |
* @param aStr is the descriptor value to be converted
|
|
298 |
* @return the converted uid value
|
|
299 |
*/
|
|
300 |
static TUid ConvertDescIntoUid(
|
|
301 |
const TDesC8& aStr );
|
|
302 |
/**
|
|
303 |
* Finds a child node by tag
|
|
304 |
* @since S60 5.0
|
|
305 |
* @param aNodeTag is the tag of the child node to be found
|
|
306 |
* @param aParentNode is the node whose child is searched
|
|
307 |
* @param aIndex is index that sets position where to start search
|
|
308 |
* @return pointer to child node
|
|
309 |
*/
|
|
310 |
|
|
311 |
static ChspsDomNode* FindChildNodeByTagL(
|
|
312 |
const TDesC8& aNodeTag,
|
|
313 |
ChspsDomNode& aParentNode,
|
|
314 |
TInt& aIndex );
|
|
315 |
|
|
316 |
/**
|
|
317 |
* Returns fixed name of ODT resources (e.g. clock.o0005 name converts into clock.o0000)
|
|
318 |
* @since S60 5.0
|
|
319 |
* @param aNameAndExtension is resource name to be fixed
|
|
320 |
* @return fixed resource name
|
|
321 |
*/
|
|
322 |
static TFileName GetFixedOdtName(
|
|
323 |
const TDesC& aNameAndExtension );
|
|
324 |
|
|
325 |
/**
|
|
326 |
* Finds files from defined directory and its sub directories from
|
|
327 |
* C: drive, Z: drive or both. If the directory path contains a drive
|
|
328 |
* files are searched from that drive only.
|
|
329 |
* @since S60 5.0
|
|
330 |
* @param aDirName is directory path where the files are searched
|
|
331 |
* @param aFileName is name of file to be searched
|
|
332 |
* @param aFiles is a list of found files (full path)
|
|
333 |
*/
|
|
334 |
static void FindFilesL(
|
|
335 |
const TDesC& aDirName,
|
|
336 |
const TDesC& aFileName,
|
|
337 |
RArray <TFileName>& aFiles );
|
|
338 |
|
|
339 |
/**
|
|
340 |
* Finds files from defined directory from C: drive, Z: drive or both.
|
|
341 |
* If the directory path contains a drive files are searched from that
|
|
342 |
* drive only.
|
|
343 |
* @since S60 5.0
|
|
344 |
* @param aDirName is directory path where the files are searched
|
|
345 |
* @param aFileName is name of file to be searched
|
|
346 |
* @param aFiles is a list of found files (full path)
|
|
347 |
*/
|
|
348 |
static void FindFilesFromDirL(
|
|
349 |
const TDesC& aDirName,
|
|
350 |
const TDesC& aFileName,
|
|
351 |
RArray <TFileName>& aFiles );
|
|
352 |
|
|
353 |
/**
|
|
354 |
* Set node attribute value. Updated node is defined with
|
|
355 |
* node name, attribute name and attribute value
|
|
356 |
* @since S60 5.0
|
|
357 |
* @param aOdt is an instance of the ODT class
|
|
358 |
* @param aNodeName is name of updated node
|
|
359 |
* @param aAttrName is name of the attribute to be found
|
|
360 |
* @param aAttrValue is the value which the attribute should hold
|
|
361 |
* @param aSetAttrName is name of updated attribute
|
|
362 |
* @param aSetAttrValue is new value of updated attribute
|
|
363 |
*/
|
|
364 |
static void SetAttributeValueL(
|
|
365 |
const ChspsODT& aOdt,
|
|
366 |
const TDesC8& aNodeName,
|
|
367 |
const TDesC8& aAttrName,
|
|
368 |
const TDesC8& aAttrValue,
|
|
369 |
const TDesC8& aSetAttrName,
|
|
370 |
const TDesC8& aSetAttrValue );
|
|
371 |
|
|
372 |
/**
|
|
373 |
* Get node attribute value. Node which attribute value is requested
|
|
374 |
* is defined with node name, attribute name and attribute value
|
|
375 |
* @since S60 5.0
|
|
376 |
* @param aOdt is an instance of the ODT class
|
|
377 |
* @param aNodeName is the name of node which attribute value is requested
|
|
378 |
* @param aAttrName is the name of the attribute which should be contained by the node
|
|
379 |
* @param aAttrValue is the requested value of the attribute
|
|
380 |
* @param aGetAttrName is the name of attribute which value is requested
|
|
381 |
* @param aGetAttrValue is the requested attribute value
|
|
382 |
*/
|
|
383 |
static void GetAttributeValueL(
|
|
384 |
const ChspsODT& aOdt,
|
|
385 |
const TDesC8& aNodeName,
|
|
386 |
const TDesC8& aAttrName,
|
|
387 |
const TDesC8& aAttrValue,
|
|
388 |
const TDesC8& aGetAttrName,
|
|
389 |
TPtrC8& aGetAttrValue );
|
|
390 |
|
|
391 |
/**
|
|
392 |
* Checks resource files of defined configuration
|
|
393 |
* Function leaves if all resource files cannot be found
|
|
394 |
* @since S60 5.0
|
|
395 |
* @param aOdt is an instance of the ODT class
|
|
396 |
* @param aConfUid is configuration UID which resources are checked
|
|
397 |
*/
|
|
398 |
static void CheckResourceFilesL(
|
|
399 |
const ChspsODT& aOdt,
|
|
400 |
const TInt aConfUid );
|
|
401 |
|
|
402 |
/**
|
|
403 |
* Returns configuration's version string
|
|
404 |
* Function leaves if configuration cannot be found
|
|
405 |
* @since S60 5.0
|
|
406 |
* @param aOdt is an instance of the ODT class
|
|
407 |
* @param aConfUid is configuration UID which version is requested
|
|
408 |
* @param aVersion is configuration version string
|
|
409 |
*/
|
|
410 |
static void CheckConfigurationVersionL(
|
|
411 |
ChspsODT& aOdt,
|
|
412 |
const TInt aConfUid,
|
|
413 |
const TDesC& aVersion );
|
|
414 |
|
|
415 |
/**
|
|
416 |
* Edit mode for EditNodeActivity method.
|
|
417 |
*/
|
|
418 |
enum TNodeEditMode
|
|
419 |
{
|
|
420 |
EActivateFirst = 0, // Activate first one on specific level only.
|
|
421 |
// Others will be deactivated.
|
|
422 |
|
|
423 |
EDeactivateAll // Deactivate all.
|
|
424 |
};
|
|
425 |
|
|
426 |
/**
|
|
427 |
* Modify node's childs according to given edit mode.
|
|
428 |
* Recursive method. Modifies only nodes that are type plugin.
|
|
429 |
*
|
|
430 |
* @since S60 5.0
|
|
431 |
* @param aRootNode Root node to start tree recursion.
|
|
432 |
* @param aEditMode Edit mode. Look for TNodeEditMode.
|
|
433 |
* @param aDepth Optional edit depth. e.g. If 1 then
|
|
434 |
* only one level of child nodes is processed.
|
|
435 |
* If not defined (or RECURSION_DEPTH_INFINITE
|
|
436 |
* used) then whole node tree from aRootNode
|
|
437 |
* forward will be processed.
|
|
438 |
*/
|
|
439 |
static void EditPluginNodeActivityL( ChspsDomNode* aRootNode,
|
|
440 |
const TNodeEditMode aEditMode,
|
|
441 |
TInt aDepth = RECURSION_DEPTH_INFINITE );
|
|
442 |
|
|
443 |
/**
|
|
444 |
* Get active plugin node.
|
|
445 |
* Not recursive method. Only one level from parent will be checked.
|
|
446 |
*
|
|
447 |
* @since S60 5.0
|
|
448 |
* @param aParentNode Parent node.
|
|
449 |
* @return ChspsDomNode* Pointer to active plugin node. NULL if none found.
|
|
450 |
*/
|
|
451 |
static ChspsDomNode* GetActivePluginNode( ChspsDomNode* aParentNode );
|
|
452 |
|
|
453 |
/**
|
|
454 |
* Get plugin id of a node.
|
|
455 |
*
|
|
456 |
* @since S60 5.0
|
|
457 |
* @param aNode Node.
|
|
458 |
* @return TInt Plugin id.
|
|
459 |
*/
|
|
460 |
static TInt GetPluginId( ChspsDomNode* aNode );
|
|
461 |
|
|
462 |
/**
|
|
463 |
* Get plugin uid of a node.
|
|
464 |
*
|
|
465 |
* @since S60 5.0
|
|
466 |
* @param aNode Node.
|
|
467 |
* @return TUid Plugin uid.
|
|
468 |
*/
|
|
469 |
static TUid GetPluginUid( ChspsDomNode* aNode );
|
|
470 |
|
|
471 |
/**
|
|
472 |
* Gather plugin ids for specific plugin uid from given ODT.
|
|
473 |
* @since S60 5.0
|
|
474 |
* @param aAppODT ODT to search plugin ids from.
|
|
475 |
* @param aPluginUid Plugin uid to be used as search keyword.
|
|
476 |
* @param aPluginIds Target array for plugin ids.
|
|
477 |
*/
|
|
478 |
static void GetPluginIdsByUidL(
|
|
479 |
const ChspsODT& aAppODT,
|
|
480 |
const TUid aPluginUid,
|
|
481 |
RArray<TInt>& aPluginIds );
|
|
482 |
|
|
483 |
/**
|
|
484 |
* Finds a parent node with defined name and attribute
|
|
485 |
* for defined child node
|
|
486 |
* @since S60 5.0
|
|
487 |
* @param aNode Child node
|
|
488 |
* @param aNodeName Name of parent node
|
|
489 |
* @param aAttrName Name of parent node attribute
|
|
490 |
* @param aAttrValue Value of parent node attribute
|
|
491 |
* @return pointer to parent node or
|
|
492 |
* NULL if defined parent node is not found
|
|
493 |
*/
|
|
494 |
static ChspsDomNode* GetParentNode(
|
|
495 |
const ChspsDomNode& aNode,
|
|
496 |
const TDesC8& aNodeName,
|
|
497 |
const TDesC8& aAttrName,
|
|
498 |
const TDesC8& aAttrValue );
|
|
499 |
|
|
500 |
/**
|
|
501 |
* Retrieves filename from a logo declaration.
|
|
502 |
* @since S60 5.2
|
|
503 |
* @param aFileDeclaration "SKIN():MIF()", "MIF()", "UID()" or "file.ext" string
|
|
504 |
* @param aFilename Referred file name or NULL
|
|
505 |
* @return True if a file was referred from the declaration
|
|
506 |
*/
|
|
507 |
static TBool IsLogoFile(
|
|
508 |
const TDesC& aFileDeclaration,
|
|
509 |
TFileName& aFilename );
|
|
510 |
|
|
511 |
/**
|
|
512 |
* Resolve resource files that need to be copied,
|
|
513 |
* plug-in may not have requested localization.
|
|
514 |
*
|
|
515 |
* @since S60 5.1
|
|
516 |
*
|
|
517 |
* @param aODT Configuration.
|
|
518 |
* @param aConfUid Plugin which is to be processed.
|
|
519 |
* @param aActiveLanguage Active language.
|
|
520 |
* @param aWidgetResources Target array. Will receive list
|
|
521 |
* of resources if any applicable.
|
|
522 |
* Ownership of given resources is not transferred!
|
|
523 |
*/
|
|
524 |
static void GetResourcesForLanguageL(
|
|
525 |
ChspsODT& aODT,
|
|
526 |
const TInt aConfUid,
|
|
527 |
const TLanguage aActiveLanguage,
|
|
528 |
RPointerArray<ChspsResource>& aWidgetResources );
|
|
529 |
|
|
530 |
/**
|
|
531 |
* Check if there is enough space on given drive for resources included in ODT.
|
|
532 |
*
|
|
533 |
* @since S60 5.1
|
|
534 |
*
|
|
535 |
* @param aODT Configuration.
|
|
536 |
* @param aActiveLanguage Active language.
|
|
537 |
* @param aFs Reference to open file server handle.
|
|
538 |
* @param aDriveNumber Drive number. Default EDriveC.
|
|
539 |
* @param aAdditionalDiskSpace Additional disk space added to disk (bytes)
|
|
540 |
* space requirement. Default 0.
|
|
541 |
*
|
|
542 |
* @return TInt System wide error code. KErrDiskFull
|
|
543 |
* if not enough space on C drive.
|
|
544 |
*/
|
|
545 |
static TInt EnoughDiskSpaceAvailableL(
|
|
546 |
ChspsODT& aODT,
|
|
547 |
const TLanguage aActiveLanguage,
|
|
548 |
RFs& aFs,
|
|
549 |
const TDriveNumber aDriveNumber = EDriveC,
|
|
550 |
const TInt aAdditionalDiskSpace = 0 );
|
|
551 |
|
|
552 |
/**
|
|
553 |
* Finds a node by tag
|
|
554 |
* @since S60 5.0
|
|
555 |
* @param aNodeTag is the tag of the node to be found
|
|
556 |
* @param aDomNode is the root node where to search specific node
|
|
557 |
* @return pointer to node that is found
|
|
558 |
*/
|
|
559 |
static ChspsDomNode* FindNodeByTagL(
|
|
560 |
const TDesC8& aNodeTag,
|
|
561 |
ChspsDomNode& aDomNode );
|
|
562 |
|
|
563 |
/**
|
|
564 |
* Eclipsing enabler for customization where the input is
|
|
565 |
* searched from all secure unremovable drives.
|
|
566 |
* Drives are searched in descending alphabetical order,
|
|
567 |
* from Y: to A:, and ending with the Z: drive.
|
|
568 |
* All drives which end-user can freely modify/crack
|
|
569 |
* are skipped from the search.
|
|
570 |
* @since S60 5.2
|
|
571 |
* @param aFs is a reference to open file server session handle
|
|
572 |
* @param aPath is path of the file
|
|
573 |
* @param aFilename is name and extension of the file
|
|
574 |
* @param aFindFromUdaEmmcDrives is true if files should be searched from
|
|
575 |
* the UDA/eMMC drives
|
|
576 |
* @param aDrivePathName Full path with a drive letter to the
|
|
577 |
* resource file (output)
|
|
578 |
*/
|
|
579 |
static TInt FindFile(
|
|
580 |
RFs& aFs,
|
|
581 |
const TDesC& aPath,
|
|
582 |
const TDesC& aFilename,
|
|
583 |
const TBool aFindFromUdaEmmcDrives,
|
|
584 |
TFileName& aDrivePathName );
|
|
585 |
|
|
586 |
/**
|
|
587 |
* Resolves icon path information from the provided logo declaration.
|
|
588 |
* Example:
|
|
589 |
* Decl. = "mif(536999050\270513751\268475903\1.0\sources\icon.mif)"
|
|
590 |
* Source = "c\private\200159c0\themes\536999050\270513751\268475903\1.0\sources\icon.mif"
|
|
591 |
* Target = "c\private\102750f0\536999050\270513751\268475903\1.0\sources\icon.mif"
|
|
592 |
* Up.decl = "mif(c\private\102750f0\536999050\270513751\268475903\1.0\sources\icon.mif)"
|
|
593 |
* @since S60 5.2
|
|
594 |
* @param aLogoDeclaration Skin():mif(), mif(), uid(), icon.mif declaration
|
|
595 |
* @param aAppUid Identifies the private directory where the logo file is copied to
|
|
596 |
* @param aTargetPath Empty or location of the target file
|
|
597 |
* @param aSourcePath Empty or location of the source file
|
|
598 |
* @param aUpdatedDeclaration Empty or declaration which points to the target location
|
|
599 |
*/
|
|
600 |
static void PopulateLogoPathsL(
|
|
601 |
const TDesC& aLogoDeclaration,
|
|
602 |
const TUint aAppUid,
|
|
603 |
RBuf& aTargetPath,
|
|
604 |
RBuf& aSourcePath,
|
|
605 |
RBuf& aUpdatedDeclaration );
|
|
606 |
|
|
607 |
/**
|
|
608 |
* Finds ecplised files from the provided path in given drive order.
|
|
609 |
* @since S60 5.2
|
|
610 |
* @param aFs is a reference to open file server session handle
|
|
611 |
* @param aDriveArray An array of drives in search order
|
|
612 |
* @param aPath Relative path to be found
|
|
613 |
* @param aFileArray Search results or empty
|
|
614 |
* @param aDeviceLanguages An array of languages the HW supports
|
|
615 |
* @param aRecursive True if files should be found from any sudirectories
|
|
616 |
*/
|
|
617 |
static void FindResourcesL(
|
|
618 |
RFs& aFs,
|
|
619 |
const RArray<TInt>& aDriveArray,
|
|
620 |
const TDesC& aPath,
|
|
621 |
RPointerArray<HBufC>& aFileArray,
|
|
622 |
CArrayFixFlat<TInt>* aDeviceLanguages,
|
|
623 |
TBool aRecursive = EFalse );
|
|
624 |
|
|
625 |
/**
|
|
626 |
* Returns an array of languages which can be used in the UI.
|
|
627 |
* @since S60 5.2
|
|
628 |
* @param aLanguages Array of language ids
|
|
629 |
*/
|
|
630 |
static void GetInstalledLanguagesL(
|
|
631 |
CArrayFixFlat<TInt>*& aLanguages );
|
|
632 |
/**
|
|
633 |
* Returns index of internal mass memory drive
|
|
634 |
* @since S60 5.2
|
|
635 |
* @param aFs Reference to open file server handle.
|
|
636 |
* @return index of internal mass memory drive. KErrNotFound if drive
|
|
637 |
* does not exists.
|
|
638 |
*/
|
|
639 |
static TInt GetEmmcDrivePath( RFs& aFs );
|
|
640 |
|
|
641 |
/**
|
|
642 |
* Removes all plugin resources from the provided ODT instance.
|
|
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 |
static TInt RemovePluginResourcesL(
|
|
649 |
ChspsODT& aAppODT,
|
|
650 |
const TInt aPluginUid );
|
|
651 |
private:
|
|
652 |
/**
|
|
653 |
* Internal method. Do not call directly!
|
|
654 |
*
|
|
655 |
* Modify node's childs according to given edit mode.
|
|
656 |
* Recursive method. Modifies only nodes that are type plugin.
|
|
657 |
*
|
|
658 |
* @since S60 5.0
|
|
659 |
* @param aRootNode Root node to start tree recursion.
|
|
660 |
* @param aEditMode Edit mode. Look for TNodeEditMode.
|
|
661 |
* @param aDepth Edit depth. e.g. If 1 then
|
|
662 |
* only one level of child nodes is processed.
|
|
663 |
* If RECURSION_DEPTH_INFINITE used
|
|
664 |
* then whole node tree from aRootNode
|
|
665 |
* forward will be processed.
|
|
666 |
*/
|
|
667 |
static void _EditPluginNodeActivityL( ChspsDomNode* aRootNode,
|
|
668 |
const TNodeEditMode aEditMode,
|
|
669 |
TInt& aDepth );
|
|
670 |
|
|
671 |
/**
|
|
672 |
* Not for instanciation. Only static functionality provided.
|
|
673 |
*/
|
|
674 |
hspsServerUtil();
|
|
675 |
};
|
|
676 |
|
|
677 |
#endif //__hspsSERVERUTIL_H__
|