idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp
branchRCL_3
changeset 9 f966699dea19
parent 1 5315654608de
child 12 9674c1a575e9
--- a/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp	Tue Feb 02 00:04:13 2010 +0200
+++ b/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp	Fri Feb 19 22:42:37 2010 +0200
@@ -65,6 +65,10 @@
 _LIT8( KIndex, "position" );
 _LIT8( KConfState, "state" );
 _LIT8( KRequestNotification, "RequestNotification" );
+_LIT8( KHSPSCommandRestoreConfigurations, "RestoreConfigurations" );
+_LIT8( KRestore, "restore" );
+_LIT8( KActive, "active" );
+_LIT8( KAll, "all" );
 
 namespace hspswrapper{
 
@@ -754,7 +758,79 @@
     outParamList.Reset();
     return status;
     }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CHspsWrapper::RestoreActiveViewL()
+    {
+    CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
+    CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
+         
+    // Compose Liw message
+    TLiwGenericParam restoreTypeParam;
+    restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KActive ) );
+    restoreTypeParam.PushL();
+    inParamList.AppendL( restoreTypeParam );
+    CleanupStack::Pop( &restoreTypeParam );
+    restoreTypeParam.Reset();
+      
+    iHspsInterface->ExecuteCmdL( KHSPSCommandRestoreConfigurations, 
+                                 inParamList, 
+                                 outParamList ); 
+      
+    inParamList.Reset();
+      
+    // check success
+    const TLiwGenericParam* outParam = NULL;
+    TInt pos(0);
+    outParam = outParamList.FindFirst( pos, KOutKeyStatus );
+    TInt status(KErrGeneral);
     
+    if ( outParam )
+        {
+        status = outParam->Value().AsTInt32();
+        }
+    outParamList.Reset();
+    return status;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CHspsWrapper::RestoreRootL()
+    {
+    CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
+    CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
+         
+    // Compose Liw message
+    TLiwGenericParam restoreTypeParam;
+    restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KAll ) );
+    restoreTypeParam.PushL();
+    inParamList.AppendL( restoreTypeParam );
+    CleanupStack::Pop( &restoreTypeParam );
+    restoreTypeParam.Reset();
+      
+    iHspsInterface->ExecuteCmdL( KHSPSCommandRestoreConfigurations, 
+                                 inParamList, 
+                                 outParamList ); 
+      
+    inParamList.Reset();
+      
+    // check success
+    const TLiwGenericParam* outParam = NULL;
+    TInt pos(0);
+    outParam = outParamList.FindFirst( pos, KOutKeyStatus );
+    TInt status(KErrGeneral);
+    
+    if ( outParam )
+        {
+        status = outParam->Value().AsTInt32();
+        }
+    outParamList.Reset();
+    return status;
+    }
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //