|
1 // Copyright (c) 2006-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 // pbapvcardexporterimpl.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef PBAPVCARDEXPORTERUTIL_H |
|
19 #define PBAPVCARDEXPORTERUTIL_H |
|
20 |
|
21 #include <cntdb.h> |
|
22 #include "pbaprequest.h" |
|
23 #include <logwrap.h> |
|
24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
25 #include "cntconvertercallback.h" |
|
26 #endif |
|
27 #include <tz.h> |
|
28 |
|
29 class RWriteStream; |
|
30 class CPbapLogWrapper; |
|
31 class CParserVCard; |
|
32 |
|
33 class CPbapVCardExporterUtil : public CBase, public MConverterCallBack |
|
34 /** |
|
35 Converts contact and call history items to vCard 2.1 or vCard 3.0 objects |
|
36 @internalComponent |
|
37 @released |
|
38 */ |
|
39 { |
|
40 public: |
|
41 /** |
|
42 */ |
|
43 static CPbapVCardExporterUtil* NewL(CContactDatabase& aDatabase, CPbapLogWrapper* aLogWrapper); |
|
44 ~CPbapVCardExporterUtil(); |
|
45 /** |
|
46 */ |
|
47 void ExportContactL(TContactItemId aContactId, RWriteStream& aWriteStream, |
|
48 TVCardVersion aFormat, TUint64 aFilter); |
|
49 /** |
|
50 */ |
|
51 void ExportCallHistoryL(const CLogEvent& aEvent, RWriteStream& aWriteStream, |
|
52 TVCardVersion aFormat, TUint64 aFilter); |
|
53 void ExportEmptyVCardL(RWriteStream& aWriteStream, TVCardVersion aFormat); |
|
54 |
|
55 public: |
|
56 /** |
|
57 PBAP clients are supposed to provide any information regarding the contact item represented by aContactId. |
|
58 This information should be in form of standard vCard property, all such properties should be appended to the array aPropertyList. |
|
59 */ |
|
60 void AddIntraContactPropertiesL(const TContactItemId& aContactId, CArrayPtr<CParserProperty>* aPropertyList); |
|
61 |
|
62 private: |
|
63 CPbapVCardExporterUtil(CContactDatabase& aDatabase, CPbapLogWrapper* aLogWrapper); |
|
64 void ConstructL(); |
|
65 |
|
66 TBool ContactExistsL(TContactItemId aContactId); |
|
67 CParserVCard* CreateVCardParserLC(TVCardVersion aFormat); |
|
68 CParserProperty* EmptyNamePropertyL(); |
|
69 CParserProperty* CallDateTimePropertyL(const CLogEvent& aLogEvent, TVCardVersion aFormat); |
|
70 CParserProperty* DesPropertyL(const TDesC8& aToken, const TDesC& aDes); |
|
71 TPtrC8 ParameterValueFromEventL(const CLogEvent& aLogEvent); |
|
72 |
|
73 private: |
|
74 CContactDatabase& iDatabase; |
|
75 CPbapLogWrapper* iLogWrapper; |
|
76 const CLogEvent* iLogEvent; |
|
77 TVCardVersion iFormat; |
|
78 TUint64 iFilter; |
|
79 RTz iTzClient; |
|
80 }; |
|
81 |
|
82 #endif // PBAPVCARDEXPORTERUTIL_H |