|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalAll |
|
21 */ |
|
22 |
|
23 #ifndef CPHONEBOOKENTRY_H_ |
|
24 #define CPHONEBOOKENTRY_H_ |
|
25 |
|
26 #include <e32def.h> |
|
27 #include <e32cmn.h> |
|
28 |
|
29 #include <mpbutil.h> |
|
30 |
|
31 class CPhoneBookEntry : public CBase |
|
32 { |
|
33 public: |
|
34 |
|
35 IMPORT_C static CPhoneBookEntry* NewL(); |
|
36 IMPORT_C static CPhoneBookEntry* NewLC(); |
|
37 |
|
38 IMPORT_C void Reset(); |
|
39 |
|
40 IMPORT_C TInt GetIndex() const; |
|
41 IMPORT_C const TDesC& GetFirstName() const; |
|
42 IMPORT_C const TDesC& GetDiallingNumber() const; |
|
43 IMPORT_C const RArray<RBuf>& GetEmailAddresss() const; |
|
44 IMPORT_C const RArray<RBuf>& GetSecondNames() const; |
|
45 IMPORT_C const RArray<RBuf>& GetAdditionalNumbers() const; |
|
46 |
|
47 IMPORT_C void SetIndex(TInt aIndex); |
|
48 IMPORT_C TInt SetFirstName(const TDesC& aFirstName); |
|
49 IMPORT_C TInt SetDiallingNumber(const TDesC& aDiallingNumber); |
|
50 |
|
51 IMPORT_C TInt AddEmailAddress(const TDesC& aEmailAddress); |
|
52 IMPORT_C TInt AddSecondName(const TDesC& aSecondName); |
|
53 IMPORT_C TInt AddAdditionalNumber(const TDesC& aAdditionalNumber); |
|
54 |
|
55 IMPORT_C TInt ExternalizeToTlvEntry(CPhoneBookBuffer& aPhoneBookBuffer) const; |
|
56 IMPORT_C TInt InternalizeFromTlvEntry(CPhoneBookBuffer& aPhoneBookBuffer, TBool aNewEntryTagRead = EFalse); |
|
57 |
|
58 IMPORT_C TInt TlvLength() const; |
|
59 |
|
60 IMPORT_C TBool operator== (const CPhoneBookEntry& aPhoneBookEntry) const; |
|
61 |
|
62 ~CPhoneBookEntry(); |
|
63 |
|
64 private: |
|
65 |
|
66 void ConstructL(); |
|
67 CPhoneBookEntry(); |
|
68 |
|
69 TInt GetText(TPtrC16& text, CPhoneBookBuffer::TPhBkTagType aTagType, CPhoneBookBuffer& aPhoneBookBuffer) const; |
|
70 void DesSize(TInt& aSize, const TDesC& aDes) const; |
|
71 |
|
72 |
|
73 private: |
|
74 |
|
75 TInt iIndex; |
|
76 TBool iIndexSet; |
|
77 RBuf iFirstName; |
|
78 RBuf iDiallingNumber; |
|
79 RArray<RBuf> iEmailAddresss; |
|
80 RArray<RBuf> iSecondNames; |
|
81 RArray<RBuf> iAdditionalNumbers; |
|
82 }; |
|
83 |
|
84 #endif /*CPHONEBOOKENTRY_H_*/ |