idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp
branchRCL_3
changeset 31 8baec10861af
parent 30 a5a39a295112
equal deleted inserted replaced
30:a5a39a295112 31:8baec10861af
    28 #include <vwsdef.h>                 // For TVwsViewId
    28 #include <vwsdef.h>                 // For TVwsViewId
    29 #include <mcsmenuutils.h>
    29 #include <mcsmenuutils.h>
    30 #include <mcsmenuitem.h>
    30 #include <mcsmenuitem.h>
    31 #include <mcspluginparamval.h>
    31 #include <mcspluginparamval.h>
    32 #include <LogsUiCmdStarter.h>
    32 #include <LogsUiCmdStarter.h>
       
    33 #include <APGCLI.H>
    33 
    34 
    34 // User includes
    35 // User includes
    35 #include "mcsplugincompletedoperation.h"
    36 #include "mcsplugincompletedoperation.h"
    36 #include "mcspluginhandler.h"
    37 #include "mcspluginhandler.h"
    37 #include "mcspluginuids.hrh"
    38 #include "mcspluginuids.hrh"
    38 
    39 
    39 // Constants
    40 // Constants
    40 _LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type.
    41 _LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type.
    41 _LIT( KMenuAttrParamLogs, "logs:dialed" );
    42 _LIT( KMenuAttrParamLogs, "logs:dialed" );
       
    43 _LIT( KMenuAttrProfiles, "profiles" );
    42 
    44 
    43 /** Argument value for parameter*/
    45 /** Argument value for parameter*/
    44 _LIT( KMenuAttrParam, "param" );
    46 _LIT( KMenuAttrParam, "param" );
       
    47 
       
    48 const TUid KProfilesAppUid = { 0x100058F8 };
    45 
    49 
    46 #define KMCSCmailUidValue 0x2001E277
    50 #define KMCSCmailUidValue 0x2001E277
    47 #define KMCSCmailMailboxDefaultViewIdValue 0x1
    51 #define KMCSCmailMailboxDefaultViewIdValue 0x1
    48 #define KMCSCmailMailboxViewIdValue 0x2
    52 #define KMCSCmailMailboxViewIdValue 0x2
    49 #define KMCSCmailMtmUidValue 0x2001F406
    53 #define KMCSCmailMtmUidValue 0x2001F406
   246         }
   250         }
   247     else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound )
   251     else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound )
   248         {
   252         {
   249         LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() );
   253         LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() );
   250         }
   254         }
       
   255     else if ( param.Find( KMenuAttrProfiles ) != KErrNotFound )
       
   256         {
       
   257         RApaLsSession apaLsSession;
       
   258         User::LeaveIfError( apaLsSession.Connect() );
       
   259         CleanupClosePushL( apaLsSession );
       
   260 
       
   261         TApaAppInfo appInfo;
       
   262         TInt retVal = apaLsSession.GetAppInfo( appInfo, KProfilesAppUid );
       
   263 
       
   264         if ( retVal == KErrNone )
       
   265             {
       
   266             CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
       
   267             cmdLine->SetExecutableNameL( appInfo.iFullName );
       
   268             cmdLine->SetCommandL( EApaCommandRun );
       
   269             User::LeaveIfError( apaLsSession.StartApp( *cmdLine ) );
       
   270 
       
   271             CleanupStack::PopAndDestroy( cmdLine );
       
   272             }
       
   273 
       
   274         CleanupStack::PopAndDestroy( &apaLsSession );
       
   275         }
   251     CleanupStack::PopAndDestroy( sendUi );
   276     CleanupStack::PopAndDestroy( sendUi );
   252     }
   277     }
   253 
   278 
   254 // ---------------------------------------------------------------------------
   279 // ---------------------------------------------------------------------------
   255 // Returns count of Email accounts
   280 // Returns count of Email accounts