|
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 // |
|
15 |
|
16 #ifndef __PBAPCONVERTER_H__ |
|
17 #define __PBAPCONVERTER_H__ |
|
18 |
|
19 // System includes |
|
20 #include <cntvcard.h> |
|
21 |
|
22 /** |
|
23 Contact Converter class, provides functionality for exporting contacts as PBAP compliant vCard2.1 or vCard3.0. |
|
24 @internalComponent |
|
25 */ |
|
26 class CPBAPContactVCardConverter: public CContactEcomConverter |
|
27 { |
|
28 public: // from CContactConverter |
|
29 CPBAPContactVCardConverter(TInt64 aFilter, MConverterCallBack* aCallback, TVCardVersion aVersion, TBool aExportTel); |
|
30 static CPBAPContactVCardConverter* NewL(TAny* aPluginParam); |
|
31 CArrayPtr<CContactItem>* ImportL(CContactDatabase& aDb, RReadStream& aReadStream, TBool& aImportSuccessful, TInt aOptions, TBool aImportSingle); |
|
32 void ExportL(CContactDatabase& aDb, const CContactIdArray& aSelectedContactIds, RWriteStream& aWriteStream, TInt aOptions, const Versit::TVersitCharSet aCharSet, TBool aExportPrivateFields, TInt aCommitNumber); |
|
33 public: |
|
34 TInt64 GetFilter()const; |
|
35 MConverterCallBack* GetCallback()const; |
|
36 TVCardVersion GetVersion()const; |
|
37 TBool IsExportTel()const; |
|
38 private: |
|
39 TInt64 PrepareFilterAndOption(TInt& aOption); |
|
40 private: |
|
41 TInt64 iFilter; |
|
42 MConverterCallBack* iCallback; |
|
43 TVCardVersion iVersion; |
|
44 TBool iExportTel; |
|
45 }; |
|
46 |
|
47 /** |
|
48 Eumeration containing all the supported vCard properties required for PBAP export, |
|
49 used to interpret bit-filter provided by PBAP clients. |
|
50 @internalComponent |
|
51 */ |
|
52 enum TPBAPProperties |
|
53 { |
|
54 EPropertyVER = 0x01, |
|
55 EPropertyFN = 0x02, |
|
56 EPropertyN = 0x04, |
|
57 EPropertyPHOTO = 0x08, |
|
58 EPropertyBDAY = 0x10, |
|
59 EPropertyADR = 0x20, |
|
60 EPropertyLABEL = 0x40, |
|
61 EPropertyTEL = 0x80, |
|
62 EPropertyEMAIL = 0x100, |
|
63 EPropertyMAILER = 0x200, |
|
64 EPropertyTZ = 0x400, |
|
65 EPropertyGEO = 0x800, |
|
66 EPropertyTITLE = 0x1000, |
|
67 EPropertyROLE = 0x2000, |
|
68 EPropertyLOGO = 0x4000, |
|
69 EPropertyAGENT = 0x8000, |
|
70 EPropertyORG = 0x10000, |
|
71 EPropertyNOTE = 0x20000, |
|
72 EPropertyREV = 0x40000, |
|
73 EPropertySOUND = 0x80000, |
|
74 EPropertyURL = 0x100000, |
|
75 EPropertyUID = 0x200000, |
|
76 EPropertyKEY = 0x400000, |
|
77 EPropertyNICKNAME = 0x800000, |
|
78 EPropertyCATEGORIES = 0x1000000, |
|
79 EPropertyPRODID = 0x2000000, |
|
80 EPropertyCLASS = 0x4000000, |
|
81 EPropertySORTSTRING = 0x8000000, |
|
82 EAllProperties = 0xFFFFFFF, |
|
83 }; |
|
84 |
|
85 #endif |