filemanager/App/inc/CFileManagerSchBackupHandler.h
branchRCL_3
changeset 20 491b3ed49290
parent 19 95243422089a
child 21 65326cf895ed
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
     1 /*
       
     2 * Copyright (c) 2006 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 * Description:  Handler for scheduled backup
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FILEMANAGERSCHBACKUPHANDLER_H
       
    20 #define C_FILEMANAGERSCHBACKUPHANDLER_H
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <MFileManagerGlobalDlgObserver.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CFileManagerEngine;
       
    30 class CFileManagerGlobalDlg;
       
    31 class MFileManagerSchBackupObserver;
       
    32 class CRepository;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  *  This class handles scheduled backup
       
    38  *
       
    39  *  @since S60 3.1
       
    40  */
       
    41 class CFileManagerSchBackupHandler :
       
    42         public CBase,
       
    43         public MFileManagerGlobalDlgObserver
       
    44     {
       
    45 
       
    46 public:
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */
       
    50 	static CFileManagerSchBackupHandler* NewL(
       
    51 	    CFileManagerEngine& aEngine );
       
    52 
       
    53     /**
       
    54 	 * Destructor.
       
    55      */
       
    56     ~CFileManagerSchBackupHandler();
       
    57 
       
    58     /**
       
    59 	 * Starts backup with confirm note.
       
    60      */
       
    61     void StartBackupWithConfirm();
       
    62 
       
    63     /**
       
    64 	 * Sets backup observer
       
    65 	 * @param aObserver Pointer to observer or NULL.
       
    66 	 *                 Ownership is not transferred.
       
    67      */
       
    68     void SetObserver(
       
    69         MFileManagerSchBackupObserver* aObserver );
       
    70 
       
    71     /**
       
    72 	 * Informs process finished
       
    73 	 * @param aError System wide error code
       
    74 	 * @param aName Error related descriptor
       
    75      */
       
    76     void ProcessFinishedL( TInt aError, const TDesC& aName );
       
    77 
       
    78     /**
       
    79 	 * Informs process advance
       
    80 	 * @param aValue Current progress value
       
    81      */
       
    82     void ProcessAdvanceL( TInt aValue );
       
    83 
       
    84     /**
       
    85 	 * Informs process started
       
    86 	 * @param aFinalValue Final progress value
       
    87      */
       
    88     void ProcessStartedL( TInt aFinalValue );
       
    89 
       
    90     /**
       
    91 	 * Cancels scheduled backup launcher
       
    92      */
       
    93     void CancelBackupStarter();
       
    94 
       
    95 private: // From MFileManagerGlobalDialogObserver
       
    96     /**
       
    97      * @see MFileManagerGlobalDialogObserver
       
    98      */
       
    99     void HandleGlobalDlgResult(
       
   100         TInt aDialogType,
       
   101         TInt aDialogResult );
       
   102 
       
   103 private:
       
   104     CFileManagerSchBackupHandler(
       
   105         CFileManagerEngine& aEngine );
       
   106 
       
   107     void ConstructL();
       
   108 
       
   109     void StartBackupWithConfirmL();
       
   110 
       
   111     void StartBackupL();
       
   112 
       
   113     void StartBackup();
       
   114 
       
   115     void InformObserver( const TInt aValue );
       
   116 
       
   117     TBool IsPowerSavingModeOnL();
       
   118 
       
   119     TBool IsTargetDriveAvailableL( const TFileManagerDriveInfo& aDrvInfo );
       
   120 
       
   121 private: // Data
       
   122     /**
       
   123      * Reference to file manager engine
       
   124      * Not own.
       
   125      */
       
   126     CFileManagerEngine& iEngine;
       
   127 
       
   128     /**
       
   129      * For global dialog handling
       
   130      * Own.
       
   131      */
       
   132     CFileManagerGlobalDlg* iGlobalDlg;
       
   133 
       
   134     /**
       
   135      * Pointer to scheduled backup observer
       
   136      * Not own.
       
   137      */
       
   138     MFileManagerSchBackupObserver* iObserver;
       
   139 
       
   140     /**
       
   141      * To indicate is backup ongoing
       
   142      */
       
   143     TBool iBackupOngoing;
       
   144 
       
   145     /**
       
   146      * Pointer to CenRep
       
   147      * Own.
       
   148      */
       
   149     CRepository* iCenRep;
       
   150     };
       
   151 
       
   152 #endif  // C_FILEMANAGERSCHBACKUPHANDLER_H   
       
   153             
       
   154 // End of File