|
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: Container for individual key-value pairs. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CVIMPSTSETTINGSKEYVALUEPAIRS_H |
|
19 #define __CVIMPSTSETTINGSKEYVALUEPAIRS_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include "cvimpstsettingskeyvaluepair.h" |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <s32strm.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CVIMPSTSettingsLookupKeyValuePair; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * Container for individual key-value pairs. |
|
36 * |
|
37 * @since 3.0 |
|
38 **/ |
|
39 NONSHARABLE_CLASS( CVIMPSTSettingsKeyValuePairs ): public CBase |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * |
|
46 * @since 3.0 |
|
47 */ |
|
48 static CVIMPSTSettingsKeyValuePairs* NewL(); |
|
49 |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CVIMPSTSettingsKeyValuePairs(); |
|
55 |
|
56 |
|
57 private: // Constructors |
|
58 |
|
59 |
|
60 /** |
|
61 * C++ default constructor. |
|
62 */ |
|
63 CVIMPSTSettingsKeyValuePairs(); |
|
64 |
|
65 /** |
|
66 * Symbian OS constructor. |
|
67 */ |
|
68 void ConstructL(); |
|
69 |
|
70 |
|
71 public: // Key value access |
|
72 |
|
73 |
|
74 /** |
|
75 * Key-value setters. |
|
76 * |
|
77 * |
|
78 * @since 3.0 |
|
79 * @param aKey The key to use identify the value. |
|
80 * @param aValue The value to assign for keyword. |
|
81 * @return Error code. One of following: |
|
82 * KErrNone: Value assigned/updated succesfully. |
|
83 * KErrGeneral: Different data type already assigned for given key. |
|
84 * KErrNoMemory: No memory to allocate the new value. |
|
85 * Original value for key remains if assigning |
|
86 * value fails, |
|
87 * KErrTooBig: Key and value are too big for storing. Original value |
|
88 * remains. |
|
89 * |
|
90 */ |
|
91 TInt SetValueDesC16( const TDesC& aKey, const TDesC16& aValue ); |
|
92 |
|
93 |
|
94 /** |
|
95 * Key-value getters. |
|
96 * |
|
97 * |
|
98 * @since 3.0 |
|
99 * @param aKey The key to use identify the value. |
|
100 * @param aValue The value to get. Given aValue isn't |
|
101 * changed if reading fails, |
|
102 * @return Error code. One of following: |
|
103 * KErrNone: Value read succesfully. |
|
104 * KErrNotFound: No value yet assigned. |
|
105 * KErrGeneral: Different data type assigned for given key. |
|
106 */ |
|
107 TInt GetValueDesC16( const TDesC& aKey, TPtrC16& aValue ); |
|
108 |
|
109 |
|
110 /** |
|
111 * Key value remove. |
|
112 * |
|
113 * @since 3.0 |
|
114 * @param aKey The key to remove. |
|
115 * @return Error code. One of following: |
|
116 * KErrNone: Key value removed succesfully. |
|
117 * KErrNotFound: Key value not found. |
|
118 */ |
|
119 TInt DeletePair( const TDesC& aKey ); |
|
120 |
|
121 /** |
|
122 * Return Value-pair array. |
|
123 * |
|
124 * @since 3.0 |
|
125 * @return Array of value-pairs: |
|
126 */ |
|
127 RPointerArray< CVIMPSTSettingsKeyValuePair >& Pairs(); |
|
128 |
|
129 |
|
130 private: // Data |
|
131 |
|
132 mutable CVIMPSTSettingsLookupKeyValuePair* iLookupKey; //OWN: Lookup pair |
|
133 |
|
134 RPointerArray< CVIMPSTSettingsKeyValuePair > iPairs; //OWN: Pairs |
|
135 }; |
|
136 |
|
137 #endif // __CVIMPSTSETTINGSKEYVALUEPAIRS_H |
|
138 |
|
139 |
|
140 // End of File |
|
141 |
|
142 |
|
143 |