|
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_ALFCONTAINER_H |
|
21 #define I_ALFCONTAINER_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <alf/ialfvarianttype.h> |
|
26 |
|
27 namespace Alf |
|
28 { |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class IAlfSortFunction; |
|
32 |
|
33 /** |
|
34 * An interface for Container data type. |
|
35 * @lib hitchcockwidgetmodel.lib |
|
36 * @since S60 ?S60_version |
|
37 * @status Draft |
|
38 */ |
|
39 class IAlfContainer : public IAlfVariantType |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Adds a variantData item into the container |
|
45 * @param aData variant data to be added into the container |
|
46 * @return void. |
|
47 * @since S60 ?S60_version |
|
48 */ |
|
49 virtual void addItem(IAlfVariantType* aData)=0; |
|
50 |
|
51 /** |
|
52 * Adds a variantData item into the container |
|
53 * @param aIndex index where the data is added |
|
54 * @param aData variant data to be added into the container |
|
55 * @return void. |
|
56 * @since S60 ?S60_version |
|
57 */ |
|
58 virtual void addItem(uint aIndex, IAlfVariantType* aData)=0; |
|
59 |
|
60 /** |
|
61 * Gets the Number of items in the container |
|
62 * |
|
63 * @return number of items in the container |
|
64 * @since S60 ?S60_version |
|
65 */ |
|
66 virtual int count() = 0; |
|
67 |
|
68 /** |
|
69 * Gets the Item at a given index in the container |
|
70 * @param aIndex - index at which the element is required |
|
71 * @return item as a MlfVariantType |
|
72 * @since S60 ?S60_version |
|
73 */ |
|
74 virtual IAlfVariantType* item(uint aIndex) = 0; |
|
75 |
|
76 /** |
|
77 * Clones the entire container |
|
78 * |
|
79 * @return the cloned container |
|
80 * @since S60 ?S60_version |
|
81 */ |
|
82 virtual IAlfContainer* clone() = 0; |
|
83 |
|
84 |
|
85 /** |
|
86 * Removes an item from given index in the container |
|
87 * @param aIndex - index at which the element is to be removed |
|
88 * @return item as a MlfVariantType |
|
89 * @since S60 ?S60_version |
|
90 */ |
|
91 virtual void removeItem(uint aIndex) = 0; |
|
92 |
|
93 /** |
|
94 * Clear the Container |
|
95 * |
|
96 * @return void |
|
97 * @since S60 ?S60_version |
|
98 */ |
|
99 virtual void clear() = 0; |
|
100 |
|
101 /** |
|
102 * Replace an item from given index in the container |
|
103 * @param aIndex - index at which the element is to be replaced |
|
104 * @param aNewData - new Data to be replaced |
|
105 * @return void |
|
106 * @since S60 ?S60_version |
|
107 */ |
|
108 virtual void replaceItem(uint aIndex, IAlfVariantType* aNewData ) = 0; |
|
109 |
|
110 /** |
|
111 * sorts the container using user defined sort function. |
|
112 * |
|
113 * @param aSortFunction - sort function. |
|
114 * @since S60 ?S60_version |
|
115 */ |
|
116 virtual void sort( const IAlfSortFunction& aSortFunction ) = 0; |
|
117 |
|
118 /** |
|
119 * Destructor |
|
120 * |
|
121 * @since S60 ?S60_version |
|
122 */ |
|
123 virtual ~IAlfContainer(){} |
|
124 }; |
|
125 |
|
126 |
|
127 } // namespace Alf |
|
128 |
|
129 #endif // I_ALFCONTAINER_H |
|
130 |
|
131 // End of File |