homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h
changeset 62 341166945d65
parent 51 4785f57bf3d4
child 90 3ac3aaebaee5
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Home screen active callback in HsBackupRestoreObserver.
    14 * Description: Active callback for Backup/Restore observer.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #ifndef HSBACKUPRESTOREACTIVECALLBACK_H
    19 #ifndef HSBACKUPRESTOREACTIVECALLBACK_H
    20 #define HSBACKUPRESTOREACTIVECALLBACK_H
    20 #define HSBACKUPRESTOREACTIVECALLBACK_H
    21 
    21 
    22 #include <e32base.h>    // CBase
    22 #include <e32base.h>
    23 #include <connect/abclient.h>
    23 #include <connect/abclient.h>
    24 
    24 
    25 class HsBackupRestoreObserver;
    25 class HsBackupRestoreObserver;
    26 
    26 
    27 /**
    27 
    28  *  Home screen active callback in backup/restore.
       
    29  *
       
    30  *  @lib hsdomainmodel
       
    31  *  @since S60 ^4
       
    32  */
       
    33 NONSHARABLE_CLASS(CHsBURActiveCallback) : public CBase, 
    28 NONSHARABLE_CLASS(CHsBURActiveCallback) : public CBase, 
    34 	                                     public conn::MActiveBackupDataClient
    29 	                                     public conn::MActiveBackupDataClient
    35     {
    30     {
    36 public:
    31 public:
    37 
    32 
    38     IMPORT_C static CHsBURActiveCallback* NewL(HsBackupRestoreObserver* observer);
    33     IMPORT_C static CHsBURActiveCallback* NewL(HsBackupRestoreObserver* observer);
    39 
    34 
    40     virtual ~CHsBURActiveCallback();    
    35     virtual ~CHsBURActiveCallback();    
    41 
    36 
    42 // new functions
    37     // new functions from base class MActiveBackupDataClient
    43 
       
    44 // from base class MActiveBackupDataClient
       
    45 
       
    46     /**
       
    47      * This method informs the active backup data client that all 
       
    48      * snapshots have been supplied. If the client has not
       
    49      * received a snapshot then it should perform a base backup
       
    50      */
       
    51     virtual void AllSnapshotsSuppliedL();
    38     virtual void AllSnapshotsSuppliedL();
    52 
       
    53     /**
       
    54      * This method receives all or part of a snapshot of data to allow 
       
    55      * calculation of an incremental backup.  The snapshot is one that
       
    56      * was previously supplied by the data owner.  The snapshot data 
       
    57      * should be read from the location supplied. The snapshot data may
       
    58      * be larger than the location supplied in which case the routine 
       
    59      * will be called repeatedly until all data has been supplied.
       
    60      *
       
    61      * Snapshot data will also be supplied as part of a restore operation
       
    62      *        
       
    63      * @param aDrive the drive being backed up
       
    64      * @param aBuffer a pointer to the base of the location from whence 
       
    65      *        data can be copied.
       
    66      * @param aLastSection ETrue if this is the last section of snapshot 
       
    67      *        data, else EFalse.
       
    68      */
       
    69     virtual void ReceiveSnapshotDataL(
    39     virtual void ReceiveSnapshotDataL(
    70         TDriveNumber aDrive, TDesC8& aBuffer, TBool aLastSection);
    40         TDriveNumber aDrive, TDesC8& aBuffer, TBool aLastSection);
    71 
       
    72     /**
       
    73      * This method returns the expected size of backup data that will be
       
    74      * supplied. If an incremental backup is underway then this method
       
    75      * then this method will not be called until after 
       
    76      * ReceiveSnapshotDataL(). The size data will be used for the purpose
       
    77      * of tracking progess during a backup. If it is inaccurate then the
       
    78      * user may see irregular progress but the actual backup data will 
       
    79      * not be affected so it is acceptable to return an estimated value.
       
    80      *
       
    81      * @param aDrive the drive being backed up.
       
    82      * @return the size of the data that will be returned
       
    83      */
       
    84     virtual TUint GetExpectedDataSize(TDriveNumber aDrive);
    41     virtual TUint GetExpectedDataSize(TDriveNumber aDrive);
    85 
       
    86     /**
       
    87      * This method returns a snapshot of data to accompany a backup. The 
       
    88      * snapshot is expected to contain details on files / data being 
       
    89      * backed up. The format of the snapshot is only meaningful to the
       
    90      * data owner. The snapshot will be supplied if the data owner is 
       
    91      * asked for an incremental backup and for a restore operation. The 
       
    92      * snapshot data should be copied to the location supplied.
       
    93      *
       
    94      * The snapshot data may be larger than the location supplied in 
       
    95      * which case the routine will be called repeatedly until all data
       
    96      * has been retrieved.
       
    97      *
       
    98      * @param aDrive the drive being backed up
       
    99      * @param aBuffer a pointer to the base of the location where data 
       
   100      *        can be copied.
       
   101      * @param aFinished on return ETrue if all data has been returned 
       
   102      *        for this drive, else EFalse.
       
   103      */
       
   104     virtual void GetSnapshotDataL( 
    42     virtual void GetSnapshotDataL( 
   105         TDriveNumber aDrive, TPtr8& aBuffer, TBool& aFinished);
    43         TDriveNumber aDrive, TPtr8& aBuffer, TBool& aFinished);
   106 
       
   107     /**
       
   108      * This method prepares the implementor to return backup data. It 
       
   109      * will be followed by a sequence of calls to request the actual 
       
   110      * data.
       
   111      *        
       
   112      * @param aDrive the drive being backed up.
       
   113      */
       
   114     virtual void InitialiseGetBackupDataL(TDriveNumber aDrive);
    44     virtual void InitialiseGetBackupDataL(TDriveNumber aDrive);
   115 
       
   116     /**
       
   117      * This method requests a section of backup data.  
       
   118      * InitialiseGetBackupDataL() will have been called previously to
       
   119      * specify the drive concerned.  The data returned may be base or
       
   120      * incremental depending on the type of backup and the capability of
       
   121      * the data owner.
       
   122      *
       
   123      * @param aBuffer a pointer to the base of the location where data 
       
   124      *        can be copied.
       
   125      * @param aFinished on return ETrue if all data has been returned 
       
   126      *        for this drive, else EFalse.
       
   127      */
       
   128     virtual void GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished);
    45     virtual void GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished);
   129 
       
   130     /**
       
   131      * This method prepares the implementor to receive base restore data
       
   132      * for a drive. It will be followed by a sequence of calls to supply
       
   133      * the actual data.
       
   134      *
       
   135      * @param aDrive the drive being restored.
       
   136      */
       
   137     virtual void InitialiseRestoreBaseDataL(TDriveNumber aDrive);
    46     virtual void InitialiseRestoreBaseDataL(TDriveNumber aDrive);
   138 
       
   139     /**
       
   140      * This method receives a section of base restore data.
       
   141      * InitialiseRestoreBaseDataL() will have been called previously to 
       
   142      * specify the drive concerned.
       
   143      *
       
   144      * @param aBuffer a pointer to the base of the location whence data
       
   145      *        can be read.
       
   146      * @param aFinished ETrue if all data has been returned for this 
       
   147      *        drive, else EFalse.
       
   148      */
       
   149     virtual void RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished);
    47     virtual void RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished);
   150 
       
   151     /**
       
   152      * This method prepares the implementor to receive incremental 
       
   153      * restore data for a drive. It will be followed by a sequence 
       
   154      * of calls to supply the actual data.  If multiple increments
       
   155      * are supplied then this methid will be called before each increment
       
   156      *
       
   157      * @param aDrive the drive being restored.
       
   158      */
       
   159     virtual void InitialiseRestoreIncrementDataL(TDriveNumber aDrive);
    48     virtual void InitialiseRestoreIncrementDataL(TDriveNumber aDrive);
   160 
       
   161     /**
       
   162      * This method receives a section of increment restore data.
       
   163      * InitialiseRestoreIncrementDataL() will have been called 
       
   164      * previously to specify the drive concerned.
       
   165      *
       
   166      * @param aBuffer a pointer to the base of the location whence data 
       
   167      *        can be read.
       
   168      * @param aFinished ETrue if all data has been returned for this 
       
   169      *        increment, else EFalse.
       
   170      */
       
   171     virtual void RestoreIncrementDataSectionL(TDesC8& aBuffer, TBool aFinished);
    49     virtual void RestoreIncrementDataSectionL(TDesC8& aBuffer, TBool aFinished);
   172 
       
   173     /**
       
   174      * This method is called when all data to be restored has been 
       
   175      * supplied.
       
   176      *
       
   177      * @param aDrive the drive being restored.
       
   178      */
       
   179     virtual void RestoreComplete(TDriveNumber aDrive);   
    50     virtual void RestoreComplete(TDriveNumber aDrive);   
   180 
       
   181     /**
       
   182      * This method is called if copying of data is terminated prematurely 
       
   183      * to allow the implementor to tidy up.  The same method applies to 
       
   184      * all types of data and to backup and restore.
       
   185      */
       
   186     virtual void TerminateMultiStageOperation();
    51     virtual void TerminateMultiStageOperation();
   187 
       
   188     /**
       
   189      * Gets a 32-bit checksum for its private data.
       
   190      * This routine is for test purposes.  It must be implemented but an
       
   191      * invariant checksum value can be provided.  Some tests may cause 
       
   192      * checksum values to be compared.
       
   193      *
       
   194      * @param aDrive the drive containing data being checksummed
       
   195      * @return the 32-bit checksum
       
   196      */
       
   197     virtual TUint GetDataChecksum(TDriveNumber aDrive);
    52     virtual TUint GetDataChecksum(TDriveNumber aDrive);
   198 
    53 
   199 private:
    54 private:
   200     CHsBURActiveCallback(HsBackupRestoreObserver* observer);
    55     CHsBURActiveCallback(HsBackupRestoreObserver* observer);
   201 
    56 
   202     void ConstructL();
    57     void ConstructL();
   203 
    58 
   204 private: // data
    59 private:
   205 	// Bacup/Restore observer. Not own.
    60 	// Bacup/Restore observer. Not own.
   206     HsBackupRestoreObserver *iObserver;
    61     HsBackupRestoreObserver *iObserver;
   207     };
    62     };
   208 
    63 
   209 #endif // HSBACKUPRESTOREACTIVECALLBACK_H
    64 #endif // HSBACKUPRESTOREACTIVECALLBACK_H