|
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: Adapter manager interface, describes adapter properties. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MPIMADAPTERMANAGER_H |
|
20 #define MPIMADAPTERMANAGER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 #include <e32std.h> |
|
25 #include <bamdesca.h> |
|
26 #include "pimcommon.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MPIMItemData; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Defines the operations common to all adapter managers and provides |
|
35 * the characteristics of a single list. |
|
36 * |
|
37 * List characteristics include |
|
38 * list name, supported fields and attributes and limits of the |
|
39 * list. The underlying native database cannot be changed through |
|
40 * MPIMAdapterManager class. |
|
41 */ |
|
42 class MPIMAdapterManager |
|
43 { |
|
44 public: |
|
45 // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~MPIMAdapterManager() |
|
51 { |
|
52 } |
|
53 |
|
54 public: |
|
55 // New functions |
|
56 |
|
57 /** |
|
58 * Provides the name of this list. |
|
59 */ |
|
60 virtual const TDesC& ListNameL() = 0; |
|
61 |
|
62 /** |
|
63 * Provides number of maximum categories supported by the list adapter. |
|
64 * @return Number of maximum supported categories. 0 if not supported, |
|
65 * -1 if unlimited. |
|
66 */ |
|
67 virtual TInt MaxCategories() = 0; |
|
68 |
|
69 /** |
|
70 * Checks whether a specific field is supported by the list adapter. |
|
71 * @param aField The field to be checked. |
|
72 * @return ETrue if the given field is supported, EFalse otherwise. |
|
73 */ |
|
74 virtual TBool IsSupportedField(TPIMField aField) = 0; |
|
75 |
|
76 /** |
|
77 * Provides all fields supported by the list adapter. |
|
78 * |
|
79 * @return An array containing all supported fields. The order of the |
|
80 * fields must be the same as in the native side application |
|
81 * UI. |
|
82 * |
|
83 * @par Leaving: |
|
84 * The method leaves on error. Such error always means that the adapter |
|
85 * is non-functional. |
|
86 */ |
|
87 virtual const CArrayFix<TPIMField>& GetSupportedFieldsL() = 0; |
|
88 |
|
89 /** |
|
90 * Checks whether a specific attribute is supported by the list adapter. |
|
91 * |
|
92 * @param aField The field to which the attribute might be associated. |
|
93 * @param aAttribute The attribute to be checked. |
|
94 * |
|
95 * @return ETrue if the given attribute is supported, EFalse otherwise, |
|
96 * also on unsupported \a aField. |
|
97 */ |
|
98 virtual TBool IsSupportedAttribute(TPIMField aField, |
|
99 TPIMAttribute aAttribute) = 0; |
|
100 |
|
101 /** |
|
102 * Provides attributes supported for a field. |
|
103 * |
|
104 * @param aField The field to which the attributes are associated with. |
|
105 * |
|
106 * @return An array containing attributes supported for the \a aField. |
|
107 * The order of attributes must reflect the order of field and |
|
108 * attribute combinations in the native application UI. |
|
109 * |
|
110 * @par Leaving: |
|
111 * The method leaves on error. Error codes should be interpreted as |
|
112 * follows: |
|
113 * @li \c KErrArgument - \a aField is not valid. |
|
114 * @li Other - Array could not be created. |
|
115 */ |
|
116 virtual const CArrayFix<TPIMAttribute>& GetSupportedAttributesL( |
|
117 TPIMField aField) = 0; |
|
118 |
|
119 /** |
|
120 * Provides attributes supported for a field, combined into single |
|
121 * integer value. |
|
122 * |
|
123 * @param aField The field to which the attributes are associated with. |
|
124 * |
|
125 * @return An integer holding the combination of all attributes |
|
126 * supported for \a aField. |
|
127 * |
|
128 * @par Leaving. |
|
129 * The method leaves on error. Error codes should be interpreted as |
|
130 * follows: |
|
131 * @li \c KErrArgument - \a aField is not valid. |
|
132 */ |
|
133 virtual TPIMAttribute |
|
134 GetSupportedAttributesCombinedL(TPIMField aField) = 0; |
|
135 |
|
136 /** |
|
137 * Provides all attributes supported for all fields, combined into |
|
138 * single integer value. |
|
139 * |
|
140 * @return An integer holding the combination of all attributes |
|
141 * supported for all fields. |
|
142 */ |
|
143 virtual TPIMAttribute GetAllSupportedAttributesCombined() = 0; |
|
144 |
|
145 /** |
|
146 * Checks whether a specific array element is supported by the |
|
147 * list adapter. |
|
148 * |
|
149 * @param aStringArrayField The field to which the array |
|
150 * element belongs to. |
|
151 * @param aArrayElement The array element to be checked. |
|
152 * |
|
153 * @return ETrue if the given array element is supported, |
|
154 * EFalse otherwise. |
|
155 */ |
|
156 virtual TBool IsSupportedArrayElement(TPIMField aStringArrayField, |
|
157 TPIMArrayElement aArrayElement) = 0; |
|
158 |
|
159 /** |
|
160 * Provides supported array elements for a specific field. |
|
161 * |
|
162 * @param aStringArrayField A string array field. |
|
163 * |
|
164 * @return An array containing supported array elements for the field. |
|
165 * |
|
166 * @par Leaving: |
|
167 * The method leaves on error. Error codes should be interpreted as |
|
168 * follows: |
|
169 * @li \c KErrArgument - \a aField is not valid. |
|
170 * @li Other - Array could not be created. |
|
171 */ |
|
172 virtual const CArrayFix<TPIMArrayElement>& GetSupportedArrayElementsL( |
|
173 TPIMField aStringArrayField) = 0; |
|
174 |
|
175 /** |
|
176 * Provides the number of maximum values supported for a specific field. |
|
177 * |
|
178 * @param aField The field to be evaluated. |
|
179 * |
|
180 * @return Number of values supported for the field. -1 for unlimited, |
|
181 * 0 if not supported. |
|
182 */ |
|
183 virtual TInt MaxValues(TPIMField aField) = 0; |
|
184 |
|
185 /** |
|
186 * Provides the array size of a specific string array field. |
|
187 * The values in a string array field are arrays themselves. |
|
188 * StringArraySize method returns the number of elements in every value |
|
189 * of the field. |
|
190 * |
|
191 * @param aStringArrayField The string array field to be evaluated. |
|
192 * @return Number of elements in a single string array value. |
|
193 * |
|
194 * @par Leaving: |
|
195 * The method leaves with \c KErrArgument if \a aStringArrayField |
|
196 * is not a string array field or is not supported. |
|
197 */ |
|
198 virtual TInt StringArraySizeL(TPIMField aStringArrayField) = 0; |
|
199 |
|
200 /** |
|
201 * Provides pointer to a function which implements an algorithm that |
|
202 * determines the order of two items. |
|
203 * |
|
204 * @return Item comparison function. |
|
205 */ |
|
206 virtual TPIMItemComparisonFunc ItemOrder() = 0; |
|
207 |
|
208 protected: |
|
209 // Non-public operations |
|
210 |
|
211 // Allow derivation with protected default constructor. |
|
212 MPIMAdapterManager() |
|
213 { |
|
214 } |
|
215 |
|
216 private: |
|
217 // Prohibited operations |
|
218 |
|
219 // Prohibit copy constructor. |
|
220 MPIMAdapterManager(const MPIMAdapterManager&) |
|
221 { |
|
222 } |
|
223 |
|
224 // Prohibit assigment operator. |
|
225 MPIMAdapterManager& operator=(const MPIMAdapterManager&) |
|
226 { |
|
227 return *this; |
|
228 } |
|
229 |
|
230 }; |
|
231 |
|
232 #endif // MPIMADAPTERMANAGER_H |
|
233 // End of File |