|
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: The virtual phonebook store field data implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include "TContactFieldData.h" |
|
21 |
|
22 #include <CVPbkSimCntField.h> |
|
23 |
|
24 namespace VPbkSimStore { |
|
25 |
|
26 TContactFieldData::TContactFieldData() |
|
27 : iSimField( NULL ) |
|
28 { |
|
29 // Constructor implemented to force class vftable generation to this module |
|
30 } |
|
31 |
|
32 TContactFieldData::~TContactFieldData() |
|
33 { |
|
34 // Destructor implemented to force class vftable generation to this module |
|
35 } |
|
36 |
|
37 void TContactFieldData::SetField( CVPbkSimCntField& aSimField ) |
|
38 { |
|
39 iSimField = &aSimField; |
|
40 } |
|
41 |
|
42 TBool TContactFieldData::IsEmpty() const |
|
43 { |
|
44 return iSimField->Data().Length() == 0; |
|
45 } |
|
46 |
|
47 TPtrC TContactFieldData::Text() const |
|
48 { |
|
49 return iSimField->Data(); |
|
50 } |
|
51 |
|
52 void TContactFieldData::SetTextL( const TDesC& aText ) |
|
53 { |
|
54 iSimField->SetDataL( aText ); |
|
55 } |
|
56 |
|
57 void TContactFieldData::CopyL( const MVPbkContactFieldData& aFieldData ) |
|
58 { |
|
59 if ( aFieldData.DataType() == DataType() ) |
|
60 { |
|
61 SetTextL( MVPbkContactFieldTextData::Cast( aFieldData ).Text() ); |
|
62 } |
|
63 } |
|
64 |
|
65 TInt TContactFieldData::MaxLength() const |
|
66 { |
|
67 return iSimField->MaxDataLength(); |
|
68 } |
|
69 } // namespace VPbkSimStore |
|
70 |