1 /* |
|
2 * Copyright (c) 2004 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: This interface defines a generic data type |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef I_ALFMAP_H |
|
21 #define I_ALFMAP_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <alf/ialfvarianttype.h> |
|
26 #include <osn/osntypes.h> |
|
27 |
|
28 namespace osncore |
|
29 { |
|
30 class UString; |
|
31 } |
|
32 |
|
33 using osncore::UString; |
|
34 |
|
35 namespace Alf |
|
36 { |
|
37 /** |
|
38 * An interface for Container data type. |
|
39 * |
|
40 * @lib hitchcockwidgetmodel.lib |
|
41 * @since S60 ?S60_version |
|
42 * @status Draft |
|
43 */ |
|
44 class IAlfMap : public IAlfVariantType |
|
45 { |
|
46 public: |
|
47 |
|
48 |
|
49 /** |
|
50 * Gets the Number of items in the container |
|
51 * |
|
52 * @return number of items in the container |
|
53 * @since S60 ?S60_version |
|
54 */ |
|
55 virtual int count() const = 0; |
|
56 |
|
57 /** |
|
58 * Gets the Item at a given index in the container |
|
59 * @param aIndex - index at which the element is required |
|
60 * @return item as a MlfVariantType |
|
61 * @since S60 ?S60_version |
|
62 */ |
|
63 virtual IAlfVariantType* item(uint aIndex) = 0; |
|
64 |
|
65 /** |
|
66 * Gets the Name at a given index in the container |
|
67 * @param aIndex - index at which the name of the element in the map is required |
|
68 * @return item name as a TDesC8 |
|
69 * @since S60 ?S60_version |
|
70 */ |
|
71 virtual const UString& name(uint aIndex) const = 0; |
|
72 |
|
73 /** |
|
74 * Clones the entire container |
|
75 * |
|
76 * @return the cloned container |
|
77 * @since S60 ?S60_version |
|
78 */ |
|
79 virtual IAlfMap* clone() = 0; |
|
80 |
|
81 /** |
|
82 * Removes an item from given index in the container |
|
83 * @param aIndex - index at which the element is to be removed |
|
84 * @return item as a MlfVariantType |
|
85 * @since S60 ?S60_version |
|
86 */ |
|
87 virtual void removeItem(uint aIndex) = 0; |
|
88 |
|
89 /** |
|
90 * Clear the Container |
|
91 * |
|
92 * @return void |
|
93 * @since S60 ?S60_version |
|
94 */ |
|
95 virtual void clear() = 0; |
|
96 |
|
97 /** |
|
98 * Replace an item from given index in the container |
|
99 * @param aIndex - index at which the element is to be replaced |
|
100 * @param aNewData - new Data to be replaced |
|
101 * @return void |
|
102 * @since S60 ?S60_version |
|
103 */ |
|
104 virtual void replaceItem(uint aIndex, IAlfVariantType* aNewData ) = 0; |
|
105 |
|
106 /** |
|
107 * Adds a variantData item into the container |
|
108 * @param aData - varaint Data Item to be added into the container |
|
109 * @param @Name - Name associated with this Variant Data Item. |
|
110 * @return void |
|
111 * @since S60 ?S60_version |
|
112 */ |
|
113 virtual void addItem(IAlfVariantType* aData, const UString& aName)=0; |
|
114 |
|
115 /** |
|
116 * Adds a variantData item into the container |
|
117 * @param aIndex index where the data is added |
|
118 * @param aData - variant Data Item to be added into the container |
|
119 * @param @Name - Name associated with this Variant Data Item. |
|
120 * @return void |
|
121 * @since S60 ?S60_version |
|
122 */ |
|
123 virtual void addItem(uint aIndex, IAlfVariantType* aData, const UString& aName)=0; |
|
124 |
|
125 /** |
|
126 * Gets the item by the given name. |
|
127 * @param aName The name associated with requested item. |
|
128 * @return The value corresponding to the name of the item. |
|
129 * @since S60 ?S60_version |
|
130 */ |
|
131 virtual IAlfVariantType* item(const UString& aName) = 0; |
|
132 |
|
133 /** |
|
134 * Gets the index of the item by the given name. |
|
135 * @param aName The name associated with requested item. |
|
136 * @return The index corresponding to the name of the item, or -1 if not found. |
|
137 * @since S60 ?S60_version |
|
138 */ |
|
139 virtual int itemIndex(const UString& aName) = 0; |
|
140 |
|
141 /** |
|
142 * Removes the Item associated with a name |
|
143 * @param aName - Name associated with this Variant Data Item that is required to be removed in the map |
|
144 * @return void |
|
145 * @since S60 ?S60_version |
|
146 */ |
|
147 virtual void removeItem(const UString& aName) = 0; |
|
148 |
|
149 /** |
|
150 * Replaces the Item associated with a name in the container with a new variant data type |
|
151 * @param aName - Name associated with this Variant Data Item that is required to be replaced in the map |
|
152 * @aNewData - New Data to be set |
|
153 * @return void |
|
154 * @since S60 ?S60_version |
|
155 */ |
|
156 virtual void replaceItem(const UString& aName,IAlfVariantType* aNewData) = 0; |
|
157 |
|
158 /** |
|
159 * Destructor |
|
160 * |
|
161 * @since S60 ?S60_version |
|
162 */ |
|
163 virtual ~IAlfMap(){} |
|
164 }; |
|
165 |
|
166 } // namespace Alf |
|
167 |
|
168 #endif // I_ALFMAP_H |
|
169 |
|
170 // End of File |
|