filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.h
branchRCL_3
changeset 39 65326cf895ed
parent 38 491b3ed49290
child 42 f5c50b8af68c
equal deleted inserted replaced
38:491b3ed49290 39:65326cf895ed
     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 #include <QObject>
       
    35 #include <QStringList>
       
    36 
       
    37 class CMMCScBkupEngine;
       
    38 
       
    39 NONSHARABLE_CLASS(TMaskLookup)
       
    40     {
       
    41     public:
       
    42         TUint32 iBkupMask;
       
    43         TUint32 iFmgrMask;
       
    44     };
       
    45 
       
    46 const TMaskLookup KMaskLookup[] = {
       
    47     { FmBkupEngineCommon::EBUCatSettings,  FmBkupEngineCommon::EFileManagerBackupContentSettings  },
       
    48     { FmBkupEngineCommon::EBUCatMessages,  FmBkupEngineCommon::EFileManagerBackupContentMessages  },
       
    49     { FmBkupEngineCommon::EBUCatContacts,  FmBkupEngineCommon::EFileManagerBackupContentContacts  },
       
    50     { FmBkupEngineCommon::EBUCatCalendar,  FmBkupEngineCommon::EFileManagerBackupContentCalendar  },
       
    51     { FmBkupEngineCommon::EBUCatBookmarks, FmBkupEngineCommon::EFileManagerBackupContentBookmarks },
       
    52     { FmBkupEngineCommon::EBUCatUserFiles, FmBkupEngineCommon::EFileManagerBackupContentUserFiles }
       
    53 };
       
    54 const TUint32 KMaskLookupLen =
       
    55     sizeof( KMaskLookup ) / sizeof( KMaskLookup[ 0 ] );
       
    56 
       
    57 // CLASS DECLARATION
       
    58 class FmBkupEnginePrivate: public QObject, public MMMCScBkupEngineObserver
       
    59 {
       
    60 Q_OBJECT
       
    61 public:
       
    62     FmBkupEnginePrivate(FmBkupEngine* bkupEngine);
       
    63     ~FmBkupEnginePrivate();
       
    64     
       
    65     bool startBackup( QList<FmBkupDrivesAndOperation* > drivesAndOperationList,
       
    66     QList<FmBkupBackupCategory*> backupCategoryList,
       
    67     QString drive, quint32 content);
       
    68     
       
    69     void cancelBackup();
       
    70     int deleteBackup( QList<FmBkupDrivesAndOperation* > drivesAndOperationList );
       
    71     
       
    72 
       
    73     TUint32 FmgrToBkupMask( const TUint32 aFmrgMask );
       
    74     int error();
       
    75     
       
    76     //
       
    77     bool StartRestoreL( QList<FmBkupDrivesAndOperation* > drivesAndOperationList );
       
    78     void GetRestoreInfoArray( QList<FmBkupDrivesAndOperation* > drivesAndOperationList,
       
    79             QList< FmRestoreInfo > &restoreInfoList,
       
    80             const QString& aDrive );
       
    81     
       
    82     void getBackupDriveList( QStringList &driveList );
       
    83 
       
    84 signals:
       
    85     void notifyPreparing( bool cancelable );
       
    86 	void notifyStart( bool cancelable, int totalCount );
       
    87 	void notifyUpdate( int totalCount );
       
    88 	void notifyFinish( int err );
       
    89 	void notifyMemoryLow( int memoryValue, int &userError );
       
    90 	void notifyBackupFilesExist( bool &isContinue );
       
    91 private:
       
    92     void notifyPreparingInternal();
       
    93 	void notifyStartInternal( int aTotalCount );
       
    94 	void notifyUpdateInternal( int aCount );
       
    95 	void notifyFinishInternal();
       
    96 	void notifyMemoryLowInternal( int memoryValue, int &userError );
       
    97 	void notifyBackupFilesExistInternal( bool &isContinue );
       
    98 
       
    99 private: // From MMMCScBkupEngineObserver
       
   100     TInt HandleBkupEngineEventL(
       
   101         MMMCScBkupEngineObserver::TEvent aEvent, TInt aAssociatedData );
       
   102     
       
   103     static void ResetAndDestroyArchives( TAny* aPtr );
       
   104     TUint32 BkupToFmgrMask( const TUint32 aBkupMask );
       
   105     TUint32 AllowedDriveAttMatchMask() const;
       
   106     TInt DriverNameToNumber( QString driverName );
       
   107     QString NumberToDriverName( TInt driver );
       
   108     void PublishBurStatus( TInt aType );
       
   109     
       
   110 private:
       
   111     FmBkupEngine* q;
       
   112     
       
   113     BkupDrivesAndOperationList    *iDrvAndOpList;
       
   114     BkupCategoryList           *iBkupCategoryList;    
       
   115     
       
   116     CMMCScBkupEngine* iBkupEngine;
       
   117     
       
   118     RFs iFs;
       
   119     
       
   120     
       
   121     FmBkupEngine::Process mProcess;
       
   122     int iError;
       
   123     int iFinalValue;
       
   124 };
       
   125 
       
   126 #endif /*FMBKUPENGINEPRIVATE_H*/
       
   127 
       
   128 // End of file