|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef _SSMSWPPOLICYMAP_H_ |
|
17 #define _SSMSWPPOLICYMAP_H_ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <ssm/ssmswp.h> |
|
21 |
|
22 class CSsmSwpPolicyMapping; |
|
23 |
|
24 /** |
|
25 The class used for storing the available SWPs and the mapping of SWPs to policy files. |
|
26 Entries are sorted on addition and the RPointerArray binary search facilities are used for speedy access. |
|
27 Note: This object is not thread safe |
|
28 |
|
29 @internalComponent |
|
30 @released |
|
31 */ |
|
32 class CSsmSwpPolicyMap : public CBase |
|
33 { |
|
34 public: |
|
35 static CSsmSwpPolicyMap* NewLC(); |
|
36 static CSsmSwpPolicyMap* NewL(); |
|
37 ~CSsmSwpPolicyMap(); |
|
38 |
|
39 // API |
|
40 void AddL(TUint aSwpKey, const TDesC& aFilename); |
|
41 // used for testing |
|
42 #ifdef _DEBUG |
|
43 void DeleteSwpMapL(TUint aSwpKey); |
|
44 #endif |
|
45 const TDesC& FilenameL(TUint aSwpKey) const; |
|
46 |
|
47 protected: |
|
48 CSsmSwpPolicyMap(); |
|
49 const CSsmSwpPolicyMapping* MappingL(const TUint aSwpKey) const; |
|
50 |
|
51 protected: |
|
52 RPointerArray<CSsmSwpPolicyMapping> iItems; |
|
53 }; |
|
54 |
|
55 |
|
56 /** |
|
57 This contains the mapping between the SWP and its policy file name. |
|
58 It is used solely as a container for the CSsmSwpPolicyMap collection and should |
|
59 only be used internally in CSsmSwpPolicyMap and CSsmSwpPolicyMapTestVersion |
|
60 |
|
61 @internalComponent |
|
62 @released |
|
63 */ |
|
64 class CSsmSwpPolicyMapping : public CBase |
|
65 { |
|
66 public: |
|
67 static CSsmSwpPolicyMapping* NewLC(TUint aSwpKey, const TDesC& aFile); |
|
68 static TInt CompareBySwp(const CSsmSwpPolicyMapping& aFirst, const CSsmSwpPolicyMapping& aSecond); |
|
69 ~CSsmSwpPolicyMapping(); |
|
70 TUint SwpKey() const; |
|
71 const TDesC& Filename() const; |
|
72 |
|
73 private: // construction |
|
74 CSsmSwpPolicyMapping(TUint aSwpKey); |
|
75 void ConstructL(const TDesC& aFilename); |
|
76 |
|
77 private: |
|
78 /** our swp key */ |
|
79 TUint iSwpKey; |
|
80 /** our associated file name */ |
|
81 HBufC* iFilename; |
|
82 }; |
|
83 |
|
84 #endif // #define _SSMSWPPOLICYMAP_H_ |