homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp
changeset 51 4785f57bf3d4
child 60 30f14686fb04
equal deleted inserted replaced
46:23b5d6a29cce 51:4785f57bf3d4
       
     1 /*
       
     2 * Copyright (c) 2010 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 the License "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:  Active callback for Backup/Restore observer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <bautils.h>
       
    21 
       
    22 #include "hsbackuprestoreactivecallback.h"
       
    23 #include "hsbackuprestoreobserver.h"
       
    24 
       
    25 //  CONSTANTS
       
    26 
       
    27 // ======== MEMBER FUNCTIONS ========
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 // 
       
    31 // ---------------------------------------------------------------------------
       
    32 //
       
    33 CHsBURActiveCallback* CHsBURActiveCallback::NewL(HsBackupRestoreObserver* observer)
       
    34 {
       
    35     CHsBURActiveCallback* self =
       
    36         new( ELeave ) CHsBURActiveCallback(observer);
       
    37     CleanupStack::PushL( self );
       
    38     self->ConstructL();
       
    39     CleanupStack::Pop( self );
       
    40 
       
    41     return self;
       
    42 }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // Destructor
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CHsBURActiveCallback::~CHsBURActiveCallback()
       
    49 {
       
    50 }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // Inform that all data has been backed up or restored.
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 void CHsBURActiveCallback::AllSnapshotsSuppliedL()
       
    57 {
       
    58     // No implementation needed. Must not leave    
       
    59 }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // Not supported.
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 void CHsBURActiveCallback::ReceiveSnapshotDataL(
       
    66     TDriveNumber /*aDrive*/, TDesC8& /*aBuffer*/, TBool /*aLastSection*/)
       
    67 {
       
    68 	// No implementation needed
       
    69     User::Leave( KErrNotSupported );
       
    70 }
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // Make a guess about data size.
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 TUint CHsBURActiveCallback::GetExpectedDataSize(
       
    77     TDriveNumber /*aDrive*/)
       
    78 {
       
    79     // No implementation needed
       
    80     return 0;
       
    81 }
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // Not supported.
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 void CHsBURActiveCallback::GetSnapshotDataL(
       
    88     TDriveNumber /*aDrive*/, TPtr8& /*aBuffer*/, TBool& /*aFinished*/)
       
    89 {
       
    90     // No implementation needed
       
    91     User::Leave( KErrNotSupported );
       
    92 }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // Initialize for backup.
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 void CHsBURActiveCallback::InitialiseGetBackupDataL(
       
    99     TDriveNumber /*aDrive*/)
       
   100 {
       
   101     iObserver->backupRestoreStarted();    
       
   102 }
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void CHsBURActiveCallback::GetBackupDataSectionL(
       
   108     TPtr8& /*aBuffer*/, TBool& aFinished)
       
   109 {
       
   110     // No data for active backup
       
   111     aFinished = ETrue;
       
   112 }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // Initialize restore.
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118 void CHsBURActiveCallback::InitialiseRestoreBaseDataL(
       
   119     TDriveNumber /*aDrive*/ )
       
   120 {
       
   121     // No implementation needed
       
   122     User::Leave( KErrNotSupported );    
       
   123 }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // Run state machine for restore. Receive stream from BUR engine and turn it
       
   127 // to file(s).
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 void CHsBURActiveCallback::RestoreBaseDataSectionL(
       
   131     TDesC8& /*aBuffer*/, TBool /*aFinished*/ )
       
   132 {
       
   133     // No implementation needed
       
   134     User::Leave( KErrNotSupported );  
       
   135 }
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // Incremental restoration is not supported.
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 void CHsBURActiveCallback::InitialiseRestoreIncrementDataL(
       
   142     TDriveNumber /*aDrive*/)
       
   143 {
       
   144     // No implementation needed
       
   145     User::Leave( KErrNotSupported );
       
   146 }
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // Incremental restoration is not supported.
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 void CHsBURActiveCallback::RestoreIncrementDataSectionL(
       
   153     TDesC8& /*aBuffer*/, TBool /*aFinished*/)
       
   154 {
       
   155     // No implementation needed
       
   156     User::Leave( KErrNotSupported );
       
   157 }
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // Called when restore is complete - sets data back to initial state.
       
   161 // ---------------------------------------------------------------------------
       
   162 //
       
   163 void CHsBURActiveCallback::RestoreComplete(TDriveNumber /*aDrive*/)
       
   164 {
       
   165     // No implementation needed
       
   166 }
       
   167 
       
   168 // ---------------------------------------------------------------------------
       
   169 // Tidy up when operation is over.
       
   170 // ---------------------------------------------------------------------------
       
   171 //
       
   172 void CHsBURActiveCallback::TerminateMultiStageOperation()
       
   173 {
       
   174     // No implementation needed
       
   175 }
       
   176 
       
   177 // ---------------------------------------------------------------------------
       
   178 //
       
   179 // ---------------------------------------------------------------------------
       
   180 //
       
   181 TUint CHsBURActiveCallback::GetDataChecksum(TDriveNumber /*aDrive*/)
       
   182 {
       
   183     // No implementation needed
       
   184     return 0;
       
   185 }
       
   186 
       
   187 // ---------------------------------------------------------------------------
       
   188 // C++ constructor.
       
   189 // ---------------------------------------------------------------------------
       
   190 //
       
   191 CHsBURActiveCallback::CHsBURActiveCallback(HsBackupRestoreObserver* observer)
       
   192 {
       
   193 	iObserver = observer;
       
   194 }
       
   195 
       
   196 // ---------------------------------------------------------------------------
       
   197 // 2nd phase constructor.
       
   198 // ---------------------------------------------------------------------------
       
   199 //
       
   200 void CHsBURActiveCallback::ConstructL()
       
   201 {
       
   202 }
       
   203  
       
   204 // End of file