tzservices/tzserver/Server/Include/dataprovider.h
author fimarlaht2 <>
Mon, 18 Oct 2010 15:01:14 +0300
branchRCL_3
changeset 85 32f887d619a0
parent 0 2e3d3ce01487
permissions -rw-r--r--
Bug 3556 - Not possible to restore factory settings

// Copyright (c) 2004-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 __DATAPROVIDER_H__
#define __DATAPROVIDER_H__

#include <tzdefines.h> // ttztimereference
#include "tzswiobserver.h"

const TInt KDataProviderType = 0;

class CReadOnlyTzDb;
class CTzRules;
class RFs;
class CTzUserDataDb;

class CTzDataProvider : public CBase
	{
public:
	static CTzDataProvider* NewL(RFs& aFs, CTzSwiObserver& aSwiObserver, 
		CTzUserDataDb& aUserDataTzDb, MTzDataObserver& aTzDataObserver);
	~CTzDataProvider();

public: 
	CTzId* GetDefaultTimeZoneIdL() const;
	void GetTzRulesL(CTzRules& aTzRules, CTzId& aTzId) const;
	void ReleaseTzRules();
	void GetOffsetsForTimeZoneIdsL(CBufFlat& aTimeZoneIdArray) const;
	TBool IsIdInDbL(TUint aTzId);
	
	void BackupBeginningL();
	void BackupCompletedL();
	void RestoreBeginningL();
	void RestoreCompletedL();

private:
	CTzDataProvider(RFs& aFs, CTzUserDataDb& aUserDataTzDb, MTzDataObserver& aTzDataObserver);
	void ConstructL(CTzSwiObserver& aSwiObserver);

private:
	CReadOnlyTzDb* iReadOnlyTzDb;
	RFs& iFs;
	MTzDataObserver& iTzDataObserver;
	CTzUserDataDb& iUserDataTzDb;
	};	

#endif // __DATAPROVIDER_H__