|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Field property array for Phonebook 2 field types. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2FIELDPROPERTYARRAY_H |
|
20 #define CPBK2FIELDPROPERTYARRAY_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2FieldPropertyArray.h> |
|
25 #include <MPbk2FieldPropertyArray2.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class TResourceReader; |
|
29 class MVPbkFieldTypeList; |
|
30 class CPbk2FieldProperty; |
|
31 class RFs; |
|
32 class CPbk2FieldOrderingManager; |
|
33 class CPbk2ServiceManager; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Field property array for Phonebook 2 field types. |
|
39 */ |
|
40 class CPbk2FieldPropertyArray : public CBase, |
|
41 public MPbk2FieldPropertyArray, |
|
42 public MPbk2FieldPropertyArray2 |
|
43 { |
|
44 public: // Construction and destruction |
|
45 |
|
46 /** |
|
47 * Creates a new instance of this class. |
|
48 * |
|
49 * @param aSupportedFieldTypeList A list of field types. |
|
50 * If this is the master fieldtype |
|
51 * list then all the properties |
|
52 * are loaded, otherwise only those |
|
53 * properties that have the field |
|
54 * type in the list are loaded. |
|
55 * @param aRFs File system session for reading |
|
56 * a resource file. |
|
57 * @return A new instance of this class. |
|
58 */ |
|
59 IMPORT_C static CPbk2FieldPropertyArray* NewL( |
|
60 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
61 RFs& aRFs ); |
|
62 |
|
63 /** |
|
64 * Creates a new instance of this class. |
|
65 * |
|
66 * @param aSupportedFieldTypeList A list of field types. |
|
67 * If this is the master fieldtype |
|
68 * list then all the properties |
|
69 * are loaded, otherwise only those |
|
70 * properties that have the field |
|
71 * type in the list are loaded. |
|
72 * @param aRFs File system session for reading |
|
73 * a resource file. |
|
74 * @param aServMan Service manager. |
|
75 * @return A new instance of this class. |
|
76 */ |
|
77 IMPORT_C static CPbk2FieldPropertyArray* NewL( |
|
78 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
79 RFs& aRFs, CPbk2ServiceManager* aServMan ); |
|
80 |
|
81 /** |
|
82 * Creates a new instance of this class. |
|
83 * |
|
84 * @param aSupportedFieldTypeList A list of field types. |
|
85 * If this is the master fieldtype |
|
86 * list then all the properties |
|
87 * are loaded, otherwise only those |
|
88 * properties that have the field |
|
89 * type in the list are loaded. |
|
90 * @param aReader Resource reader pointed to |
|
91 * PHONEBOOK2_FIELD_PROPERTY_ARRAY |
|
92 * resource. |
|
93 * @param aRFs File system session for reading |
|
94 * a resource file. |
|
95 * @return A new instance of this class. |
|
96 */ |
|
97 IMPORT_C static CPbk2FieldPropertyArray* NewL( |
|
98 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
99 TResourceReader& aReader, |
|
100 RFs& aRFs ); |
|
101 |
|
102 /** |
|
103 * Destructor. |
|
104 */ |
|
105 ~CPbk2FieldPropertyArray(); |
|
106 |
|
107 public: // From MPbk2FieldPropertyArray |
|
108 const MPbk2FieldProperty* FindProperty( |
|
109 const MVPbkFieldType& aFieldType ) const; |
|
110 TInt Count() const; |
|
111 const MPbk2FieldProperty& At( |
|
112 TInt aIndex ) const; |
|
113 TAny* FieldPropertyArrayExtension( TUid aExtensionUid ); |
|
114 |
|
115 public: // From MPbk2FieldPropertyArray2 |
|
116 const MPbk2FieldProperty* FindProperty( |
|
117 const MVPbkFieldType& aFieldType, const TDesC& aName ) const; |
|
118 |
|
119 |
|
120 private: // Implementation |
|
121 CPbk2FieldPropertyArray(); |
|
122 void ConstructL( |
|
123 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
124 RFs& aRFs, CPbk2ServiceManager* aServMan ); |
|
125 void ReadFieldPropertiesL( |
|
126 TResourceReader& aReader, |
|
127 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
128 CPbk2FieldOrderingManager& aOrderingManager); |
|
129 CPbk2FieldOrderingManager* CreateFieldOrderingsLC( RFs& aRFs ); |
|
130 void MultiplyImppFieldPropertyL(CPbk2ServiceManager* aServMan, RFs& aRFs ); |
|
131 |
|
132 private: // Data |
|
133 /// Own: Field properties |
|
134 RPointerArray<CPbk2FieldProperty> iFieldProperties; |
|
135 }; |
|
136 |
|
137 #endif // CPBK2FIELDPROPERTYARRAY_H |
|
138 |
|
139 // End of File |