|
1 /* |
|
2 * Copyright (c) 2002-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 #include "CPbk2FieldPropertyGroup.h" |
|
20 |
|
21 // System includes |
|
22 #include <barsread.h> |
|
23 |
|
24 // -------------------------------------------------------------------------- |
|
25 // CPbk2FieldPropertyGroup::CPbk2FieldPropertyGroup |
|
26 // -------------------------------------------------------------------------- |
|
27 // |
|
28 CPbk2FieldPropertyGroup::CPbk2FieldPropertyGroup() |
|
29 { |
|
30 } |
|
31 |
|
32 // -------------------------------------------------------------------------- |
|
33 // CPbk2FieldPropertyGroup::~CPbk2FieldPropertyGroup |
|
34 // -------------------------------------------------------------------------- |
|
35 // |
|
36 CPbk2FieldPropertyGroup::~CPbk2FieldPropertyGroup() |
|
37 { |
|
38 iProperties.Close(); |
|
39 delete iLabel; |
|
40 } |
|
41 |
|
42 // -------------------------------------------------------------------------- |
|
43 // CPbk2FieldPropertyGroup::ConstructL |
|
44 // -------------------------------------------------------------------------- |
|
45 // |
|
46 inline void CPbk2FieldPropertyGroup::ConstructL( TResourceReader& aReader ) |
|
47 { |
|
48 aReader.ReadInt8(); // read version number |
|
49 iGroupId = static_cast<TPbk2FieldGroupId>( aReader.ReadInt8() ); |
|
50 iLabel = aReader.ReadHBufC16L(); |
|
51 iIconId = TPbk2IconId( aReader ); |
|
52 iAddItemOrdering = aReader.ReadInt8(); |
|
53 } |
|
54 |
|
55 // -------------------------------------------------------------------------- |
|
56 // CPbk2FieldPropertyGroup::NewLC |
|
57 // -------------------------------------------------------------------------- |
|
58 // |
|
59 CPbk2FieldPropertyGroup* CPbk2FieldPropertyGroup::NewLC |
|
60 ( TResourceReader& aReader ) |
|
61 { |
|
62 CPbk2FieldPropertyGroup* self = new ( ELeave ) CPbk2FieldPropertyGroup; |
|
63 CleanupStack::PushL( self ); |
|
64 self->ConstructL( aReader ); |
|
65 return self; |
|
66 } |
|
67 |
|
68 // -------------------------------------------------------------------------- |
|
69 // CPbk2FieldPropertyGroup::Count |
|
70 // -------------------------------------------------------------------------- |
|
71 // |
|
72 EXPORT_C TInt CPbk2FieldPropertyGroup::Count() const |
|
73 { |
|
74 return iProperties.Count(); |
|
75 } |
|
76 |
|
77 // -------------------------------------------------------------------------- |
|
78 // CPbk2FieldPropertyGroup::At |
|
79 // -------------------------------------------------------------------------- |
|
80 // |
|
81 EXPORT_C const MPbk2FieldProperty& CPbk2FieldPropertyGroup::At |
|
82 ( TInt aIndex ) const |
|
83 { |
|
84 return *iProperties[aIndex]; |
|
85 } |
|
86 |
|
87 // -------------------------------------------------------------------------- |
|
88 // CPbk2FieldPropertyGroup::AddFieldPropertyL |
|
89 // -------------------------------------------------------------------------- |
|
90 // |
|
91 void CPbk2FieldPropertyGroup::AddFieldPropertyL |
|
92 ( const MPbk2FieldProperty& aProperty ) |
|
93 { |
|
94 iProperties.AppendL( &aProperty ); |
|
95 } |
|
96 |
|
97 // End of File |