filemanager/schbkup/inc/filemanagerschbackuptask.h
branchRCL_3
changeset 38 491b3ed49290
parent 36 95243422089a
child 39 65326cf895ed
equal deleted inserted replaced
36:95243422089a 38: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:  Handles file manager scheduled backup task start
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FILEMANAGERSCHBACKUPTASK_H
       
    20 #define C_FILEMANAGERSCHBACKUPTASK_H
       
    21 
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 #include "filemanagerschobserver.h"
       
    26 #include "fmsystemstatemonitor.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CScheduledTask;
       
    30 class CFileManagerSchSubscriber;
       
    31 class CRepository;
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36  *  This class handles scheduled backup task start functionality
       
    37  *
       
    38  *  @since S60 3.1
       
    39  */
       
    40 class CFileManagerSchBackupTask : public CActive,
       
    41                                   public MFileManagerSchObserver,
       
    42                                   public MFmSystemStateMonitorObserver
       
    43     {
       
    44 
       
    45 public:
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      */
       
    49     static CFileManagerSchBackupTask* NewL( const CScheduledTask& aTask );
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      */
       
    54     ~CFileManagerSchBackupTask();
       
    55 
       
    56 private: // From CActive
       
    57     void RunL();
       
    58 
       
    59     void DoCancel();
       
    60 
       
    61     TInt RunError( TInt aError );
       
    62 
       
    63 private: // From FileManagerSchObserver
       
    64     void NotifyKeyChangeOrTimeoutL(
       
    65         const TUid& aCategory,
       
    66         const TUint aKey,
       
    67         const TBool aTimeout );
       
    68 
       
    69 public: // From MFmSystemStateMonitorObserver
       
    70     /**
       
    71      * Called when the system state changed  
       
    72      * @since 5.2
       
    73      */
       
    74     void SystemStateChangedEvent();
       
    75     
       
    76 private: // New methods
       
    77     /**
       
    78      * Constructors
       
    79      */
       
    80     CFileManagerSchBackupTask();
       
    81 
       
    82     void ConstructL( const CScheduledTask& aTask );
       
    83 
       
    84     /**
       
    85      * Starts backup task start procedure
       
    86      */
       
    87     void StartL();
       
    88 
       
    89     /**
       
    90      * Exists backup task start procedure
       
    91      */
       
    92     void Exit();
       
    93 
       
    94     /**
       
    95      * Retries backup task start procedure
       
    96      */
       
    97     void Retry();
       
    98 
       
    99     /**
       
   100      * Starts file manager to run backup
       
   101      */
       
   102     void StartFileManagerL();
       
   103 
       
   104     /**
       
   105      * Checks is backup required
       
   106      */
       
   107     TBool CheckBackupRequired();
       
   108 
       
   109     /**
       
   110      * Checks phone state is it ok to start backup
       
   111      */
       
   112     TBool CheckPhoneStateL();
       
   113 
       
   114 private: // Data
       
   115     /**
       
   116      * Backup weekday, given from originator
       
   117      */
       
   118     TInt iDay;
       
   119 
       
   120     /**
       
   121      * Subscriber to observe phone and backup start states
       
   122      * Own.
       
   123      */
       
   124     CFileManagerSchSubscriber* iSubscriber;
       
   125 
       
   126     /**
       
   127      * Pointer to file manager settings in CenRep
       
   128      * Own.
       
   129      */
       
   130     CRepository* iCenRep;
       
   131 
       
   132     /**
       
   133      * Start attempts left
       
   134      */
       
   135     TInt iAttemptsLeft;
       
   136     
       
   137     /**
       
   138      * Own: Pointer to system state monitor   
       
   139      */
       
   140     CFmSystemStateMonitor* iSystemStateMonitor;
       
   141 
       
   142     };
       
   143 
       
   144 
       
   145 #endif // C_FILEMANAGERSCHBACKUPTASK_H
       
   146 
       
   147 // End of file