summaryrefslogtreecommitdiffstats
path: root/plugins/contacts/symbian/contactsmodel/tsrc/unittest_cntpbapsupport/inc/t_cntpbapsupport.h
blob: 80fabf77828fa28366996a4fe77c12404059004e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/

		
#ifndef __T_CNTPBAPSUPPORT_H__
#define __T_CNTPBAPSUPPORT_H__
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
#include "cntconvertercallback.h"
#endif


//
// Class CCntPBAPSupport Definition
//

class CCntPBAPSupport : public CBase, public MConverterCallBack
	{
public:
	static CCntPBAPSupport* NewL();
	~CCntPBAPSupport();	
	//Test Functions
	void TestExportOfAllSupportedFieldsL();
	void TestMandatoryAndTELPropertiesL();
	void TestIntraContactPropertiesL();
	void TestFilterL();
	void TestTypePrefixingL();
	void TestVCard21SupportL();
	void SetIntraExport(TBool aState);
private:
	CCntPBAPSupport();
	void ConstructL();
	//Support Functions
	void ExportContactsL(TInt64 aFilter, TVCardVersion aVer, TBool aExportTel);
	void ImportContactsL(const TDesC8& aFileName);
	void AddIntraContactPropertiesL(const TContactItemId& aContactId, CArrayPtr<CParserProperty>* aPropertyList);
	void CompareFilesL(RReadStream& aCompareStream);
	TBool CompareLines(const TDesC8& aLine1, const TDesC8& aLine2);
	
	void CompareExportsL(const TDesC8& aExpected);
	// Utils
	void ReportFileErrorL(TInt aErr, const TDesC& aFileName);
private:
	RFs iFsSession;
	CContactDatabase* iDb;
	CContactIdArray* iIdArray;
	TBool iSessionConnected;
	TBool iAddIntraProperties;
	};

/**
Eumeration containing all the supported vCard properties required for PBAP export,
used to interpret bit-filter provided by PBAP clients.
@internalComponent
*/	
enum TestTPBAPProperties
	{
	EPropertyVER	       = 0x01,      
	EPropertyFN			   = 0x02,      
	EPropertyN			   = 0x04,      
	EPropertyPHOTO		   = 0x08,      
	EPropertyBDAY		   = 0x10,      
	EPropertyADR		   = 0x20,      
	EPropertyLABEL		   = 0x40,      
	EPropertyTEL		   = 0x80,      
	EPropertyEMAIL		   = 0x100,     
	EPropertyMAILER		   = 0x200,     
	EPropertyTZ			   = 0x400,     
	EPropertyGEO		   = 0x800,     
	EPropertyTITLE		   = 0x1000,    
	EPropertyROLE		   = 0x2000,    
	EPropertyLOGO		   = 0x4000,    
	EPropertyAGENT		   = 0x8000,    
	EPropertyORG		   = 0x10000,   
	EPropertyNOTE		   = 0x20000,   
	EPropertyREV		   = 0x40000,   
	EPropertySOUND		   = 0x80000,   
	EPropertyURL		   = 0x100000,  
	EPropertyUID		   = 0x200000,  
	EPropertyKEY		   = 0x400000,  
	EPropertyNICKNAME	   = 0x800000,  
	EPropertyCATEGORIES	   = 0x1000000, 
	EPropertyPRODID		   = 0x2000000, 
	EPropertyCLASS		   = 0x4000000, 
	EPropertySORTSTRING    = 0x8000000, 
	};

#endif