filemanager/src/filemanager/src/backuprestore/fmbackuprestorehandler.h
branchRCL_3
changeset 20 491b3ed49290
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
       
     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 backup and restore handler of file manager
       
    17  */
       
    18 
       
    19 #ifndef FMBACKUPRESTOREHANDLER_H
       
    20 #define FMBACKUPRESTOREHANDLER_H
       
    21 
       
    22 #include <QObject>
       
    23 
       
    24 #include "fmoperationservice.h"
       
    25 
       
    26 class FmBkupEngine;
       
    27 class FmOperationBackup;
       
    28 class FmOperationRestore;
       
    29 class FmBackupConfigLoader;
       
    30 
       
    31 class FmBackupRestoreHandler : public QObject
       
    32 {
       
    33 Q_OBJECT
       
    34 
       
    35 public:
       
    36 
       
    37     FmBackupRestoreHandler( QObject *parent );
       
    38     ~FmBackupRestoreHandler();
       
    39 
       
    40     int error();
       
    41     
       
    42     bool startBackup( FmOperationBackup *operationBackup );
       
    43     void cancelBackup();
       
    44     
       
    45     bool startRestore( FmOperationRestore *operationRestore );
       
    46 
       
    47     int deleteBackup( quint64 selection );
       
    48     FmBkupEngine *bkupEngine();
       
    49     FmBackupConfigLoader *backupConfigLoader();
       
    50     void getBackupDriveList( QStringList &driveList );
       
    51 
       
    52 signals:
       
    53     void notifyPreparing( bool cancelable );
       
    54     void notifyStart( bool cancelable, int maxSteps );
       
    55     void notifyProgress( int currentStep );
       
    56     void notifyFinish();
       
    57     void notifyError( int error, QString errString ); 
       
    58     void notifyCanceled(); 
       
    59 
       
    60     
       
    61 public slots:
       
    62     void onNotifyPreparing( bool cancelable );
       
    63     void onNotifyMemoryLow( int memoryValue, int &userError );
       
    64     
       
    65     void onNotifyStart( bool cancelable, int maxSteps );
       
    66     void onNotifyUpdate( int currentStep );
       
    67     void onNotifyFinish( int err );
       
    68     
       
    69     void onNotifyBackupFilesExist( bool &isContinue );
       
    70 private:
       
    71     enum Process{
       
    72 		ProcessNone = 0,
       
    73 		ProcessBackup,
       
    74 		ProcessRestore
       
    75 	};
       
    76 private:
       
    77     FmBkupEngine  *mBkupEngine;
       
    78     FmBackupConfigLoader        *mBackupConfigLoader;
       
    79     Process       mCurrentProcess;
       
    80 };
       
    81 
       
    82 #endif