homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp
branchRCL_3
changeset 64 b276298d5729
parent 59 a0713522ab97
equal deleted inserted replaced
59:a0713522ab97 64:b276298d5729
    21 #include <apgtask.h>
    21 #include <apgtask.h>
    22 #include <vwsdef.h>
    22 #include <vwsdef.h>
    23 #include <eikenv.h>
    23 #include <eikenv.h>
    24 #include <eikappui.h>
    24 #include <eikappui.h>
    25 #include <liwvariant.h>
    25 #include <liwvariant.h>
    26 #include <gfxtranseffect/gfxtranseffect.h>      
       
    27 #include <akntranseffect.h>
       
    28 
    26 
    29 #include "ahproperties.hrh"
    27 #include "ahproperties.hrh"
    30 #include "ahpapplauncher.h"
    28 #include "ahpapplauncher.h"
    31 
    29 
    32 // ======== MEMBER FUNCTIONS ========
    30 // ======== MEMBER FUNCTIONS ========
   106     TInt errCode(KErrArgument);
   104     TInt errCode(KErrArgument);
   107     TUid appUid= TUid::Null( );
   105     TUid appUid= TUid::Null( );
   108 
   106 
   109     if ( !ExtractUidL( aMap, appUid, KApplicationUid ) )
   107     if ( !ExtractUidL( aMap, appUid, KApplicationUid ) )
   110         {
   108         {
   111         TApaTaskList taskList( iEnv->WsSession() );       
   109         // app not yet running
   112         TApaTask task = taskList.FindApp( appUid );
   110         RApaLsSession appSession;
   113         if ( task.Exists( ) )
   111         CleanupClosePushL( appSession );
   114             {
   112         User::LeaveIfError( appSession.Connect( ) );
   115             GfxTransEffect::BeginFullScreen( 
   113 
   116                 AknTransEffect::EApplicationStart,
   114         CApaCommandLine* cmd = CApaCommandLine::NewLC( );
   117                 TRect(), 
   115         cmd->SetCommandL( GetCommandL( aMap ) );
   118                 AknTransEffect::EParameterType, 
   116         RBuf documentNameValue;
   119                 AknTransEffect::GfxTransParam( appUid,
   117         CleanupClosePushL( documentNameValue );
   120                 AknTransEffect::TParameter::EActivateExplicitContinue ));
   118         if( !ExtractDesL( aMap, documentNameValue, KDocumentName ) )
   121             
   119             {
   122             errCode = KErrNone;
   120             cmd->SetDocumentNameL( documentNameValue );
   123             task.BringToForeground();
   121             }
   124             }
   122         TApaAppInfo appInfo;
   125         else
   123         appSession.GetAppInfo( appInfo, appUid );
   126             {
   124         cmd->SetExecutableNameL( appInfo.iFullName );
   127             // app not yet running
   125         errCode = appSession.StartApp( *cmd );
   128             RApaLsSession appSession;
   126 
   129             CleanupClosePushL( appSession );
   127         CleanupStack::PopAndDestroy( &documentNameValue );
   130             User::LeaveIfError( appSession.Connect( ) );
   128         CleanupStack::PopAndDestroy( cmd );
   131     
   129         CleanupStack::PopAndDestroy( &appSession );
   132             CApaCommandLine* cmd = CApaCommandLine::NewLC( );
   130         }
   133             cmd->SetCommandL( GetCommandL( aMap ) );
   131 
   134             RBuf documentNameValue;
       
   135             CleanupClosePushL( documentNameValue );
       
   136             if( !ExtractDesL( aMap, documentNameValue, KDocumentName ) )
       
   137                 {
       
   138                 cmd->SetDocumentNameL( documentNameValue );
       
   139                 }
       
   140             TApaAppInfo appInfo;
       
   141             appSession.GetAppInfo( appInfo, appUid );
       
   142             cmd->SetExecutableNameL( appInfo.iFullName );
       
   143             errCode = appSession.StartApp( *cmd );
       
   144     
       
   145             CleanupStack::PopAndDestroy( &documentNameValue );
       
   146             CleanupStack::PopAndDestroy( cmd );
       
   147             CleanupStack::PopAndDestroy( &appSession );
       
   148             }
       
   149         }
       
   150     return errCode;
   132     return errCode;
   151     }
   133     }
   152 
   134 
   153 // ---------------------------------------------------------------------------
   135 // ---------------------------------------------------------------------------
   154 // Executes provided apa message action
   136 // Executes provided apa message action