phonebookengines_old/contactsmodel/tsrc/TestSyncPlugIn/cntphonecontact.h
author hgs
Wed, 21 Jul 2010 11:09:07 +0300
changeset 49 74b30151afd6
parent 40 b46a585f6909
permissions -rw-r--r--
201025_2

// Copyright (c) 2005-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 CNTPHONECONTACT_H
#define CNTPHONECONTACT_H


#include <centralrepository.h>  // CRepository.
#include <e32property.h>
#include <phbksync.h>

class CContactSyncStaticRepository 
	{
public:
	static void WriteIntToCentralRepositoryL(TUint32& aKey, const TInt aValue, CRepository& iRepository);
	static void ReadIntFromCentralRepositoryL(TUint32& aKey, TInt& aValue, CRepository& iRepository);
	static void WriteStringToCentralRepositoryL(TUint32& aKey, TPtr aString, CRepository& iRepository);
	static void ReadStringFromCentralRepositoryL(TUint32& aKey, TPtr& aString, CRepository& iRepository);
	};

class CPhonebookContact : public CBase
	{

public:
	static CPhonebookContact* NewLC(const TDesC& aName, const TDesC& aNumber, CRepository* aRepository);
	static CPhonebookContact* NewL(TUint32& aCRKey, CRepository* aRepository);
	~CPhonebookContact();
	const HBufC* Name();
	const HBufC* Number();
	void WriteToCRL(TUint32& aCRKey) const;	
	CPhonebookContact(CRepository* aRepository);
private:
	void ConstructL(const TDesC& aName, const TDesC& aNumber);
	void ConstructL(TUint32& aCRKey);

private:
	HBufC*	iName;
	HBufC*	iNumber;
	CRepository* iRepository;
	};

#endif