idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp
branchRCL_3
changeset 25 137ebc85284b
parent 17 b8fae6b8a148
child 31 89165693e770
equal deleted inserted replaced
23:7be2816dbabd 25:137ebc85284b
    66 _LIT8( KIndex, "position" );
    66 _LIT8( KIndex, "position" );
    67 _LIT8( KConfState, "state" );
    67 _LIT8( KConfState, "state" );
    68 _LIT8( KRequestNotification, "RequestNotification" );
    68 _LIT8( KRequestNotification, "RequestNotification" );
    69 _LIT8( KHSPSCommandRestoreConfigurations, "RestoreConfigurations" );
    69 _LIT8( KHSPSCommandRestoreConfigurations, "RestoreConfigurations" );
    70 _LIT8( KRestore, "restore" );
    70 _LIT8( KRestore, "restore" );
    71 _LIT8( KActive, "active" );
    71 _LIT8( KRestoreDefault, "default" );
    72 _LIT8( KAll, "all" );
    72 _LIT8( KRestoreRom, "rom" );
       
    73 _LIT8( KRestoreViews, "views" );
    73 _LIT8( K0, "0" );
    74 _LIT8( K0, "0" );
    74 _LIT8( K1, "1" );
    75 _LIT8( K1, "1" );
    75 _LIT8( KPluginIdNotSet, "-1" );
    76 _LIT8( KPluginIdNotSet, "-1" );
    76 const TInt KMaxPluginIdLen = 32;
    77 const TInt KMaxPluginIdLen = 32;
    77 
    78 
   783     }
   784     }
   784 
   785 
   785 // ---------------------------------------------------------------------------
   786 // ---------------------------------------------------------------------------
   786 // ---------------------------------------------------------------------------
   787 // ---------------------------------------------------------------------------
   787 //
   788 //
   788 EXPORT_C TInt CHspsWrapper::RestoreRootL()
   789 EXPORT_C TInt CHspsWrapper::RestoreViewsL()
   789     {
   790     {
   790     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
   791     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
   791     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
   792     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
   792          
   793          
   793     // Compose Liw message
   794     // Compose Liw message
   794     TLiwGenericParam restoreTypeParam;
   795     TLiwGenericParam restoreTypeParam;
   795     restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KAll ) );
   796     restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KRestoreViews ) );
   796     restoreTypeParam.PushL();
   797     restoreTypeParam.PushL();
   797     inParamList.AppendL( restoreTypeParam );
   798     inParamList.AppendL( restoreTypeParam );
   798     CleanupStack::Pop( &restoreTypeParam );
   799     CleanupStack::Pop( &restoreTypeParam );
   799     restoreTypeParam.Reset();
   800     restoreTypeParam.Reset();
   800       
   801       
   819     }
   820     }
   820 
   821 
   821 // ---------------------------------------------------------------------------
   822 // ---------------------------------------------------------------------------
   822 // ---------------------------------------------------------------------------
   823 // ---------------------------------------------------------------------------
   823 //
   824 //
   824 EXPORT_C TInt CHspsWrapper::RestoreDefaultConfL()
   825 EXPORT_C TInt CHspsWrapper::RestoreRomConfL()
   825     {
   826     {
   826     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
   827     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
   827     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
   828     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
   828          
   829          
   829     // Compose Liw message
   830     // Compose Liw message
   830     TLiwGenericParam restoreTypeParam;
   831     TLiwGenericParam restoreTypeParam;
   831     restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KActive ) );
   832     restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KRestoreRom ) );
       
   833     restoreTypeParam.PushL();
       
   834     inParamList.AppendL( restoreTypeParam );
       
   835     CleanupStack::Pop( &restoreTypeParam );
       
   836     restoreTypeParam.Reset();
       
   837       
       
   838     iHspsInterface->ExecuteCmdL( KHSPSCommandRestoreConfigurations, 
       
   839                                  inParamList, 
       
   840                                  outParamList ); 
       
   841       
       
   842     inParamList.Reset();
       
   843       
       
   844     // check success
       
   845     const TLiwGenericParam* outParam = NULL;
       
   846     TInt pos(0);
       
   847     outParam = outParamList.FindFirst( pos, KOutKeyStatus );
       
   848     TInt status(KErrGeneral);
       
   849     
       
   850     if ( outParam )
       
   851         {
       
   852         status = outParam->Value().AsTInt32();
       
   853         }
       
   854     outParamList.Reset();
       
   855     return status;
       
   856     }
       
   857 
       
   858 // ---------------------------------------------------------------------------
       
   859 // ---------------------------------------------------------------------------
       
   860 //
       
   861 EXPORT_C TInt CHspsWrapper::RestoreDefaultConfL()
       
   862     {
       
   863     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
       
   864     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
       
   865          
       
   866     // Compose Liw message
       
   867     TLiwGenericParam restoreTypeParam;
       
   868     restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KRestoreDefault ) );
   832     restoreTypeParam.PushL();
   869     restoreTypeParam.PushL();
   833     inParamList.AppendL( restoreTypeParam );
   870     inParamList.AppendL( restoreTypeParam );
   834     CleanupStack::Pop( &restoreTypeParam );
   871     CleanupStack::Pop( &restoreTypeParam );
   835     restoreTypeParam.Reset();
   872     restoreTypeParam.Reset();
   836       
   873