homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp
changeset 4 1a2a00e78665
parent 0 79c6a41cd166
child 12 502e5d91ad42
equal deleted inserted replaced
3:ff572005ac23 4:1a2a00e78665
   240         }
   240         }
   241     //SETACTIVEPLUGIN
   241     //SETACTIVEPLUGIN
   242     else if( aCmdName.CompareF( KSetActivePlugin ) == 0 )
   242     else if( aCmdName.CompareF( KSetActivePlugin ) == 0 )
   243         {
   243         {
   244         TRAP( err, SetActivePluginL( aInParamList, aOutParamList ) );
   244         TRAP( err, SetActivePluginL( aInParamList, aOutParamList ) );
       
   245         }
       
   246     else if ( aCmdName.CompareF( KRestoreConfigurations ) == 0 )
       
   247         {
       
   248         TRAP( err, RestoreConfigurationsL( aInParamList, aOutParamList ) );
   245         }
   249         }
   246     //UNKNOWN COMMAND
   250     //UNKNOWN COMMAND
   247     else
   251     else
   248         {
   252         {
   249         // Invalid command
   253         // Invalid command
  1157     // Create output parameters
  1161     // Create output parameters
  1158     CHspsLiwUtilities::SetActivePluginOutputL( aOutParamList );
  1162     CHspsLiwUtilities::SetActivePluginOutputL( aOutParamList );
  1159 
  1163 
  1160     }
  1164     }
  1161 
  1165 
       
  1166 
       
  1167 // -----------------------------------------------------------------------------
       
  1168 // Restores plugin configurations when the client has panicked
       
  1169 // -----------------------------------------------------------------------------
       
  1170 //
       
  1171 void CHSPSConfigurationIf::RestoreConfigurationsL( 
       
  1172     const CLiwGenericParamList& aInParamList, 
       
  1173     CLiwGenericParamList& aOutParamList )
       
  1174     {                
       
  1175     // Get restore parameter
       
  1176     const TLiwGenericParam* inParam;
       
  1177     TInt pos = 0;
       
  1178     
       
  1179     inParam = aInParamList.FindFirst( 
       
  1180         pos, 
       
  1181         KHspsLiwRestore );    
       
  1182     if ( !inParam )
       
  1183         {
       
  1184         // Manadatory parameter missing
       
  1185         User::Leave( KErrArgument );
       
  1186         }
       
  1187     
       
  1188     TLiwVariant inParamVariant = inParam->Value();
       
  1189     TPtrC8 restore( inParamVariant.AsData() );
       
  1190     
       
  1191     TBool restoreAll = EFalse;            
       
  1192     if( restore.CompareF( KHspsLiwRestoreAll ) == 0 )
       
  1193         {
       
  1194         restoreAll = ETrue;
       
  1195         }
       
  1196     else if( restore.CompareF( KHspsLiwRestoreActive ) != 0 )
       
  1197         {
       
  1198         User::Leave( KErrArgument );
       
  1199         }           
       
  1200     
       
  1201     // Get client application's uid
       
  1202     TInt appUid;
       
  1203     iHspsConfigurationService->GetAppUidL( appUid );
       
  1204         
       
  1205     iHspsPersonalisationService->RestoreConfigurationsL( appUid, restoreAll );
       
  1206 
       
  1207     // Invalidate ODT.
       
  1208     iHspsConfigurationService->InvalidateODT();
       
  1209     
       
  1210     // Create output parameters
       
  1211     CHspsLiwUtilities::RestoreConfigurationsOutputL( aOutParamList );
       
  1212     }
       
  1213 
  1162 // ======== GLOBAL FUNCTIONS ===================================================
  1214 // ======== GLOBAL FUNCTIONS ===================================================
  1163 
  1215 
  1164 
  1216 
  1165 // End of file
  1217 // End of file