|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __AGSBACKUPRESTOREAGENT_H__ |
|
17 #define __AGSBACKUPRESTOREAGENT_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <e32property.h> |
|
21 #include "agsfilemanager.h" |
|
22 |
|
23 /** |
|
24 This class listens for backup and restore events. |
|
25 |
|
26 The server needs to be informed about these events because during normal operation |
|
27 calendar files are not closed immediately but after a small delay. When a backup or |
|
28 restore operation is taking place we want files to be close immediately. This is |
|
29 to allow the backup and restore engine to access these files. |
|
30 |
|
31 @internalComponent |
|
32 */ |
|
33 class CAgnServBackupRestoreAgent : public CActive |
|
34 { |
|
35 public: |
|
36 static CAgnServBackupRestoreAgent* NewL(CAgnServFileMgr& aFileMgr); |
|
37 ~CAgnServBackupRestoreAgent(); |
|
38 |
|
39 TBool BackupInProgress() const; |
|
40 TBool RestoreInProgress() const; |
|
41 void Start(); |
|
42 |
|
43 private: |
|
44 CAgnServBackupRestoreAgent(CAgnServFileMgr& aFileMgr); |
|
45 |
|
46 private: // from CActive |
|
47 void RunL(); |
|
48 TInt RunError(TInt aError); |
|
49 void DoCancel(); |
|
50 |
|
51 private: |
|
52 /** |
|
53 Used to subscribe to the SBEngine P&S property KUidBackupRestoreKey. The |
|
54 SBEngine uses the property KUidBackupRestoreKey to notify subscribers of |
|
55 Backup/Restore events. |
|
56 */ |
|
57 RProperty iBackupRestoreNotification; |
|
58 TInt iCurrentState; |
|
59 CAgnServFileMgr& iFileMgr; |
|
60 }; |
|
61 |
|
62 #endif |