|
1 /* |
|
2 * Copyright (c) 2007-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 * Version : %version: 3 % << Don't touch! Updated by Synergy at check-out. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef HNXMLMODELCACHE_H_ |
|
21 #define HNXMLMODELCACHE_H_ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32hashtab.h> |
|
25 #include <xmlengdom.h> |
|
26 #include <bautils.h> |
|
27 |
|
28 |
|
29 /** |
|
30 * Bitmaps and masks ids cache. |
|
31 * |
|
32 * @since S60 5.0 |
|
33 * @ingroup group_hnmetadatamodel |
|
34 */ |
|
35 NONSHARABLE_CLASS( CHnBitmapIdCache ) : public CBase |
|
36 { |
|
37 |
|
38 private: |
|
39 |
|
40 /** |
|
41 * Default constructor. |
|
42 * |
|
43 * @since S60 5.0 |
|
44 */ |
|
45 CHnBitmapIdCache(); |
|
46 |
|
47 /** |
|
48 * Standard second phase constructor. |
|
49 * |
|
50 * @since S60 5.0 |
|
51 */ |
|
52 void ConstructL(); |
|
53 |
|
54 public: |
|
55 |
|
56 /** |
|
57 * Two-phase constructor. |
|
58 * |
|
59 * @since S60 5.0 |
|
60 */ |
|
61 static CHnBitmapIdCache* NewLC(); |
|
62 |
|
63 /** |
|
64 * Two-phase constructor. |
|
65 * |
|
66 * |
|
67 */ |
|
68 static CHnBitmapIdCache* NewL(); |
|
69 |
|
70 /** |
|
71 * Adds a new entry into the cache. |
|
72 * @param aKey A key identifying a pair: key - value. |
|
73 * @param aValue A value. |
|
74 * |
|
75 * @since S60 5.0 |
|
76 */ |
|
77 TInt AddL( const TDesC8& aKey, TInt aValue ); |
|
78 |
|
79 /** |
|
80 * Checks if the cache contains an entry identifies by a given key. |
|
81 * |
|
82 * @param aSuiteName The name of the suite to be checked. |
|
83 * @return ETrue if a suite of a given name is stored in the cache, |
|
84 * otherwise - EFalse. |
|
85 * |
|
86 * @since S60 5.0 |
|
87 */ |
|
88 TBool ExistsL( const TDesC8& aKey ); |
|
89 |
|
90 /** |
|
91 * Gets an integer value by a given name. |
|
92 * |
|
93 * @param aSuiteName The name corresponding to the xml document to be |
|
94 * retrieved from the cache. |
|
95 * @param aDocument The reference to the xml document. |
|
96 * |
|
97 * @since S60 5.0 |
|
98 */ |
|
99 void GetL( const TDesC8& aKey, TInt& aValue ); |
|
100 |
|
101 /** |
|
102 * Resets the cache - removes all stored xml documents. |
|
103 * |
|
104 * @since S60 5.0 |
|
105 */ |
|
106 void Reset(); |
|
107 |
|
108 /** |
|
109 * Standard C++ virtual destructor. |
|
110 * |
|
111 * @since S60 5.0 |
|
112 */ |
|
113 virtual ~CHnBitmapIdCache(); |
|
114 |
|
115 private: |
|
116 |
|
117 /** |
|
118 * The hash map storing pairs: and an integer value. |
|
119 * |
|
120 * @since S60 5.0 |
|
121 */ |
|
122 RHashMap< HBufC8*, TInt > iEntries; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif /*HNXMLMODELCACHE_H_*/ |