diff -r 000000000000 -r f979ecb2b13e pimappservices/calendar/server/inc/agsbackuprestoreagent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pimappservices/calendar/server/inc/agsbackuprestoreagent.h Tue Feb 02 10:12:19 2010 +0200 @@ -0,0 +1,62 @@ +// Copyright (c) 2007-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 __AGSBACKUPRESTOREAGENT_H__ +#define __AGSBACKUPRESTOREAGENT_H__ + +#include +#include +#include "agsfilemanager.h" + +/** +This class listens for backup and restore events. + +The server needs to be informed about these events because during normal operation +calendar files are not closed immediately but after a small delay. When a backup or +restore operation is taking place we want files to be close immediately. This is +to allow the backup and restore engine to access these files. + +@internalComponent +*/ +class CAgnServBackupRestoreAgent : public CActive + { +public: + static CAgnServBackupRestoreAgent* NewL(CAgnServFileMgr& aFileMgr); + ~CAgnServBackupRestoreAgent(); + + TBool BackupInProgress() const; + TBool RestoreInProgress() const; + void Start(); + +private: + CAgnServBackupRestoreAgent(CAgnServFileMgr& aFileMgr); + +private: // from CActive + void RunL(); + TInt RunError(TInt aError); + void DoCancel(); + +private: + /** + Used to subscribe to the SBEngine P&S property KUidBackupRestoreKey. The + SBEngine uses the property KUidBackupRestoreKey to notify subscribers of + Backup/Restore events. + */ + RProperty iBackupRestoreNotification; + TInt iCurrentState; + CAgnServFileMgr& iFileMgr; + }; + +#endif