|
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 property group. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2FIELDPROPERTYGROUP_H |
|
20 #define CPBK2FIELDPROPERTYGROUP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <TPbk2IconId.h> |
|
25 #include <Pbk2FieldProperty.hrh> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class TResourceReader; |
|
29 class MPbk2FieldProperty; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Phonebook 2 field property group. |
|
35 * Field property group for Phonebook 2 field types. |
|
36 */ |
|
37 class CPbk2FieldPropertyGroup : public CBase |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Creates a new instance of this class. |
|
43 * |
|
44 * @param aReader Resource reader pointed to a |
|
45 * PHONEBOOK2_FIELD_GROUP resource. |
|
46 * @return A new instance of this class. |
|
47 */ |
|
48 static CPbk2FieldPropertyGroup* NewLC( |
|
49 TResourceReader& aReader ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CPbk2FieldPropertyGroup(); |
|
55 |
|
56 public: // Interface |
|
57 |
|
58 /** |
|
59 * Returns the number of field properties in the group. |
|
60 * |
|
61 * @return Number of field properties in the group. |
|
62 */ |
|
63 IMPORT_C TInt Count() const; |
|
64 |
|
65 /** |
|
66 * Returns the field property at given index. |
|
67 * |
|
68 * @param aIndex The index of the property. |
|
69 * @return Field property in given index. |
|
70 */ |
|
71 IMPORT_C const MPbk2FieldProperty& At( |
|
72 TInt aIndex ) const; |
|
73 |
|
74 /** |
|
75 * Returns the id of this group. |
|
76 * |
|
77 * @return Id of the group. |
|
78 */ |
|
79 inline TPbk2FieldGroupId GroupId() const; |
|
80 |
|
81 /** |
|
82 * Returns the label of this group. |
|
83 * |
|
84 * @return The label of this group. |
|
85 */ |
|
86 inline const TDesC& Label() const; |
|
87 |
|
88 /** |
|
89 * Returns the icon id of this group. |
|
90 * |
|
91 * @return Icon id of this group. |
|
92 */ |
|
93 inline const TPbk2IconId& IconId() const; |
|
94 |
|
95 /** |
|
96 * Returns the add item ordering of this group. |
|
97 * |
|
98 * @return Add item ordering of this group. |
|
99 */ |
|
100 inline TInt AddItemOrdering() const; |
|
101 |
|
102 /** |
|
103 * A private API function to add properties to the group. |
|
104 * |
|
105 * @param aProperty A new property to add. |
|
106 */ |
|
107 void AddFieldPropertyL( |
|
108 const MPbk2FieldProperty& aProperty ); |
|
109 |
|
110 private: // Implementation |
|
111 CPbk2FieldPropertyGroup(); |
|
112 void ConstructL( |
|
113 TResourceReader& aReader ); |
|
114 |
|
115 private: // Data |
|
116 /// Own: The id of the group |
|
117 TPbk2FieldGroupId iGroupId; |
|
118 /// Own: Label of this group |
|
119 HBufC* iLabel; |
|
120 /// Own: Icon Id of this group |
|
121 TPbk2IconId iIconId; |
|
122 /// Own: Add item ordering of this group |
|
123 TInt iAddItemOrdering; |
|
124 /// Own: Does not own the instances |
|
125 RPointerArray<const MPbk2FieldProperty> iProperties; |
|
126 }; |
|
127 |
|
128 |
|
129 // INLINE IMPLEMENTATION |
|
130 |
|
131 // -------------------------------------------------------------------------- |
|
132 // CPbk2FieldPropertyGroup::GroupId |
|
133 // -------------------------------------------------------------------------- |
|
134 // |
|
135 inline TPbk2FieldGroupId CPbk2FieldPropertyGroup::GroupId() const |
|
136 { |
|
137 return iGroupId; |
|
138 } |
|
139 |
|
140 // -------------------------------------------------------------------------- |
|
141 // CPbk2FieldPropertyGroup::Label |
|
142 // -------------------------------------------------------------------------- |
|
143 // |
|
144 inline const TDesC& CPbk2FieldPropertyGroup::Label() const |
|
145 { |
|
146 return *iLabel; |
|
147 } |
|
148 |
|
149 // -------------------------------------------------------------------------- |
|
150 // CPbk2FieldPropertyGroup::IconId |
|
151 // -------------------------------------------------------------------------- |
|
152 // |
|
153 inline const TPbk2IconId& CPbk2FieldPropertyGroup::IconId() const |
|
154 { |
|
155 return iIconId; |
|
156 } |
|
157 |
|
158 // -------------------------------------------------------------------------- |
|
159 // CPbk2FieldPropertyGroup::AddItemOrdering |
|
160 // -------------------------------------------------------------------------- |
|
161 // |
|
162 inline TInt CPbk2FieldPropertyGroup::AddItemOrdering() const |
|
163 { |
|
164 return iAddItemOrdering; |
|
165 } |
|
166 |
|
167 |
|
168 #endif // CPBK2FIELDPROPERTYGROUP_H |
|
169 |
|
170 // End of File |