|
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: Manages dynamic properties of the contact |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "CPbk2ContactFieldDynamicProperties.h" |
|
20 |
|
21 // From VirtualPhonebook |
|
22 #include <MVPbkBaseContactField.h> |
|
23 #include <MVPbkFieldType.h> |
|
24 |
|
25 |
|
26 CPbk2ContactFieldDynamicProperties* CPbk2ContactFieldDynamicProperties::NewLC() |
|
27 { |
|
28 CPbk2ContactFieldDynamicProperties* self = |
|
29 new (ELeave) CPbk2ContactFieldDynamicProperties(); |
|
30 CleanupStack::PushL( self ); |
|
31 self->ConstructL(); |
|
32 return self; |
|
33 } |
|
34 |
|
35 CPbk2ContactFieldDynamicProperties::CPbk2ContactFieldDynamicProperties() |
|
36 { |
|
37 // Do nothing |
|
38 } |
|
39 |
|
40 CPbk2ContactFieldDynamicProperties::~CPbk2ContactFieldDynamicProperties() |
|
41 { |
|
42 iHiddenFieldResourceIds.Close(); |
|
43 } |
|
44 |
|
45 void CPbk2ContactFieldDynamicProperties::ConstructL() |
|
46 { |
|
47 // Do nothing |
|
48 } |
|
49 |
|
50 TInt CPbk2ContactFieldDynamicProperties::AddHiddenFieldResourceId( TInt aFieldResId ) |
|
51 { |
|
52 TInt result( KErrNone ); |
|
53 TInt found( iHiddenFieldResourceIds.Find( aFieldResId ) ); |
|
54 if ( found == KErrNotFound ) |
|
55 { |
|
56 result = iHiddenFieldResourceIds.Append( aFieldResId ); |
|
57 } |
|
58 |
|
59 return result; |
|
60 } |
|
61 |
|
62 TBool CPbk2ContactFieldDynamicProperties::IsHiddenField |
|
63 ( const MVPbkBaseContactField& aField ) const |
|
64 { |
|
65 if ( iHiddenFieldResourceIds.Find( |
|
66 aField.BestMatchingFieldType()->FieldTypeResId() ) != KErrNotFound ) |
|
67 { |
|
68 return ETrue; |
|
69 } |
|
70 return EFalse; |
|
71 } |
|
72 |
|
73 // End of file |