|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * |
|
15 * Description: |
|
16 * The header file of the backup engine implement for symbian |
|
17 */ |
|
18 |
|
19 #ifndef FMBKUPENGINEPRIVATE_H |
|
20 #define FMBKUPENGINEPRIVATE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "CMMCScBkupOperationParameters.h" |
|
25 #include "fmbkupengine.h" |
|
26 #include "fmbkupcommon.h" |
|
27 |
|
28 #include "fmbackupsettings.h" |
|
29 #include "fmrestoresettings.h" |
|
30 |
|
31 #include "MMMCScBkupEngineObserver.h" |
|
32 #include <f32file.h> |
|
33 |
|
34 class CMMCScBkupEngine; |
|
35 |
|
36 #include <QObject> |
|
37 NONSHARABLE_CLASS(TMaskLookup) |
|
38 { |
|
39 public: |
|
40 TUint32 iBkupMask; |
|
41 TUint32 iFmgrMask; |
|
42 }; |
|
43 |
|
44 const TMaskLookup KMaskLookup[] = { |
|
45 { FmBkupEngineCommon::EBUCatSettings, FmBkupEngineCommon::EFileManagerBackupContentSettings }, |
|
46 { FmBkupEngineCommon::EBUCatMessages, FmBkupEngineCommon::EFileManagerBackupContentMessages }, |
|
47 { FmBkupEngineCommon::EBUCatContacts, FmBkupEngineCommon::EFileManagerBackupContentContacts }, |
|
48 { FmBkupEngineCommon::EBUCatCalendar, FmBkupEngineCommon::EFileManagerBackupContentCalendar }, |
|
49 { FmBkupEngineCommon::EBUCatBookmarks, FmBkupEngineCommon::EFileManagerBackupContentBookmarks }, |
|
50 { FmBkupEngineCommon::EBUCatUserFiles, FmBkupEngineCommon::EFileManagerBackupContentUserFiles } |
|
51 }; |
|
52 const TUint32 KMaskLookupLen = |
|
53 sizeof( KMaskLookup ) / sizeof( KMaskLookup[ 0 ] ); |
|
54 |
|
55 // CLASS DECLARATION |
|
56 class FmBkupEnginePrivate: public QObject, public MMMCScBkupEngineObserver |
|
57 { |
|
58 Q_OBJECT |
|
59 public: |
|
60 FmBkupEnginePrivate(FmBkupEngine* bkupEngine); |
|
61 ~FmBkupEnginePrivate(); |
|
62 |
|
63 bool startBackup( QList<FmBkupDrivesAndOperation* > drivesAndOperationList, |
|
64 QList<FmBkupBackupCategory*> backupCategoryList, |
|
65 QString drive, quint32 content); |
|
66 |
|
67 void cancelBackup(); |
|
68 int deleteBackup( QList<FmBkupDrivesAndOperation* > drivesAndOperationList ); |
|
69 |
|
70 |
|
71 TUint32 FmgrToBkupMask( const TUint32 aFmrgMask ); |
|
72 int error(); |
|
73 |
|
74 // |
|
75 bool StartRestoreL( QList<FmBkupDrivesAndOperation* > drivesAndOperationList ); |
|
76 void GetRestoreInfoArray( QList<FmBkupDrivesAndOperation* > drivesAndOperationList, |
|
77 QList< FmRestoreInfo > &restoreInfoList, |
|
78 const TInt aDrive = KErrNotFound ); |
|
79 |
|
80 signals: |
|
81 void notifyPreparing( bool cancelable ); |
|
82 void notifyStart( bool cancelable, int totalCount ); |
|
83 void notifyUpdate( int totalCount ); |
|
84 void notifyFinish( int err ); |
|
85 void notifyMemoryLow( int memoryValue, int &userError ); |
|
86 |
|
87 private: |
|
88 void notifyPreparingInternal(); |
|
89 void notifyStartInternal( int aTotalCount ); |
|
90 void notifyUpdateInternal( int aCount ); |
|
91 void notifyFinishInternal(); |
|
92 void notifyMemoryLowInternal( int memoryValue, int &userError ); |
|
93 |
|
94 private: // From MMMCScBkupEngineObserver |
|
95 TInt HandleBkupEngineEventL( |
|
96 MMMCScBkupEngineObserver::TEvent aEvent, TInt aAssociatedData ); |
|
97 |
|
98 static void ResetAndDestroyArchives( TAny* aPtr ); |
|
99 TUint32 BkupToFmgrMask( const TUint32 aBkupMask ); |
|
100 TUint32 AllowedDriveAttMatchMask() const; |
|
101 TInt DriverNameToNumber( QString driverName ); |
|
102 QString NumberToDriverName( TInt driver ); |
|
103 void PublishBurStatus( TInt aType ); |
|
104 |
|
105 private: |
|
106 FmBkupEngine* q; |
|
107 |
|
108 BkupDrivesAndOperationList *iDrvAndOpList; |
|
109 BkupCategoryList *iBkupCategoryList; |
|
110 |
|
111 CMMCScBkupEngine* iBkupEngine; |
|
112 |
|
113 RFs iFs; |
|
114 |
|
115 |
|
116 FmBkupEngine::Process mProcess; |
|
117 int iError; |
|
118 int iFinalValue; |
|
119 }; |
|
120 |
|
121 #endif /*FMBKUPENGINEPRIVATE_H*/ |
|
122 |
|
123 // End of file |