idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp
branchRCL_3
changeset 130 67f2ed48ad91
parent 122 6cadd6867c17
equal deleted inserted replaced
122:6cadd6867c17 130:67f2ed48ad91
    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>
       
    34 
    33 
    35 // User includes
    34 // User includes
    36 #include "mcsplugincompletedoperation.h"
    35 #include "mcsplugincompletedoperation.h"
    37 #include "mcspluginhandler.h"
    36 #include "mcspluginhandler.h"
    38 #include "mcspluginuids.hrh"
    37 #include "mcspluginuids.hrh"
    39 
    38 
    40 // Constants
    39 // Constants
    41 _LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type.
    40 _LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type.
    42 _LIT( KMenuAttrParamLogs, "logs:dialed" );
    41 _LIT( KMenuAttrParamLogs, "logs:dialed" );
    43 _LIT( KMenuAttrProfiles, "profiles" );
       
    44 
    42 
    45 /** Argument value for parameter*/
    43 /** Argument value for parameter*/
    46 _LIT( KMenuAttrParam, "param" );
    44 _LIT( KMenuAttrParam, "param" );
    47 
       
    48 const TUid KProfilesAppUid = { 0x100058F8 };
       
    49 
    45 
    50 #define KMCSCmailUidValue 0x2001E277
    46 #define KMCSCmailUidValue 0x2001E277
    51 #define KMCSCmailMailboxDefaultViewIdValue 0x1
    47 #define KMCSCmailMailboxDefaultViewIdValue 0x1
    52 #define KMCSCmailMailboxViewIdValue 0x2
    48 #define KMCSCmailMailboxViewIdValue 0x2
    53 #define KMCSCmailMtmUidValue 0x2001F406
    49 #define KMCSCmailMtmUidValue 0x2001F406
   250         }
   246         }
   251     else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound )
   247     else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound )
   252         {
   248         {
   253         LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() );
   249         LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() );
   254         }
   250         }
   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         }
       
   276     CleanupStack::PopAndDestroy( sendUi );
   251     CleanupStack::PopAndDestroy( sendUi );
   277     }
   252     }
   278 
   253 
   279 // ---------------------------------------------------------------------------
   254 // ---------------------------------------------------------------------------
   280 // Returns count of Email accounts
   255 // Returns count of Email accounts