epoc32/include/cntvcard.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- a/epoc32/include/cntvcard.h	Tue Mar 16 16:12:26 2010 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,131 +0,0 @@
     1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 -// All rights reserved.
     1.6 -// This component and the accompanying materials are made available
     1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 -//
    1.11 -// Initial Contributors:
    1.12 -// Nokia Corporation - initial contribution.
    1.13 -//
    1.14 -// Contributors:
    1.15 -//
    1.16 -// Description:
    1.17 -//
    1.18 -
    1.19 -#ifndef __CNTVCARD_H__
    1.20 -#define __CNTVCARD_H__
    1.21 -
    1.22 -// System includes
    1.23 -#include <cntdb.h>
    1.24 -#include <vcard.h>
    1.25 -
    1.26 -// Classes referenced
    1.27 -class CVCardAddress;
    1.28 -class CVCardItemAndLabel;
    1.29 -class CVCardToContactsAppConverter;
    1.30 -
    1.31 -// Enumerations
    1.32 -/**
    1.33 -@internalComponent
    1.34 -@released
    1.35 -*/
    1.36 -enum TCntVCardImportType
    1.37 -	{
    1.38 -	ECntVCardImportTypeFirstSync,
    1.39 -	ECntVCardImportTypeMerge
    1.40 -	};
    1.41 -		
    1.42 -class CContactVCardConverter : public CContactEcomConverter
    1.43 -/**
    1.44 -Plug-in vCard to CContactItem converter.
    1.45 -@publishedAll
    1.46 -@released
    1.47 -*/
    1.48 -	{
    1.49 -public:
    1.50 -	// Ideally each converter should be able to define its own flags relevant 
    1.51 -	// to its own mode of operation. Due to the legacy design (defining flags 
    1.52 -	// in CContactDatabase) they have to be redeclared here. Long term we hope 
    1.53 -	// to deprecate the CContactDatabase flags and rely on those declared in 
    1.54 -	// the converter implementation.
    1.55 -	/** Import and export format flags. Contacts can be imported into
    1.56 -	or exported from the contact database as vCards.
    1.57 -
    1.58 -	The following options are available during import and export.
    1.59 -               
    1.60 -	@publishedAll
    1.61 -	@released
    1.62 -	*/
    1.63 -	enum TOptions 
    1.64 -	   	{
    1.65 -  		EDefault = CContactDatabase::EDefault,
    1.66 -        /** Handle Symbian's extended vCard format options. */
    1.67 -		EIncludeX = CContactDatabase::EIncludeX,
    1.68 -		/** Support non-standard extensions requried by Symbian PC connectivity software
    1.69 -		and Microsoft, amongst others. */
    1.70 -  		ETTFormat = CContactDatabase::ETTFormat ,
    1.71 -		/** Don't export the contact ID (for exporting only). */
    1.72 -		EExcludeUid = CContactDatabase::EExcludeUid,
    1.73 -		/** Decrease the contact's access count when importing and exporting. */
    1.74 -		EDecreaseAccessCount = CContactDatabase::EDecreaseAccessCount,
    1.75 -		/** Only import the first contact in the read stream (for importing only). */
    1.76 -		EImportSingleContact = CContactDatabase::EImportSingleContact,
    1.77 -		/** Increase the contact's access count when importing and exporting. */
    1.78 -		EIncreaseAccessCount = CContactDatabase::EIncreaseAccessCount,
    1.79 -		/** Sets a contact item to the local time when importing. */
    1.80 -		ELocalTime = CContactDatabase::ELocalTime,
    1.81 -		/** Allows to set a template to a contact item that does not exist. */
    1.82 -		ENullTemplateId = CContactDatabase::ENullTemplateId,
    1.83 -		/** Allows to set white spaces as value for an empty field.  */
    1.84 -		EConnectWhitespace=0x0100,		// Used to correctly manage the TimeIS protocol for syncing.
    1.85 -		/**
    1.86 -		During import ignore the UID property value of the vCard.  By ignoring
    1.87 -		the UID the client is indicating that it knows that the contact does not
    1.88 -		already exist in the database (i.e. the contact is being added rather
    1.89 -		than being updated).  Within the CContactVCardConverter::ImportL()
    1.90 -		method no attempt to search for the UID in the database will be made.
    1.91 -		For a series of addition of vCards with UIDs use of this option will
    1.92 -		give a performance improvement since the search for the UID in the
    1.93 -		Contacts database can become very costly as the number of contacts
    1.94 -		grows.
    1.95 -		*/
    1.96 -		EIgnoreUid = CContactDatabase::EConverterReserved1,		
    1.97 -		/**
    1.98 -		During import, if it is determined that the contact item being imported 
    1.99 -		already exists in the database then the contact item in the database will 
   1.100 -		be deleted before being replaced by the vCard being imported. This option
   1.101 -		should be used when the client does not want a merge type behaviour for
   1.102 -		existing contact items. This option will typically be used in a sync use case
   1.103 -		where the vCard data that the client is provided with has already been through a process 
   1.104 -		of conflict resolution and so the existing contact item should be replaced not merged.
   1.105 -		*/		
   1.106 -		EReplaceIfExists = CContactDatabase::EConverterReserved2,
   1.107 -  		};
   1.108 -  		
   1.109 -	/**
   1.110 -	@internalComponent
   1.111 -	@released
   1.112 -	*/
   1.113 -	enum TVersitPropertyType
   1.114 -		{
   1.115 -		EPropertyValueSingle,
   1.116 -		EPropertyValueComposite,
   1.117 -		EPropertyValueHandlingNotImplemented
   1.118 -		};
   1.119 -public: // from CContactConverter
   1.120 -	static CContactVCardConverter* NewL();
   1.121 -	CArrayPtr<CContactItem>* ImportL(CContactDatabase& aDb,RReadStream& aReadStream,TBool& aImportSuccessful,TInt aOptions,TBool aImportSingle);
   1.122 -	void ExportL(CContactDatabase& aDb,const CContactIdArray& aSelectedContactIds,RWriteStream& aWriteStream,TInt aOptions,const Versit::TVersitCharSet aCharSet, TBool aExportPrivateFields, TInt aCommitNumber);
   1.123 -public: // Utility
   1.124 -	static TBool ContainsExportableData(const TDesC& aText);
   1.125 -	static TBool ContainsImportableData(const TDesC& aText, TVersitPropertyType aType, TCntVCardImportType aImportType);
   1.126 -private:
   1.127 -	static TBool ContainsData(const TDesC& aText);
   1.128 -	void doImportL(CVCardToContactsAppConverter& aConverter, CParserVCard& aVCard, CContactDatabase& aDb, TInt aOption, TBool aIncAccessCount, TBool aDecAccessCount, TBool& aImportSuccessful, CArrayPtr<CContactItem>* aContactItems, TBool aIsInTransaction, TContactItemId aIdForUpdate);
   1.129 -	TContactItemId IsVCardMergeNeededL(CVCardToContactsAppConverter& aConverter, CParserVCard& aVCard, CContactDatabase& aDb, TInt aOption);
   1.130 -	void ModifyAccessCountL(CContactItem& aContact,  TBool aIncAccessCount, TBool aDecAccessCount);
   1.131 -	void HandleAgentsInVCardL(CVCardToContactsAppConverter& aConverter, CArrayPtr<CParserProperty>* aAgentProperties, CContactItem& aContact, CContactDatabase& aDb, TInt aOption, TBool aIncAccessCount, TBool aDecAccessCount, CArrayPtr<CContactItem>* aContactItemArray, TBool aMerge);
   1.132 - 	};
   1.133 -
   1.134 -#endif