filemanager/bkupengine/src/CMMCScBkupStateOpAware.cpp
changeset 0 6a9f87576119
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2005 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: CMMCScBkupStateOpAware implementation
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #include "CMMCScBkupStateOpAware.h"
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 // ========================= MEMBER FUNCTIONS ================================
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CMMCScBkupStateOpAware::CMMCScBkupStateOpAware()
       
    28 // 
       
    29 // C++ constructor.
       
    30 // ---------------------------------------------------------------------------
       
    31 CMMCScBkupStateOpAware::CMMCScBkupStateOpAware( MMMCScBkupDriver& aDriver, TInt aPriority )
       
    32 :   CMMCScBkupState( aDriver, aPriority )
       
    33     {
       
    34     }
       
    35 
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // CMMCScBkupStateOpAware::NextStateId()
       
    39 // 
       
    40 // 
       
    41 // ---------------------------------------------------------------------------
       
    42 TMMCScBkupStateId CMMCScBkupStateOpAware::NextStateId() const
       
    43     {
       
    44     TMMCScBkupStateId state = KMMCScBkupStateIdOperationComplete;
       
    45     //
       
    46     const TMMCScBkupOperationType type = Driver().DrvOperation();
       
    47     switch(type)
       
    48         {
       
    49     case EMMCScBkupOperationTypeFullBackup:
       
    50     case EMMCScBkupOperationTypePartialBackup:
       
    51         state = NextStateBackupId( type == EMMCScBkupOperationTypePartialBackup );
       
    52         break;
       
    53     case EMMCScBkupOperationTypeFullRestore:
       
    54     case EMMCScBkupOperationTypePartialRestore:
       
    55         state = NextStateRestoreId( type == EMMCScBkupOperationTypePartialRestore );
       
    56         break;
       
    57     default:
       
    58         ASSERT( EFalse );
       
    59         break;
       
    60         }
       
    61     //
       
    62     return state;
       
    63     }
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // CMMCScBkupStateOpAware::PerformAsynchronousStateStepBackupL()
       
    68 // 
       
    69 // 
       
    70 // ---------------------------------------------------------------------------
       
    71 void CMMCScBkupStateOpAware::PerformAsynchronousStateStepBackupL( TBool /*aPartial*/ )
       
    72     {
       
    73     }
       
    74 
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CMMCScBkupStateOpAware::PerformAsynchronousStateStepRestoreL()
       
    78 // 
       
    79 // 
       
    80 // ---------------------------------------------------------------------------
       
    81 void CMMCScBkupStateOpAware::PerformAsynchronousStateStepRestoreL( TBool /*aPartial*/ )
       
    82     {
       
    83     }
       
    84 
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CMMCScBkupStateOpAware::PerformAsynchronousCancellationBackup()
       
    88 // 
       
    89 // 
       
    90 // ---------------------------------------------------------------------------
       
    91 void CMMCScBkupStateOpAware::PerformAsynchronousCancellationBackup( TBool /*aPartial*/ )
       
    92     {
       
    93     }
       
    94 
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // CMMCScBkupStateOpAware::PerformAsynchronousCancellationRestore()
       
    98 // 
       
    99 // 
       
   100 // ---------------------------------------------------------------------------
       
   101 void CMMCScBkupStateOpAware::PerformAsynchronousCancellationRestore( TBool /*aPartial*/ )
       
   102     {
       
   103     }
       
   104 
       
   105 
       
   106 // ---------------------------------------------------------------------------
       
   107 // CMMCScBkupStateOpAware::PerformLastRightsBackupL()
       
   108 // 
       
   109 // 
       
   110 // ---------------------------------------------------------------------------
       
   111 void CMMCScBkupStateOpAware::PerformLastRightsBackupL( TBool /*aPartial*/ )
       
   112     {
       
   113     }
       
   114 
       
   115 
       
   116 // ---------------------------------------------------------------------------
       
   117 // CMMCScBkupStateOpAware::PerformLastRightsRestoreL()
       
   118 // 
       
   119 // 
       
   120 // ---------------------------------------------------------------------------
       
   121 void CMMCScBkupStateOpAware::PerformLastRightsRestoreL( TBool /*aPartial*/ )
       
   122     {
       
   123     }
       
   124 
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // CMMCScBkupStateOpAware::PerformAsynchronousErrorCleanupBackup()
       
   128 // 
       
   129 // 
       
   130 // ---------------------------------------------------------------------------
       
   131 TBool CMMCScBkupStateOpAware::PerformAsynchronousErrorCleanupBackup( TBool /*aPartial*/, TInt /*aError*/ )
       
   132     {
       
   133     return EFalse;
       
   134     }
       
   135 
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // CMMCScBkupStateOpAware::PerformAsynchronousErrorCleanupRestore()
       
   139 // 
       
   140 // 
       
   141 // ---------------------------------------------------------------------------
       
   142 TBool CMMCScBkupStateOpAware::PerformAsynchronousErrorCleanupRestore( TBool /*aPartial*/, TInt /*aError*/ )
       
   143     {
       
   144     return EFalse;
       
   145     }
       
   146 
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CMMCScBkupStateOpAware::PerformStateInitL()
       
   150 // 
       
   151 // 
       
   152 // ---------------------------------------------------------------------------
       
   153 void CMMCScBkupStateOpAware::PerformStateInitL()
       
   154     {
       
   155     const TMMCScBkupOperationType type = Driver().DrvOperation();
       
   156     switch(type)
       
   157         {
       
   158     case EMMCScBkupOperationTypeFullBackup:
       
   159     case EMMCScBkupOperationTypePartialBackup:
       
   160         PerformStateInitBackupL( type == EMMCScBkupOperationTypePartialBackup );
       
   161         break;
       
   162     case EMMCScBkupOperationTypeFullRestore:
       
   163     case EMMCScBkupOperationTypePartialRestore:
       
   164         PerformStateInitRestoreL( type == EMMCScBkupOperationTypePartialRestore );
       
   165         break;
       
   166     default:
       
   167         ASSERT( EFalse );
       
   168         break;
       
   169         }
       
   170     }
       
   171 
       
   172 
       
   173 // ---------------------------------------------------------------------------
       
   174 // CMMCScBkupStateOpAware::PerformAsynchronousStateStepL()
       
   175 // 
       
   176 // 
       
   177 // ---------------------------------------------------------------------------
       
   178 void CMMCScBkupStateOpAware::PerformAsynchronousStateStepL()
       
   179     {
       
   180     const TMMCScBkupOperationType type = Driver().DrvOperation();
       
   181     switch(type)
       
   182         {
       
   183     case EMMCScBkupOperationTypeFullBackup:
       
   184     case EMMCScBkupOperationTypePartialBackup:
       
   185         PerformAsynchronousStateStepBackupL( type == EMMCScBkupOperationTypePartialBackup );
       
   186         break;
       
   187     case EMMCScBkupOperationTypeFullRestore:
       
   188     case EMMCScBkupOperationTypePartialRestore:
       
   189         PerformAsynchronousStateStepRestoreL( type == EMMCScBkupOperationTypePartialRestore );
       
   190         break;
       
   191     default:
       
   192         ASSERT( EFalse );
       
   193         break;
       
   194         }
       
   195     }
       
   196 
       
   197 
       
   198 // ---------------------------------------------------------------------------
       
   199 // CMMCScBkupStateOpAware::PerformAsynchronousCancellation()
       
   200 // 
       
   201 // 
       
   202 // ---------------------------------------------------------------------------
       
   203 void CMMCScBkupStateOpAware::PerformAsynchronousCancellation()
       
   204     {
       
   205     const TMMCScBkupOperationType type = Driver().DrvOperation();
       
   206     switch(type)
       
   207         {
       
   208     case EMMCScBkupOperationTypeFullBackup:
       
   209     case EMMCScBkupOperationTypePartialBackup:
       
   210         PerformAsynchronousCancellationBackup( type == EMMCScBkupOperationTypePartialBackup );
       
   211         break;
       
   212     case EMMCScBkupOperationTypeFullRestore:
       
   213     case EMMCScBkupOperationTypePartialRestore:
       
   214         PerformAsynchronousCancellationRestore( type == EMMCScBkupOperationTypePartialRestore );
       
   215         break;
       
   216     default:
       
   217         ASSERT( EFalse );
       
   218         break;
       
   219         }
       
   220     }
       
   221 
       
   222 
       
   223 // ---------------------------------------------------------------------------
       
   224 // CMMCScBkupStateOpAware::PerformLastRightsL()
       
   225 // 
       
   226 // 
       
   227 // ---------------------------------------------------------------------------
       
   228 void CMMCScBkupStateOpAware::PerformLastRightsL()
       
   229     {
       
   230     const TMMCScBkupOperationType type = Driver().DrvOperation();
       
   231     switch(type)
       
   232         {
       
   233     case EMMCScBkupOperationTypeFullBackup:
       
   234     case EMMCScBkupOperationTypePartialBackup:
       
   235         PerformLastRightsBackupL( type == EMMCScBkupOperationTypePartialBackup );
       
   236         break;
       
   237     case EMMCScBkupOperationTypeFullRestore:
       
   238     case EMMCScBkupOperationTypePartialRestore:
       
   239         PerformLastRightsRestoreL( type == EMMCScBkupOperationTypePartialRestore );
       
   240         break;
       
   241     default:
       
   242         ASSERT( EFalse );
       
   243         break;
       
   244         }
       
   245     }
       
   246 
       
   247 
       
   248 // ---------------------------------------------------------------------------
       
   249 // CMMCScBkupStateOpAware::PerformAsynchronousErrorCleanup()
       
   250 // 
       
   251 // 
       
   252 // ---------------------------------------------------------------------------
       
   253 TBool CMMCScBkupStateOpAware::PerformAsynchronousErrorCleanup( TInt aError )
       
   254     {
       
   255     TBool handled = EFalse;
       
   256     //
       
   257     const TMMCScBkupOperationType type = Driver().DrvOperation();
       
   258     switch(type)
       
   259         {
       
   260     case EMMCScBkupOperationTypeFullBackup:
       
   261     case EMMCScBkupOperationTypePartialBackup:
       
   262         handled = PerformAsynchronousErrorCleanupBackup( type == EMMCScBkupOperationTypePartialBackup, aError );
       
   263         break;
       
   264     case EMMCScBkupOperationTypeFullRestore:
       
   265     case EMMCScBkupOperationTypePartialRestore:
       
   266         handled = PerformAsynchronousErrorCleanupRestore( type == EMMCScBkupOperationTypePartialRestore, aError );
       
   267         break;
       
   268     default:
       
   269         ASSERT( EFalse );
       
   270         break;
       
   271         }
       
   272     //
       
   273     return handled;
       
   274     }
       
   275