|
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: Phonebook 2 field group properties. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2FIELDGROUPPROPERTYARRAY_H |
|
20 #define CPBK2FIELDGROUPPROPERTYARRAY_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class MPbk2FieldPropertyArray; |
|
25 class CPbk2FieldPropertyGroup; |
|
26 class MPbk2FieldProperty; |
|
27 class TResourceReader; |
|
28 |
|
29 /** |
|
30 * Phonebook 2 field group properties. |
|
31 */ |
|
32 class CPbk2FieldGroupPropertyArray : public CBase |
|
33 { |
|
34 public: // Construction and destruction |
|
35 |
|
36 /** |
|
37 * Creates a new instance of this class. |
|
38 * |
|
39 * @param aFieldProperties Field properties used for populating |
|
40 * the group. |
|
41 * @return A new instance of this class. |
|
42 */ |
|
43 IMPORT_C static CPbk2FieldGroupPropertyArray* NewL( |
|
44 const MPbk2FieldPropertyArray& aFieldProperties ); |
|
45 |
|
46 /** |
|
47 * Creates a new instance of this class. |
|
48 * |
|
49 * @param aFieldProperties Field properties used for populating |
|
50 * the group. |
|
51 * @return A new instance of this class. |
|
52 */ |
|
53 IMPORT_C static CPbk2FieldGroupPropertyArray* NewLC( |
|
54 const MPbk2FieldPropertyArray& aFieldProperties ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CPbk2FieldGroupPropertyArray(); |
|
60 |
|
61 public: // Interface |
|
62 |
|
63 /** |
|
64 * Returns the number of group properties in the array |
|
65 * |
|
66 * @return Number of group properties in the array. |
|
67 */ |
|
68 IMPORT_C TInt GroupCount() const; |
|
69 |
|
70 /** |
|
71 * Returns the field group property at given index. |
|
72 * |
|
73 * @param aIndex The index of the property. |
|
74 * @return Group property. |
|
75 */ |
|
76 IMPORT_C const CPbk2FieldPropertyGroup& GroupAt( |
|
77 TInt aIndex ) const; |
|
78 |
|
79 /** |
|
80 * Finds the group into which the given property belongs. |
|
81 * Returns NULL if the property does not belong to the group. |
|
82 * |
|
83 * @param aProperty The property to search for. |
|
84 * @return Group of the property or NULL. |
|
85 */ |
|
86 IMPORT_C const CPbk2FieldPropertyGroup* FindGroupForProperty( |
|
87 const MPbk2FieldProperty& aProperty ) const; |
|
88 |
|
89 private: // Implementation |
|
90 CPbk2FieldGroupPropertyArray(); |
|
91 void ConstructL( |
|
92 const MPbk2FieldPropertyArray& aFieldProperties ); |
|
93 void ReadFieldGroupsL( |
|
94 TResourceReader& aReader ); |
|
95 void PopulateGroupsL( |
|
96 const MPbk2FieldPropertyArray& aFieldProperties ); |
|
97 |
|
98 private: // Data |
|
99 /// Own: Field groups |
|
100 RPointerArray<CPbk2FieldPropertyGroup> iFieldGroups; |
|
101 }; |
|
102 |
|
103 #endif // CPBK2FIELDGROUPPROPERTYARRAY_H |
|
104 |
|
105 // End of File |