filemanager/schbkup/inc/filemanagerschbackuptask.h
changeset 0 6a9f87576119
child 14 efe289f793e7
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     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 
       
    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     {
       
    43 
       
    44 public:
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      */
       
    48     static CFileManagerSchBackupTask* NewL( const CScheduledTask& aTask );
       
    49 
       
    50     /**
       
    51      * Destructor
       
    52      */
       
    53     ~CFileManagerSchBackupTask();
       
    54 
       
    55 private: // From CActive
       
    56     void RunL();
       
    57 
       
    58     void DoCancel();
       
    59 
       
    60     TInt RunError( TInt aError );
       
    61 
       
    62 private: // From FileManagerSchObserver
       
    63     void NotifyKeyChangeOrTimeoutL(
       
    64         const TUid& aCategory,
       
    65         const TUint aKey,
       
    66         const TBool aTimeout );
       
    67 
       
    68 private: // New methods
       
    69     /**
       
    70      * Constructors
       
    71      */
       
    72     CFileManagerSchBackupTask();
       
    73 
       
    74     void ConstructL( const CScheduledTask& aTask );
       
    75 
       
    76     /**
       
    77      * Starts backup task start procedure
       
    78      */
       
    79     void StartL();
       
    80 
       
    81     /**
       
    82      * Exists backup task start procedure
       
    83      */
       
    84     void Exit();
       
    85 
       
    86     /**
       
    87      * Retries backup task start procedure
       
    88      */
       
    89     void Retry();
       
    90 
       
    91     /**
       
    92      * Starts file manager to run backup
       
    93      */
       
    94     void StartFileManagerL();
       
    95 
       
    96     /**
       
    97      * Checks is backup required
       
    98      */
       
    99     TBool CheckBackupRequired();
       
   100 
       
   101     /**
       
   102      * Checks phone state is it ok to start backup
       
   103      */
       
   104     TBool CheckPhoneStateL();
       
   105 
       
   106 private: // Data
       
   107     /**
       
   108      * Backup weekday, given from originator
       
   109      */
       
   110     TInt iDay;
       
   111 
       
   112     /**
       
   113      * Subscriber to observe phone and backup start states
       
   114      * Own.
       
   115      */
       
   116     CFileManagerSchSubscriber* iSubscriber;
       
   117 
       
   118     /**
       
   119      * Pointer to file manager settings in CenRep
       
   120      * Own.
       
   121      */
       
   122     CRepository* iCenRep;
       
   123 
       
   124     /**
       
   125      * Start attempts left
       
   126      */
       
   127     TInt iAttemptsLeft;
       
   128 
       
   129     };
       
   130 
       
   131 
       
   132 #endif // C_FILEMANAGERSCHBACKUPTASK_H
       
   133 
       
   134 // End of file