|
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: Sort order field mapper. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TFSCSORTORDERFIELDMAPPER_H |
|
20 #define TFSCSORTORDERFIELDMAPPER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MVPbkFieldTypeList; |
|
27 class MVPbkBaseContactFieldCollection; |
|
28 class MVPbkBaseContactField; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Sort order field mapper. |
|
34 * Maps fields in a contact to the same order than in the sort order. |
|
35 */ |
|
36 class TFscSortOrderFieldMapper |
|
37 { |
|
38 public: |
|
39 // Construction |
|
40 |
|
41 /** |
|
42 * Constructor. |
|
43 */ |
|
44 TFscSortOrderFieldMapper(); |
|
45 |
|
46 public: |
|
47 // Interface |
|
48 |
|
49 /** |
|
50 * Sets the current sort order that the fields are mapped against. |
|
51 * |
|
52 * @param aSortOrder New sort order. |
|
53 */ |
|
54 void SetSortOrder(const MVPbkFieldTypeList& aSortOrder); |
|
55 |
|
56 /** |
|
57 * Sets the contact fields that are mapped. |
|
58 * |
|
59 * @param aContactFields Fields to be mapped to sort order. |
|
60 */ |
|
61 void SetContactFields( |
|
62 const MVPbkBaseContactFieldCollection& aContactFields); |
|
63 |
|
64 /** |
|
65 * Returns the number of mapped fields. |
|
66 * |
|
67 * @return Number of mapped fields. |
|
68 */ |
|
69 TInt FieldCount() const; |
|
70 |
|
71 /** |
|
72 * Returns a field in a contact that is of the same type than |
|
73 * the field at given index in the sort order. |
|
74 * |
|
75 * @param aIndex Index of the field type in the sort order. |
|
76 * @return Field that is of the same type than the field type |
|
77 * at given index in the sort order. |
|
78 */ |
|
79 const MVPbkBaseContactField* FieldAt( |
|
80 TInt aIndex ) const; |
|
81 |
|
82 private: // Data |
|
83 /// Ref: Current sort order |
|
84 const MVPbkFieldTypeList* iSortOrder; |
|
85 /// Ref: Fields that are mapped to sort order |
|
86 const MVPbkBaseContactFieldCollection* iContactFields; |
|
87 }; |
|
88 |
|
89 #endif // TFSCSORTORDERFIELDMAPPER_H |
|
90 // End of File |