idlefw/plugins/shortcutplugin/src/caiscuttargetapp.cpp
branchRCL_3
changeset 9 d0529222e3f0
parent 4 1a2a00e78665
child 10 5ef93ea513cb
child 18 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Class for application shortcut target
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <coemain.h>            // For CCoeEnv
       
    20 #include <w32std.h>             // For RWsSession
       
    21 #include <akntranseffect.h>
       
    22 #include <akntransitionutils.h>
       
    23 #include <apacmdln.h>           // For CApaCommandLine
       
    24 #include <apgtask.h>            // For TApaTaskList
       
    25 #include <apgwgnam.h>           // For CApaWindowGroupName
       
    26 #include <gulicon.h>            // For CGulIcon
       
    27 #include <AknsUtils.h>          // For AknsUtils
       
    28 #include <AknTaskList.h>        // For CAknTaskList
       
    29 #include <gfxtranseffect/gfxtranseffect.h>		// For Transition effect
       
    30 #include <gslauncher.h>
       
    31 #include <viewcli.h>            // For CVwsSessionWrapper
       
    32 #include <escapeutils.h>
       
    33 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    34 #include <viewclipartner.h>
       
    35 #endif
       
    36 
       
    37 #include <featmgr.h>
       
    38 #include <centralrepository.h>
       
    39 #include <e32property.h>
       
    40 #include <settingsinternalcrkeys.h>
       
    41 #include <UikonInternalPSKeys.h>
       
    42 
       
    43 #include <aiscuttexts.rsg>
       
    44 //#include <pslnactiveidleplugin.mbg>
       
    45 #include <data_caging_path_literals.hrh>
       
    46 
       
    47 #include <activeidle2domainpskeys.h>
       
    48 
       
    49 #include "aiscutcontentmodel.h"
       
    50 #include "caiscuttargetapp.h"
       
    51 #include "caiscutengine.h"
       
    52 
       
    53 #include <aiscutplugin.mbg>
       
    54 #include "debug.h"
       
    55 
       
    56 #include <AknSgcc.h>
       
    57 
       
    58 const TInt KIconSizeArray = 4;
       
    59 
       
    60 // ======== MEMBER FUNCTIONS =================================================
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 CAiScutTargetApp::CAiScutTargetApp(
       
    67     CAiScutEngine& aEngine, TShortcutType aType, const TUid aUid)
       
    68     : CAiScutTarget(aEngine, aType)
       
    69     , iAppUid(aUid)
       
    70     {
       
    71     }
       
    72 
       
    73 
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 void CAiScutTargetApp::ConstructL(const TAiScutParser& aParser)
       
    79     {
       
    80     iDefinition = aParser.Get(EScutDefComplete).AllocL();
       
    81 
       
    82     iViewUid.iUid = -1;
       
    83 
       
    84     switch (Type())
       
    85         {
       
    86     case EScutApplicationView:
       
    87     case EScutChangeTheme:
       
    88         if (iAppUid == KScutAppShellUid)
       
    89             {
       
    90             iViewUid.iUid = 1; // activate always appshell main view.
       
    91             }
       
    92         else
       
    93             {
       
    94             iViewUid = TAiScutParser::ParseUid(aParser.Get(EScutDefParamValue));
       
    95             }
       
    96         break;
       
    97 
       
    98     case EScutLogsMissedCallsView:
       
    99         iMsg = TPtrC8(KLogsMissedCallsView).AllocL();
       
   100         break;
       
   101 
       
   102     case EScutLogsDialledCallsView:
       
   103         iMsg = TPtrC8(KLogsDialledCallsView).AllocL();
       
   104         break;
       
   105 
       
   106     case EScutLogsReceivedCallsView:
       
   107         iMsg = TPtrC8(KLogsReceivedCallsView).AllocL();
       
   108         break;
       
   109 
       
   110     case EScutLogsMainView:
       
   111         iMsg = TPtrC8(KLogsMainView).AllocL();
       
   112         break;
       
   113 
       
   114     case EScutApplicationWithParams:
       
   115         {
       
   116         TPtrC ptr = aParser.Get(EScutDefParamNameAndValue);
       
   117         iMsg = EscapeUtils::ConvertFromUnicodeToUtf8L(ptr);
       
   118         break;
       
   119         }
       
   120 
       
   121     default:
       
   122         break;
       
   123         }
       
   124 
       
   125     }
       
   126 
       
   127 
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 // ---------------------------------------------------------------------------
       
   131 //
       
   132 CAiScutTargetApp* CAiScutTargetApp::NewL(
       
   133     CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser)
       
   134     {
       
   135     CAiScutTargetApp* self =
       
   136         new (ELeave) CAiScutTargetApp(aEngine, aType, aParser.Uid());
       
   137 
       
   138     CleanupStack::PushL(self);
       
   139     self->ConstructL(aParser);
       
   140 
       
   141     CleanupStack::Pop(self);
       
   142 
       
   143     return self;
       
   144     }
       
   145 
       
   146 
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 // ---------------------------------------------------------------------------
       
   150 //
       
   151 CAiScutTargetApp::~CAiScutTargetApp()
       
   152     {
       
   153     delete iCaption;
       
   154     delete iShortCaption;
       
   155 	delete iMsg;
       
   156     delete iDefinition;
       
   157     }
       
   158 
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // Returns the shortcut definition string.
       
   162 // ---------------------------------------------------------------------------
       
   163 //
       
   164 TPtrC CAiScutTargetApp::Definition() const
       
   165     {
       
   166     return iDefinition ? TPtrC(*iDefinition) : TPtrC();
       
   167     }
       
   168 
       
   169 
       
   170 // ---------------------------------------------------------------------------
       
   171 // Returns the shortcut target caption.
       
   172 // ---------------------------------------------------------------------------
       
   173 //
       
   174 TInt CAiScutTargetApp::GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const
       
   175     {
       
   176     TRAP_IGNORE(GetCaptionL(aTitleType));
       
   177 
       
   178     if (aTitleType == EAiScutSkeyTitle)
       
   179         {
       
   180         aDes.Set(iShortCaption ? *iShortCaption : KNullDesC());
       
   181         }
       
   182     else
       
   183         {
       
   184         aDes.Set(iCaption ? *iCaption : KNullDesC());
       
   185         }
       
   186 
       
   187     return 0;
       
   188     }
       
   189 
       
   190 // ---------------------------------------------------------------------------
       
   191 // Returns the shortcut target caption.
       
   192 // ---------------------------------------------------------------------------
       
   193 //
       
   194 void CAiScutTargetApp::GetCaptionL(TAiScutAppTitleType aTitleType) const
       
   195     {
       
   196     TApaAppInfo appInfo;
       
   197 
       
   198     // Use lazy evaluation, create the caption only when it is first needed.
       
   199     if (aTitleType == EAiScutSkeyTitle)
       
   200         {
       
   201         if( !iShortCaption )
       
   202             {
       
   203             iEngine.ApaSession().GetAppInfo(appInfo, iAppUid);
       
   204             iShortCaption = appInfo.iShortCaption.AllocL();            
       
   205             }
       
   206         }
       
   207     else
       
   208         {
       
   209         if (!iCaption)
       
   210             {
       
   211             iEngine.ApaSession().GetAppInfo(appInfo, iAppUid);
       
   212             iCaption = appInfo.iCaption.AllocL();
       
   213             }
       
   214         }
       
   215     }
       
   216 
       
   217 // ---------------------------------------------------------------------------
       
   218 // Returns the shortcut target icon.
       
   219 // ---------------------------------------------------------------------------
       
   220 //
       
   221 TInt CAiScutTargetApp::GetIcon(CGulIcon*& aIcon) const
       
   222     {
       
   223     // First try to make the override icon
       
   224     // if not successful then do it ourself
       
   225     if ( CAiScutTarget::GetIcon(aIcon) != KErrNone )
       
   226         {
       
   227         TRAP_IGNORE(CreateAppIconL(aIcon));
       
   228         }
       
   229 
       
   230 
       
   231     return 0;
       
   232     }
       
   233 
       
   234 // ---------------------------------------------------------------------------
       
   235 // Returns the shortcut target icon for toolbar.
       
   236 // ---------------------------------------------------------------------------
       
   237 //
       
   238 TInt CAiScutTargetApp::GetToolbarIcon(CGulIcon*& aIcon) const
       
   239     {
       
   240     if ( CAiScutTarget::GetToolbarIcon(aIcon) != KErrNone)
       
   241         {
       
   242         TRAP_IGNORE(CreateAppIconL(aIcon));
       
   243         }
       
   244 
       
   245     return 0;
       
   246     }
       
   247 
       
   248 // ---------------------------------------------------------------------------
       
   249 // Creates the application icon.
       
   250 // ---------------------------------------------------------------------------
       
   251 //
       
   252 
       
   253 void CAiScutTargetApp::CreateAppIconL(CGulIcon*& aIcon) const
       
   254     {
       
   255     // To make sure we won't end up with a partially created icon, we first create
       
   256     // a temporary icon and take it into use only when it is propertly initialized.
       
   257     CGulIcon* tempIcon = NULL;
       
   258     TInt err = KErrNone;
       
   259 
       
   260     // If no scalable icon support is available then the icon is constructed the "old way"
       
   261     // java icon separately from the native icon. If the support is available then the
       
   262     // java icon is constructed the same way the native icon is constructed.
       
   263 
       
   264     const TBool isNonNative = iEngine.IsNonNative(iAppUid);
       
   265 
       
   266     // First try to create a normal non-native icon
       
   267     if (isNonNative)
       
   268         {
       
   269         TRAP(err,
       
   270             tempIcon = CreateNonNativeIconL()
       
   271             );
       
   272         // Just to be sure
       
   273         if (err != KErrNone)
       
   274             {
       
   275             tempIcon = NULL;
       
   276             }
       
   277         }
       
   278     // No icon yet so either native icon or non-native SVG icon.
       
   279     if (!tempIcon)
       
   280         {
       
   281         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   282         if ((iAppUid == KScutPersonalisationUid && iViewUid == KScutChangeThemeViewId)
       
   283          || (iAppUid == KScutGeneralSettingsUid && (iViewUid == KScutInstallationViewId
       
   284                                ||  iViewUid == KScutConnectivityViewId))
       
   285           )
       
   286           {
       
   287           tempIcon = CreateSubstituteIconL(skin, iAppUid, iViewUid);
       
   288           }
       
   289     else
       
   290       {
       
   291           CFbsBitmap* bitmap = NULL;
       
   292           CFbsBitmap* mask   = NULL;
       
   293 
       
   294         AknsUtils::CreateAppIconLC(skin, iAppUid, EAknsAppIconTypeList, bitmap, mask);
       
   295         if (bitmap)
       
   296           {
       
   297         tempIcon = CGulIcon::NewL(bitmap, mask);
       
   298         CleanupStack::Pop(2);   // Bitmap and mask. They have to be popped out by number
       
   299                                     // because the order in which they are pushed in is undefined.
       
   300         }
       
   301 
       
   302           }
       
   303 
       
   304     }
       
   305 
       
   306     aIcon = tempIcon;
       
   307   }
       
   308 
       
   309 
       
   310 CGulIcon* CAiScutTargetApp::CreateSubstituteIconL( MAknsSkinInstance* aSkin, TUid aAppUid, TUid iViewUid ) const
       
   311   {
       
   312   CGulIcon* tempIcon = NULL;
       
   313   TParse* parse = new (ELeave) TParse;
       
   314     CleanupStack::PushL(parse);
       
   315     parse->Set(KBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
       
   316     HBufC* fileName = parse->FullName().AllocLC();
       
   317   TPtr fileNamePtr = fileName->Des();
       
   318 
       
   319   //change idle theme
       
   320   if (aAppUid == KScutPersonalisationUid && iViewUid == KScutChangeThemeViewId)
       
   321       {
       
   322       tempIcon = AknsUtils::CreateGulIconL(
       
   323           aSkin,
       
   324           KAknsIIDQgnPropPslnAiSub,
       
   325           fileNamePtr,
       
   326             EMbmAiscutpluginQgn_prop_psln_ai_sub,
       
   327           EMbmAiscutpluginQgn_prop_psln_ai_sub_mask);
       
   328       }
       
   329     //appmngr
       
   330     else if(aAppUid == KScutGeneralSettingsUid && iViewUid == KScutInstallationViewId)
       
   331       {
       
   332       CFbsBitmap* bitmap = NULL;
       
   333       CFbsBitmap* mask   = NULL;
       
   334 
       
   335     AknsUtils::CreateAppIconLC(aSkin, KScutAppMngrUid, EAknsAppIconTypeList, bitmap, mask);
       
   336     
       
   337     // The icon may reside in cache so we need to exclude in order
       
   338     // for updated icons to be loaded properly.
       
   339     AknIconUtils::ExcludeFromCache( bitmap );
       
   340     if (bitmap)
       
   341       {
       
   342       tempIcon = CGulIcon::NewL(bitmap, mask);
       
   343       CleanupStack::Pop(2);   // Bitmap and mask. They have to be popped out by number
       
   344                   // because the order in which they are pushed in is undefined.
       
   345       }
       
   346       }
       
   347     //connectivity view
       
   348     else if(aAppUid == KScutGeneralSettingsUid && iViewUid == KScutConnectivityViewId)
       
   349       {
       
   350       tempIcon = AknsUtils::CreateGulIconL(
       
   351           aSkin,
       
   352           KAknsIIDQgnPropAiShortcut,
       
   353           fileNamePtr,
       
   354             EMbmAiscutpluginQgn_prop_cp_conn_shortcut,
       
   355           EMbmAiscutpluginQgn_prop_cp_conn_shortcut_mask);
       
   356       }
       
   357     else
       
   358       {
       
   359       //never should go here!
       
   360       }
       
   361 
       
   362       CleanupStack::PopAndDestroy(2, parse); // fileName, parse
       
   363       return tempIcon;
       
   364   }
       
   365 
       
   366 // ---------------------------------------------------------------------------
       
   367 // Creates the NonNative application icon.
       
   368 // ---------------------------------------------------------------------------
       
   369 //
       
   370 
       
   371 CGulIcon* CAiScutTargetApp::CreateNonNativeIconL() const
       
   372     {
       
   373     CApaMaskedBitmap* maskedbitmap = CApaMaskedBitmap::NewLC();
       
   374 
       
   375     CArrayFixFlat<TSize>* sizesArray = new (ELeave) CArrayFixFlat<TSize>(KIconSizeArray);
       
   376     CleanupStack::PushL(sizesArray);
       
   377 
       
   378     TInt err = iEngine.ApaSession().GetAppIconSizes(iAppUid, *sizesArray);
       
   379 
       
   380     // If there is no error and there is something in array
       
   381     // use first icon size and get an icon.
       
   382     if (!err && sizesArray->Count())
       
   383         {
       
   384         err = iEngine.ApaSession().GetAppIcon(iAppUid, sizesArray->At(0), *maskedbitmap);
       
   385         }
       
   386 
       
   387     // If there was an error, delete every allocated object and leave.
       
   388     if (err)
       
   389         {
       
   390         CleanupStack::PopAndDestroy(sizesArray);
       
   391         CleanupStack::PopAndDestroy(maskedbitmap);
       
   392         User::Leave(err);
       
   393         }
       
   394 
       
   395     CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
       
   396     CleanupStack::PushL(bitmap);
       
   397     CFbsBitmap* mask   = new (ELeave) CFbsBitmap();
       
   398     CleanupStack::PushL(mask);
       
   399 
       
   400     User::LeaveIfError(bitmap->Duplicate(maskedbitmap->Handle()));
       
   401     User::LeaveIfError(mask->Duplicate(maskedbitmap->Mask()->Handle()));
       
   402 
       
   403     CGulIcon* icon = CGulIcon::NewL(bitmap, mask);
       
   404     //icon->SetBitmapsOwnedExternally(ETrue);
       
   405 
       
   406     CleanupStack::Pop(mask);
       
   407     CleanupStack::Pop(bitmap);
       
   408 
       
   409     CleanupStack::PopAndDestroy(sizesArray);
       
   410     CleanupStack::PopAndDestroy(maskedbitmap);
       
   411 
       
   412     return icon;
       
   413     }
       
   414 
       
   415 // ---------------------------------------------------------------------------
       
   416 // Checks if the target application is accessible.
       
   417 // ---------------------------------------------------------------------------
       
   418 //
       
   419 TBool CAiScutTargetApp::IsAccessibleL(TInt /*aCheckType*/)
       
   420     {
       
   421     if (iAppUid == KNullUid || iEngine.IsHidden(iAppUid))
       
   422         {
       
   423         return EFalse;
       
   424         }
       
   425 
       
   426     TApaAppInfo appInfo;
       
   427     TInt ret = iEngine.ApaSession().GetAppInfo(appInfo, iAppUid);
       
   428 
       
   429     if (ret == RApaLsSession::EAppListInvalid)
       
   430         {
       
   431         // Application list not fully populated yet. Leave with KErrNotReady so
       
   432         // the engine can trap it and start the timer to check accessiblity later.
       
   433         User::Leave(KErrNotReady);
       
   434         }
       
   435 
       
   436     return (ret == KErrNone);
       
   437     }
       
   438 
       
   439 
       
   440 // ---------------------------------------------------------------------------
       
   441 //
       
   442 // ---------------------------------------------------------------------------
       
   443 //
       
   444 void CAiScutTargetApp::LaunchL()
       
   445     {
       
   446     LaunchL( KNullDesC8 );
       
   447     }
       
   448 
       
   449 // ---------------------------------------------------------------------------
       
   450 //
       
   451 // ---------------------------------------------------------------------------
       
   452 //
       
   453 void CAiScutTargetApp::LaunchL( const TDesC8& aCustomMessage )
       
   454     {
       
   455     __PRINTS( "XAI: CAiScutShortcut::LaunchL");
       
   456     __PRINT( __DBG_FORMAT("XAI:   type = %d"), Type());
       
   457 
       
   458     if (iAppUid != KNullUid)
       
   459         {
       
   460 
       
   461         // Some special cases
       
   462         // ---------------------------------
       
   463         if( Type() == EScutApplicationView &&
       
   464             iAppUid == KScutGeneralSettingsUid )
       
   465             {
       
   466             CGSLauncher* l = CGSLauncher::NewLC();
       
   467             l->LaunchGSViewL ( iViewUid,
       
   468                                KScutActiveIdleUid,
       
   469                                aCustomMessage );            
       
   470             CleanupStack::PopAndDestroy( l );
       
   471             
       
   472             return;    
       
   473             }
       
   474         else if ( ( ( Type() == EScutChangeTheme) && ( iAppUid == KScutPersonalisationUid ) ) ||  // For AI2 Themes
       
   475                   ( iAppUid == KScutDiallerUid ) )                                                // Dialer
       
   476             {
       
   477             const TVwsViewId viewId(iAppUid, iViewUid);
       
   478             TUid msgId = KScutGeneralSettingsUid;
       
   479             
       
   480             if( iAppUid == KScutDiallerUid ) 
       
   481                 {
       
   482                 msgId = KScutDiallerViewCommand;
       
   483                 RProperty::Set(KPSUidAiInformation, KActiveIdleState, EPSAiNumberEntry );
       
   484                 }
       
   485 
       
   486             TInt err = iEngine.VwsSession()->CreateActivateViewEvent( viewId, msgId, aCustomMessage );
       
   487 
       
   488             return;
       
   489             }
       
   490 
       
   491         TBool         exists = EFalse;
       
   492 
       
   493         CAknTaskList* taskList = CAknTaskList::NewL(iEngine.Env()->WsSession());
       
   494         TApaTask      task(taskList->FindRootApp(iAppUid));
       
   495         delete        taskList;
       
   496 
       
   497         exists = task.Exists();
       
   498 
       
   499         // If not found, try again little harder
       
   500         // ----------------------------------------
       
   501         if (!exists)
       
   502             {
       
   503             RWsSession wsSession = iEngine.Env()->WsSession();
       
   504             task.SetWgId(0);                // Set task to non-existant task
       
   505             TInt wgId=0;
       
   506             CApaWindowGroupName::FindByAppUid(iAppUid, wsSession, wgId);
       
   507 
       
   508             if (wgId != KErrNotFound)
       
   509                 {
       
   510                 exists = ETrue;
       
   511             task.SetWgId(wgId);
       
   512                 }
       
   513             }
       
   514 
       
   515         // Actual reactivatio / starting
       
   516         // -----------------------------
       
   517         if (exists)       // Found, reactivate
       
   518             {
       
   519             if (iMsg && iMsg->Length())
       
   520                 {
       
   521                 task.SendMessage(KNullUid, *iMsg);
       
   522                 }
       
   523             if ( iAppUid == KScutAppShellUid ) // AppShell effect is an exception
       
   524             	{
       
   525             	//start different fullscreen effect when launching appshell
       
   526             	GfxTransEffect::BeginFullScreen( AknTransEffect::EApplicationActivate ,
       
   527             			TRect(0,0,0,0),
       
   528             	        AknTransEffect::EParameterType,
       
   529             	        AknTransEffect::GfxTransParam( iAppUid,
       
   530             	        AknTransEffect::TParameter::EActivateExplicitContinue ) );        
       
   531             	}
       
   532             
       
   533             if( iAppUid == KScutAppShellUid ) // Appshell starting is an exception
       
   534                 {
       
   535                 task.SendMessage( KUidApaMessageSwitchOpenFile , KNullDesC8 );
       
   536                 }
       
   537             else
       
   538                 {
       
   539                 // If message was sent, don't try to bring task to foreground as task will do it itself
       
   540                 if ( !( (iAppUid == KScutLogsUid) && (iMsg && iMsg->Length() > 0)) )
       
   541                     {
       
   542                     CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToForeground);
       
   543                     }
       
   544                 }
       
   545             }
       
   546         else             // Not exists, starting
       
   547             {
       
   548             TApaAppInfo appInfo;
       
   549 
       
   550             if (iEngine.ApaSession().GetAppInfo(appInfo, iAppUid) == KErrNone)
       
   551                 {
       
   552                 if (FeatureManager::FeatureSupported(KFeatureIdCommonVoip) &&
       
   553                     (iAppUid == KScutEasyVoIPApplicationUid) )
       
   554                     {
       
   555                     SetEasyVoIPShortcutStartL();
       
   556                     }
       
   557 
       
   558                 CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
       
   559                 cmdLine->SetExecutableNameL(appInfo.iFullName);
       
   560                 if (iMsg && iMsg->Length())
       
   561                     {
       
   562                     cmdLine->SetCommandL(EApaCommandRun);
       
   563                     cmdLine->SetTailEndL(*iMsg);
       
   564                     }
       
   565                 if (iBackground)
       
   566                     {
       
   567                     cmdLine->SetCommandL(EApaCommandBackground);
       
   568                     }
       
   569                 if ( iAppUid == KScutVoiceDialUid )
       
   570                 	{
       
   571                 	cmdLine ->SetCommandL( EApaCommandRunWithoutViews );
       
   572                 	}
       
   573 
       
   574                 TInt err = iEngine.ApaSession().StartApp(*cmdLine);
       
   575 
       
   576 
       
   577                 __PRINT( __DBG_FORMAT("XAI:   StartApp err = %d"), err);
       
   578 
       
   579                 User::LeaveIfError(err);
       
   580 
       
   581                 CleanupStack::PopAndDestroy(cmdLine);
       
   582                 }
       
   583             }
       
   584         }
       
   585     }
       
   586 
       
   587 
       
   588 // ---------------------------------------------------------------------------
       
   589 // Return application uid this target launches.
       
   590 // ---------------------------------------------------------------------------
       
   591 //
       
   592 TUid CAiScutTargetApp::AppUid() const
       
   593     {
       
   594 
       
   595 #ifdef __WEB_WIDGETS
       
   596     // for widgets return widgetapp uid.
       
   597     if (iEngine.IsWidget(iAppUid))
       
   598         {
       
   599         return KUidWidgetUi;
       
   600         }
       
   601 #endif
       
   602 
       
   603     return iAppUid;
       
   604     }
       
   605 
       
   606 // ---------------------------------------------------------------------------
       
   607 // Return the view id
       
   608 // ---------------------------------------------------------------------------
       
   609 //
       
   610 TUid CAiScutTargetApp::AdditionalUid() const
       
   611     {
       
   612     return iViewUid;
       
   613     }
       
   614 
       
   615 // ---------------------------------------------------------------------------
       
   616 // CScShortcutNativeApp::SetEasyVoIPShortcutStartL()
       
   617 //
       
   618 // Performs Central Repository shortcut set for EasyVoIP application.
       
   619 // ---------------------------------------------------------------------------
       
   620 //
       
   621 void CAiScutTargetApp::SetEasyVoIPShortcutStartL() const
       
   622     {
       
   623     CRepository* repository = CRepository::NewL(KUidEasyVoIPRepository);
       
   624     CleanupStack::PushL(repository);
       
   625 
       
   626     // Set shortcut start for EasyVoIP application.
       
   627     TInt error = repository->Set(KEasyVoIPShortcutStartup, 1);
       
   628     User::LeaveIfError(error);
       
   629 
       
   630     CleanupStack::PopAndDestroy(repository);
       
   631     }
       
   632 
       
   633 // End of File.