musicplayer_plat/mpx_music_player_app_api/tsrc/ui_mpxmusicplayertest/src/ui_mpxmusicplayertestBlocks.cpp
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Cmpxmusicplayertest test class for STIF Test Framework TestScripter.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32svr.h>
       
    21 #include <badesca.h>
       
    22 #include <StifParser.h>
       
    23 #include <Stiftestinterface.h>
       
    24 
       
    25 #include <mpxtlshelper.h>
       
    26 #include "ui_mpxmusicplayertest.h"
       
    27 #include <COEAUI.H>
       
    28 #include <EIKENV.H>
       
    29 #include "edwintestcontrol.h"
       
    30 #include <mpxmediadrmdefs.h>
       
    31 #include <mpxmedia.h>
       
    32 #include <mpxattribute.h>
       
    33 #include <StringLoader.h>
       
    34 #include <mpx.rsg>
       
    35 #include <mpxmediaarray.h>
       
    36 #include <mpxmediacontainerdefs.h>
       
    37 #include <mpxcommonui.rsg>
       
    38 #include <eikbtgpc.h>
       
    39 #include <mpxinternalcrkeys.h>
       
    40 #include <APGTASK.H>
       
    41 #include <avkon.mbg>
       
    42 #include <AknIconUtils.h>
       
    43 #include <aknconsts.h>
       
    44 #include <avkon.rsg>
       
    45 #include <COEMAIN.H>
       
    46 //#include <MediaPlayer.rsg> //though it seems a little bit curious to use mediaplayer's resource 4,11,2008
       
    47 #include <mpxplaybackcommanddefs.h>
       
    48 #include <AknWaitDialog.h>
       
    49 #include <eikbtgpc.h>
       
    50 #include <eikbtgrp.h>
       
    51 #include <EIKDIALG.H>
       
    52 
       
    53 
       
    54 class CMPXMedia;
       
    55 class CMPXMediaArray;
       
    56 class CEikButtonGroupContainer;
       
    57 class TApaTaskList;
       
    58 class CCoeEnv;
       
    59 class CAknWaitDialog;
       
    60 class CEikButtonGroupContainer;
       
    61 class MEikButtonGroup;
       
    62 
       
    63 
       
    64 // ======== MEMBER FUNCTIONS ========
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Cmpxmusicplayertest::Delete
       
    68 // Delete here all resources allocated and opened from test methods.
       
    69 // Called from destructor.
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 void Cmpxmusicplayertest::Delete()
       
    73     {
       
    74 	MPXTlsHelper::Uninitialize();
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // Cmpxmusicplayertest::RunMethodL
       
    79 // Run specified method. Contains also table of test mothods and their names.
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 TInt Cmpxmusicplayertest::RunMethodL(
       
    83     CStifItemParser& aItem )
       
    84     {
       
    85 
       
    86     static TStifFunctionInfo const KFunctions[] =
       
    87         {
       
    88         // Copy this line for every implemented function.
       
    89         // First string is the function name used in TestScripter script file.
       
    90         // Second is the actual implementation member function.
       
    91         ENTRY( "Initialize", Cmpxmusicplayertest::Initialize ),
       
    92         ENTRY( "VerifyHostUid", Cmpxmusicplayertest::VerifyHostUid ),
       
    93         ENTRY( "VerifyNeedSave", Cmpxmusicplayertest::VerifyNeedSave ),
       
    94         ENTRY( "VerifyAllowMove", Cmpxmusicplayertest::VerifyAllowMove ),
       
    95         ENTRY( "VerifyLaunchMode", Cmpxmusicplayertest::VerifyLaunchMode ),
       
    96         ENTRY( "VerifyFilePath", Cmpxmusicplayertest::VerifyFilePath ),
       
    97         ENTRY( "Uninitialize", Cmpxmusicplayertest::Uninitialize ),
       
    98        
       
    99         //test functions for mpxcommonuihelper.h
       
   100         ENTRY( "CMPXCommonUiHelperNewL", Cmpxmusicplayertest::CMPXCommonUiHelperNewL ),
       
   101         ENTRY( "CMPXCommonUiHelperDestruct", Cmpxmusicplayertest::CMPXCommonUiHelperDestruct ),
       
   102         ENTRY( "UiHelperIsHostMessagingBrowserL", Cmpxmusicplayertest::UiHelperIsHostMessagingBrowserL ),
       
   103         ENTRY( "UiHelperIsHostPodcastingAppL", Cmpxmusicplayertest::UiHelperIsHostPodcastingAppL ),
       
   104         ENTRY( "UiHelperIsHostMessagingL", Cmpxmusicplayertest::UiHelperIsHostMessagingL ),
       
   105         ENTRY( "UiHelperIsHostBrowserL", Cmpxmusicplayertest::UiHelperIsHostBrowserL ),
       
   106         ENTRY( "UiHelperDisplayableDurationL", Cmpxmusicplayertest::UiHelperDisplayableDurationL ),
       
   107         ENTRY( "UiHelperDisplayableDurationInTextL", Cmpxmusicplayertest::UiHelperDisplayableDurationInTextL ),
       
   108         ENTRY( "UiHelperDoSetAsRingingToneL", Cmpxmusicplayertest::UiHelperDoSetAsRingingToneL ),
       
   109         ENTRY( "UiHelperIsProfileOfflineModeL", Cmpxmusicplayertest::UiHelperIsProfileOfflineModeL ),
       
   110         ENTRY( "UiHelperDefaultDriveLC", Cmpxmusicplayertest::UiHelperDefaultDriveLC ),
       
   111         ENTRY( "UiHelperAvailableDriveLC", Cmpxmusicplayertest::UiHelperAvailableDriveLC ),
       
   112         ENTRY( "UiHelperDisplayInfoNoteLRSCID", Cmpxmusicplayertest::UiHelperDisplayInfoNoteLRSCID ),
       
   113         ENTRY( "UiHelperDisplayInfoNoteLText", Cmpxmusicplayertest::UiHelperDisplayInfoNoteLText ),
       
   114         ENTRY( "UiHelperDisplayConfirmNoteLRSCID", Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLRSCID ),
       
   115         ENTRY( "UiHelperDisplayConfirmNoteLText", Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLText ),
       
   116         ENTRY( "UiHelperUnitConversionL", Cmpxmusicplayertest::UiHelperUnitConversionL ),
       
   117         ENTRY( "UiHelperFindPlaylistsL", Cmpxmusicplayertest::UiHelperFindPlaylistsL ),
       
   118         ENTRY( "UiHelperAddToSavedPlaylistL", Cmpxmusicplayertest::UiHelperAddToSavedPlaylistL ),
       
   119         ENTRY( "UiHelperCreatePlaylistL", Cmpxmusicplayertest::UiHelperCreatePlaylistL ),
       
   120         ENTRY( "UiHelperLaunchRenameDialogL", Cmpxmusicplayertest::UiHelperLaunchRenameDialogL ),
       
   121         ENTRY( "UiHelperShowWaitNoteL", Cmpxmusicplayertest::UiHelperShowWaitNoteL ),
       
   122         ENTRY( "UiHelperDismissWaitNoteL", Cmpxmusicplayertest::UiHelperDismissWaitNoteL ),
       
   123         ENTRY( "UiHelperHandleErrorL", Cmpxmusicplayertest::UiHelperHandleErrorL ),
       
   124         ENTRY( "UiHelperSetMiddleSoftKeyLabelL", Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyLabelL ),
       
   125         ENTRY( "UiHelperRemoveMiddleSoftKeyLabel", Cmpxmusicplayertest::UiHelperRemoveMiddleSoftKeyLabel ),
       
   126         ENTRY( "UiHelperSetMiddleSoftKeyIconL", Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyIconL ),  
       
   127         ENTRY( "UiHelperGenerateTitleL", Cmpxmusicplayertest::UiHelperGenerateTitleL ),
       
   128         ENTRY( "UiHelperExitOptionHiddenL", Cmpxmusicplayertest::UiHelperExitOptionHiddenL ),
       
   129         ENTRY( "UiHelperSetStandAloneModePId", Cmpxmusicplayertest::UiHelperSetStandAloneModePId ),
       
   130         ENTRY( "UiHelperStandAloneModePId", Cmpxmusicplayertest::UiHelperStandAloneModePId ),
       
   131         ENTRY( "UiHelperIsForegroundApplication", Cmpxmusicplayertest::UiHelperIsForegroundApplication ),
       
   132         ENTRY( "UiHelperMMCDriveNumber", Cmpxmusicplayertest::UiHelperMMCDriveNumber ),
       
   133         ENTRY( "UiHelperCancelCollectionOperation", Cmpxmusicplayertest::UiHelperCancelCollectionOperation ),
       
   134         
       
   135         };
       
   136 
       
   137     const TInt count = sizeof( KFunctions ) /
       
   138                         sizeof( TStifFunctionInfo );
       
   139 
       
   140     return RunInternalL( KFunctions, count, aItem );
       
   141 
       
   142     }
       
   143 
       
   144 // ---------------------------------------------------------------------------
       
   145 // Cmpxmusicplayertest::Initialize
       
   146 // ?implementation_description
       
   147 // (other items were commented in a header).
       
   148 // ---------------------------------------------------------------------------
       
   149 //
       
   150 TInt Cmpxmusicplayertest::Initialize( CStifItemParser& /*aItem*/ )
       
   151     {
       
   152     iLog->Log(_L("Cmpxmusicplayertest::Initialize"));
       
   153     TRAPD( err , MPXTlsHelper::InitializeL());
       
   154     if ( err != KErrNone )
       
   155     	{
       
   156     	iLog->Log(_L("InitializeL returned: %d"), err);
       
   157     	}
       
   158     return err;
       
   159     }
       
   160 // ---------------------------------------------------------------------------
       
   161 // Cmpxmusicplayertest::Uninitialize
       
   162 // ?implementation_description
       
   163 // (other items were commented in a header).
       
   164 // ---------------------------------------------------------------------------
       
   165 //
       
   166 TInt Cmpxmusicplayertest::Uninitialize( CStifItemParser& /*aItem*/ )
       
   167     {
       
   168     iLog->Log(_L("Cmpxmusicplayertest::Uninitialize"));
       
   169     TInt err = KErrNone;
       
   170     MPXTlsHelper::Uninitialize();
       
   171     if ( err != KErrNone )
       
   172     	{
       
   173     	iLog->Log(_L("Uninitialize returned: %d"), err);
       
   174     	}
       
   175     return err;
       
   176     }
       
   177 
       
   178 // ---------------------------------------------------------------------------
       
   179 // Cmpxmusicplayertest::VerifyHostUid
       
   180 // ?implementation_description
       
   181 // (other items were commented in a header).
       
   182 // ---------------------------------------------------------------------------
       
   183 //
       
   184 TInt Cmpxmusicplayertest::VerifyHostUid( CStifItemParser& aItem )
       
   185     {
       
   186     iLog->Log(_L("Cmpxmusicplayertest::VerifyHostUid"));
       
   187     TInt err = KErrNone;
       
   188     TPtrC string;
       
   189 	if ( KErrNone == aItem.GetNextString(string) )
       
   190 		{
       
   191 		if ( string == KTagKErrNone )
       
   192 			{
       
   193 			TRAP( err , MPXTlsHelper::SetHostUidL(KHostUid));
       
   194 			if ( err == KErrNone )
       
   195 				{
       
   196 				if ( KHostUid == MPXTlsHelper::HostUid() )
       
   197 					{
       
   198 					iLog->Log(_L("Host Uid match!"));
       
   199 					}
       
   200 				else
       
   201 					{
       
   202 					iLog->Log(_L("ERROR: Host Uid doesn't match!"));
       
   203 					err = KErrGeneral;
       
   204 					}
       
   205 				}
       
   206 			else
       
   207 				{
       
   208 				iLog->Log(_L("SetHostUidL returned: %d"), err);
       
   209 				}
       
   210 			}
       
   211 		else if ( string == KTagKErrNotReady )
       
   212 			{
       
   213 			TRAP( err , MPXTlsHelper::SetHostUidL(KHostUid));
       
   214 			if ( err == KErrNotReady )
       
   215 				{
       
   216 				err = KErrNone;
       
   217 				}
       
   218 			else
       
   219 				{
       
   220 				iLog->Log(_L("ERROR: %d"), err);
       
   221 				}
       
   222 			}
       
   223 		else
       
   224 			{
       
   225 			iLog->Log(_L("Bad parameter on config file"));
       
   226 			err = KErrBadTestParameter;
       
   227 			}
       
   228 		}
       
   229 	else
       
   230 		{
       
   231 		iLog->Log(_L("Bad parameter on config file"));
       
   232 		err = KErrBadTestParameter;
       
   233 		}
       
   234 
       
   235     return err;
       
   236     }
       
   237 
       
   238 // ---------------------------------------------------------------------------
       
   239 // Cmpxmusicplayertest::VerifyNeedSave
       
   240 // ?implementation_description
       
   241 // (other items were commented in a header).
       
   242 // ---------------------------------------------------------------------------
       
   243 //
       
   244 TInt Cmpxmusicplayertest::VerifyNeedSave( CStifItemParser& /*aItem*/ )
       
   245     {
       
   246     iLog->Log(_L("Cmpxmusicplayertest::VerifyNeedSave"));
       
   247     MPXTlsHelper::SetNeedSave(EFalse);
       
   248     if ( MPXTlsHelper::NeedSave() )
       
   249     	{
       
   250     	iLog->Log(_L("ERROR: Flag doesn't match! - true"));
       
   251     	return KErrGeneral;
       
   252     	}
       
   253 
       
   254     MPXTlsHelper::SetNeedSave(ETrue);
       
   255     if ( !MPXTlsHelper::NeedSave() )
       
   256     	{
       
   257     	iLog->Log(_L("ERROR: Flag doesn't match! - false"));
       
   258     	return KErrGeneral;
       
   259     	}
       
   260 
       
   261     return KErrNone;
       
   262     }
       
   263 
       
   264 // ---------------------------------------------------------------------------
       
   265 // Cmpxmusicplayertest::VerifyAllowMove
       
   266 // ?implementation_description
       
   267 // (other items were commented in a header).
       
   268 // ---------------------------------------------------------------------------
       
   269 //
       
   270 TInt Cmpxmusicplayertest::VerifyAllowMove( CStifItemParser& /*aItem*/ )
       
   271     {
       
   272     iLog->Log(_L("Cmpxmusicplayertest::VerifyAllowMove"));
       
   273     MPXTlsHelper::SetAllowMove(EFalse);
       
   274     if ( MPXTlsHelper::AllowMove() )
       
   275     	{
       
   276     	iLog->Log(_L("ERROR: Flag doesn't match! - true"));
       
   277     	return KErrGeneral;
       
   278     	}
       
   279 
       
   280     MPXTlsHelper::SetAllowMove(ETrue);
       
   281     if ( !MPXTlsHelper::AllowMove() )
       
   282     	{
       
   283     	iLog->Log(_L("ERROR: Flag doesn't match! - false"));
       
   284     	return KErrGeneral;
       
   285     	}
       
   286 
       
   287     return KErrNone;
       
   288     }
       
   289 
       
   290 // ---------------------------------------------------------------------------
       
   291 // Cmpxmusicplayertest::VerifyLaunchMode
       
   292 // ?implementation_description
       
   293 // (other items were commented in a header).
       
   294 // ---------------------------------------------------------------------------
       
   295 //
       
   296 TInt Cmpxmusicplayertest::VerifyLaunchMode( CStifItemParser& aItem )
       
   297     {
       
   298     iLog->Log(_L("Cmpxmusicplayertest::VerifyLaunchMode"));
       
   299     TInt err = KErrNone;
       
   300     TPtrC string;
       
   301 	if ( KErrNone == aItem.GetNextString(string) )
       
   302 		{
       
   303 		if ( string == KTagKErrNone )
       
   304 			{
       
   305 			TRAP( err , MPXTlsHelper::SetLaunchModeL(EMPXLaunchModePlaying));
       
   306 			if ( err == KErrNone )
       
   307 				{
       
   308 				if ( EMPXLaunchModePlaying == MPXTlsHelper::LaunchMode() )
       
   309 					{
       
   310 					iLog->Log(_L("Launch mode match!"));
       
   311 					}
       
   312 				else
       
   313 					{
       
   314 					iLog->Log(_L("ERROR: Launch mode doesn't match!"));
       
   315 					err = KErrGeneral;
       
   316 					}
       
   317 				}
       
   318 			else
       
   319 				{
       
   320 				iLog->Log(_L("SetLaunchModeL returned: %d"), err);
       
   321 				}
       
   322 			}
       
   323 		else if ( string == KTagKErrNotReady )
       
   324 			{
       
   325 			TRAP( err , MPXTlsHelper::SetLaunchModeL(EMPXLaunchModePlaying));
       
   326 			if ( err == KErrNotReady )
       
   327 				{
       
   328 				err = KErrNone;
       
   329 				}
       
   330 			else
       
   331 				{
       
   332 				iLog->Log(_L("ERROR: %d"), err);
       
   333 				}
       
   334 			}
       
   335 		else
       
   336 			{
       
   337 			iLog->Log(_L("Bad parameter on config file"));
       
   338 			err = KErrBadTestParameter;
       
   339 			}
       
   340 		}
       
   341 	else
       
   342 		{
       
   343 		iLog->Log(_L("Bad parameter on config file"));
       
   344 		err = KErrBadTestParameter;
       
   345 		}
       
   346 
       
   347     return err;
       
   348     }
       
   349 
       
   350 // ---------------------------------------------------------------------------
       
   351 // Cmpxmusicplayertest::VerifyFilePath
       
   352 // ?implementation_description
       
   353 // (other items were commented in a header).
       
   354 // ---------------------------------------------------------------------------
       
   355 //
       
   356 TInt Cmpxmusicplayertest::VerifyFilePath( CStifItemParser& /*aItem*/ )
       
   357     {
       
   358     iLog->Log(_L("Cmpxmusicplayertest::VerifyFilePath"));
       
   359     TInt err = KErrNone;
       
   360     TBuf<120> KPath;
       
   361     KPath.Append(_L("Cmpxmusicplayertest"));
       
   362 
       
   363     MPXTlsHelper::SetFilePath(KPath);
       
   364     if ( KPath == MPXTlsHelper::FilePath() )
       
   365     	{
       
   366     	iLog->Log(_L("File path match!"));
       
   367     	}
       
   368     else
       
   369     	{
       
   370     	iLog->Log(_L("ERROR: File path doesn't match!"));
       
   371     	err = KErrGeneral;
       
   372     	}
       
   373 
       
   374     return err;
       
   375     }
       
   376 
       
   377 // ---------------------------------------------------------------------------
       
   378 // Cmpxmusicplayertest::CMPXCommonUiHelperNewL
       
   379 // ?implementation_description
       
   380 // (other items were commented in a header).
       
   381 // ---------------------------------------------------------------------------
       
   382 //
       
   383 TInt Cmpxmusicplayertest::CMPXCommonUiHelperNewL( CStifItemParser& /*aItem*/ )
       
   384     {
       
   385     iLog->Log(_L("Cmpxmusicplayertest::CMPXCommonUiHelperNewL"));
       
   386     TInt err = KErrNone;    
       
   387     iUtilityForUiHelper=MMPXCollectionUtility::NewL();
       
   388     TRAP(err,iUiHelper = CMPXCommonUiHelper::NewL(iUtilityForUiHelper));
       
   389     if ( err == KErrNone )
       
   390     	{
       
   391     	iLog->Log(_L("Creation of CMPXCommonUiHelper succeeds!"));
       
   392     	}
       
   393     else
       
   394     	{
       
   395     	iLog->Log(_L("ERROR: Creation of CMPXCommonUiHelper fails!%d returns!"),err);
       
   396     	}
       
   397     return err;
       
   398     }
       
   399 // ---------------------------------------------------------------------------
       
   400 // Cmpxmusicplayertest::CMPXCommonUiHelperDestruct
       
   401 // ?implementation_description
       
   402 // (other items were commented in a header).
       
   403 // ---------------------------------------------------------------------------
       
   404 //
       
   405 TInt Cmpxmusicplayertest::CMPXCommonUiHelperDestruct( CStifItemParser& /*aItem*/ )
       
   406     {
       
   407 	TInt err = KErrNone;  
       
   408     if(iUiHelper)
       
   409     	{
       
   410     	delete iUiHelper;
       
   411     	iUiHelper=NULL;
       
   412     	    if(iUtilityForUiHelper)
       
   413     	    	{
       
   414 			    	iUtilityForUiHelper->Close();
       
   415 			    	iUtilityForUiHelper=NULL;
       
   416     	    	}
       
   417     	}
       
   418     else
       
   419     	{
       
   420     	iLog->Log(_L("Cmpxmusicplayertest::CMPXCommonUiHelperDestruct"));  
       
   421     	TRAP(err,iUtilityForUiHelper=MMPXCollectionUtility::NewL());
       
   422     	TRAP(err,iUiHelper = CMPXCommonUiHelper::NewL(iUtilityForUiHelper) );
       
   423     	TRAP(err,delete iUiHelper);
       
   424     	iUiHelper=NULL;
       
   425     	iUtilityForUiHelper->Close();
       
   426     	iUtilityForUiHelper=NULL;
       
   427     	if ( err == KErrNone )
       
   428     		{
       
   429     		iLog->Log(_L("CMPXCommonUiHelperDestruct succeeds!"));
       
   430     		}
       
   431     	else
       
   432     		{
       
   433     		iLog->Log(_L("ERROR:CMPXCommonUiHelperDestruct fails!%d returns!"),err);
       
   434     		}
       
   435     	}
       
   436     return err;
       
   437     }
       
   438 // ---------------------------------------------------------------------------
       
   439 // Cmpxmusicplayertest::UiHelperIsHostMessagingBrowserL
       
   440 // ?implementation_description
       
   441 // (other items were commented in a header).
       
   442 // ---------------------------------------------------------------------------
       
   443 //
       
   444 TInt Cmpxmusicplayertest::UiHelperIsHostMessagingBrowserL( CStifItemParser& /*aItem*/ )
       
   445     {
       
   446     iLog->Log(_L("Cmpxmusicplayertest::UiHelperIsHostMessagingBrowserL"));
       
   447     TInt err = KErrNone;  
       
   448     TBool isHostMessagingBrowser;
       
   449     TRAP(err,isHostMessagingBrowser=iUiHelper->IsHostMessagingBrowserL());
       
   450     if(err==KErrNone)
       
   451     	{
       
   452     	if(isHostMessagingBrowser)
       
   453     		{
       
   454     		iLog->Log(_L("UiHelperIsHostMessagingBrowserL succeeds with TBool ETrue returned!"));
       
   455     		}
       
   456     	else
       
   457     		{
       
   458     		iLog->Log(_L("UiHelperIsHostMessagingBrowserL succeeds with TBool EFalse returned!"));
       
   459     		}
       
   460     	}
       
   461     else
       
   462     	{
       
   463     	iLog->Log(_L("UiHelperIsHostMessagingBrowserL fails!%d returns!"),err);
       
   464     	}
       
   465     return err;
       
   466     }
       
   467 // ---------------------------------------------------------------------------
       
   468 // Cmpxmusicplayertest::UiHelperIsHostPodcastingAppL
       
   469 // ?implementation_description
       
   470 // (other items were commented in a header).
       
   471 // ---------------------------------------------------------------------------
       
   472 //
       
   473 TInt Cmpxmusicplayertest::UiHelperIsHostPodcastingAppL( CStifItemParser& /*aItem*/ )
       
   474     {
       
   475     iLog->Log(_L("Cmpxmusicplayertest::UiHelperIsHostPodcastingAppL"));
       
   476     TInt err = KErrNone;  
       
   477     TBool isHostPodcastingApp;
       
   478     TRAP( err , isHostPodcastingApp=iUiHelper->IsHostPodcastingAppL());
       
   479     if(err == KErrNone)
       
   480     	{
       
   481     	if(isHostPodcastingApp)
       
   482     		{
       
   483     		iLog->Log(_L("UiHelperIsHostPodcastingAppL succeeds with TBool ETrue returned!"));
       
   484     		}
       
   485     	else
       
   486     		{
       
   487     		iLog->Log(_L("UiHelperIsHostPodcastingAppL succeeds with TBool EFalse returned!"));
       
   488     		}
       
   489     	}
       
   490     else
       
   491     	{
       
   492     	iLog->Log(_L("UiHelperIsHostPodcastingAppL fails!%d returns!"),err);
       
   493     	}
       
   494     return err;
       
   495     }
       
   496 // ---------------------------------------------------------------------------
       
   497 // Cmpxmusicplayertest::UiHelperIsHostMessagingL
       
   498 // ?implementation_description
       
   499 // (other items were commented in a header).
       
   500 // ---------------------------------------------------------------------------
       
   501 //
       
   502 TInt Cmpxmusicplayertest::UiHelperIsHostMessagingL( CStifItemParser& /*aItem*/ )
       
   503     {
       
   504     iLog->Log(_L("Cmpxmusicplayertest::UiHelperIsHostMessagingL"));
       
   505     TInt err = KErrNone;  
       
   506     TBool isHostMessaging;
       
   507     TRAP( err , isHostMessaging=iUiHelper->IsHostMessagingL());
       
   508     if(err==KErrNone)
       
   509     	{
       
   510     	if(isHostMessaging)
       
   511     		{
       
   512     		iLog->Log(_L("UiHelperIsHostMessagingL succeeds with TBool ETrue returned!"));
       
   513     		}
       
   514     	else
       
   515     		{
       
   516     		iLog->Log(_L("UiHelperIsHostMessagingL succeeds with TBool EFalse returned!"));
       
   517     		}
       
   518     	}
       
   519     else
       
   520     	{
       
   521     	iLog->Log(_L("UiHelperIsHostMessagingL fails!%d returns!"),err);
       
   522     	}
       
   523     return err;
       
   524     }
       
   525 // ---------------------------------------------------------------------------
       
   526 // Cmpxmusicplayertest::UiHelperIsHostBrowserL
       
   527 // ?implementation_description
       
   528 // (other items were commented in a header).
       
   529 // ---------------------------------------------------------------------------
       
   530 //
       
   531 TInt Cmpxmusicplayertest::UiHelperIsHostBrowserL( CStifItemParser& /*aItem*/ )
       
   532     {
       
   533     iLog->Log(_L("Cmpxmusicplayertest::UiHelperIsHostBrowserL"));
       
   534     TInt err = KErrNone;  
       
   535     TBool isHostBrowser;
       
   536     TRAP( err , isHostBrowser=iUiHelper->IsHostBrowserL());
       
   537     if( err == KErrNone )
       
   538     	{
       
   539     	if( isHostBrowser )
       
   540     		{
       
   541     		iLog->Log(_L("UiHelperIsHostBrowserL succeeds with TBool ETrue returned!"));
       
   542     		}
       
   543     	else
       
   544     		{
       
   545     		iLog->Log(_L("UiHelperIsHostBrowserL succeeds with TBool EFalse returned!"));
       
   546     		}
       
   547     	}
       
   548     else
       
   549     	{
       
   550     	iLog->Log(_L("UiHelperIsHostBrowserL fails!%d returns!"),err);
       
   551     	}
       
   552     return err;
       
   553     }
       
   554 // ---------------------------------------------------------------------------
       
   555 // Cmpxmusicplayertest::UiHelperDisplayableDurationL
       
   556 // ?implementation_description
       
   557 // (other items were commented in a header).
       
   558 // ---------------------------------------------------------------------------
       
   559 //
       
   560 TInt Cmpxmusicplayertest::UiHelperDisplayableDurationL( CStifItemParser& /*aItem*/ )
       
   561     {
       
   562     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDisplayableDurationL"));
       
   563     TInt err = KErrNone;    
       
   564     TInt64 duration=100;
       
   565     HBufC* recievedDuration;
       
   566     TRAP( err , recievedDuration = iUiHelper->DisplayableDurationL(duration));
       
   567     delete recievedDuration;
       
   568     if ( err == KErrNone )
       
   569     	{
       
   570     	iLog->Log(_L("UiHelperDisplayableDurationL succeeds!"));
       
   571     	}
       
   572     else
       
   573     	{
       
   574     	iLog->Log(_L("ERROR:UiHelperDisplayableDurationL fails!%d returns!"),err);
       
   575     	}
       
   576     return err;
       
   577     }
       
   578 // ---------------------------------------------------------------------------
       
   579 // Cmpxmusicplayertest::UiHelperDisplayableDurationInTextL
       
   580 // ?implementation_description
       
   581 // (other items were commented in a header).
       
   582 // ---------------------------------------------------------------------------
       
   583 //
       
   584 TInt Cmpxmusicplayertest::UiHelperDisplayableDurationInTextL( CStifItemParser& /*aItem*/ )
       
   585     {
       
   586     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDisplayableDurationInTextL"));
       
   587     TInt err = KErrNone;    
       
   588     TInt64 duration=1000000;
       
   589     HBufC* recievedDuration;
       
   590     TRAP( err , recievedDuration=iUiHelper->DisplayableDurationInTextL(duration));
       
   591     delete recievedDuration;
       
   592     if ( err == KErrNone )
       
   593     	{
       
   594     	iLog->Log(_L("UiHelperDisplayableDurationInTextL succeeds!"));
       
   595     	}
       
   596     else
       
   597     	{
       
   598     	iLog->Log(_L("ERROR:UiHelperDisplayableDurationInTextL fails!%d returns!"),err);
       
   599     	}
       
   600     return err;
       
   601     }
       
   602 // ---------------------------------------------------------------------------
       
   603 // Cmpxmusicplayertest::UiHelperDoSetAsRingingToneL
       
   604 // ?implementation_description
       
   605 // (other items were commented in a header).
       
   606 // ---------------------------------------------------------------------------
       
   607 //
       
   608 TInt Cmpxmusicplayertest::UiHelperDoSetAsRingingToneL( CStifItemParser& aItem )
       
   609     {
       
   610     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDoSetAsRingingToneL"));
       
   611     TInt err = KErrNone;    
       
   612     CMPXMedia* media=CMPXMedia::NewL();
       
   613     CleanupStack::PushL(media);
       
   614     media->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralUri )       ,EMPXSong);
       
   615     media->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle)      ,EMPXSong);
       
   616     media->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdDrm,     EMPXMediaDrmProtected )     ,EMPXSong);
       
   617     media->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdDrm,     EMPXMediaDrmRightsStatus )  ,EMPXSong);
       
   618     media->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdDrm,     EMPXMediaDrmCanSetAutomated),EMPXSong);
       
   619     TPtrC string;
       
   620     if ( KErrNone == aItem.GetNextString(string) )
       
   621     	{
       
   622     	TBuf<120> ringToneFileName;
       
   623     	ringToneFileName.Append(KRingToneFilePath);
       
   624     	ringToneFileName.Append(string);
       
   625     	media->SetTextValueL( KMPXMediaGeneralUri, ringToneFileName );
       
   626     	}
       
   627     else
       
   628     	{
       
   629     	media->SetTextValueL( KMPXMediaGeneralUri, KRingToneFileName );
       
   630     	}   
       
   631     TRAP( err , iUiHelper->DoSetAsRingingToneL(*media,EFalse));
       
   632     CleanupStack::PopAndDestroy(media);
       
   633     if ( err == KErrNone )
       
   634     	{
       
   635     	iLog->Log(_L("UiHelperDoSetAsRingingToneL succeeds!"));
       
   636     	}
       
   637     else
       
   638     	{
       
   639     	iLog->Log(_L("ERROR:UiHelperDoSetAsRingingToneL fails!%d returns!"),err);
       
   640     	}
       
   641     return err;
       
   642     }
       
   643 // ---------------------------------------------------------------------------
       
   644 // Cmpxmusicplayertest::UiHelperIsProfileOfflineModeL
       
   645 // ?implementation_description
       
   646 // (other items were commented in a header).
       
   647 // ---------------------------------------------------------------------------
       
   648 //
       
   649 TInt Cmpxmusicplayertest::UiHelperIsProfileOfflineModeL( CStifItemParser& /*aItem*/ )
       
   650     {
       
   651     iLog->Log(_L("Cmpxmusicplayertest::UiHelperIsProfileOfflineModeL"));
       
   652     TInt err = KErrNone;    
       
   653     TBool isOfflineMode;
       
   654     TRAP( err , isOfflineMode=iUiHelper->IsProfileOfflineModeL());
       
   655     if ( err == KErrNone )
       
   656     	{
       
   657     	if(isOfflineMode)
       
   658     		{
       
   659     		iLog->Log(_L("UiHelperIsProfileOfflineModeL succeeds with TBool ETrue returned!"));
       
   660     		}
       
   661     	else
       
   662     		{
       
   663     		iLog->Log(_L("UiHelperIsProfileOfflineModeL succeeds with TBool EFalse returned!"));
       
   664     		}
       
   665     	}
       
   666     else
       
   667     	{
       
   668     	iLog->Log(_L("ERROR:UiHelperIsProfileOfflineModeL fails!%d returns!"),err);
       
   669     	}
       
   670     return err;
       
   671     }
       
   672 // ---------------------------------------------------------------------------
       
   673 // Cmpxmusicplayertest::UiHelperDefaultDriveLC
       
   674 // ?implementation_description
       
   675 // (other items were commented in a header).
       
   676 // ---------------------------------------------------------------------------
       
   677 //
       
   678 TInt Cmpxmusicplayertest::UiHelperDefaultDriveLC( CStifItemParser& /*aItem*/ )
       
   679     {
       
   680     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDefaultDriveLC"));
       
   681     TInt err = KErrNone;    
       
   682     TRAP( err , CleanupStack::PopAndDestroy(iUiHelper->DefaultDriveLC()));
       
   683     if ( err == KErrNone )
       
   684     	{    	
       
   685     	iLog->Log(_L("UiHelperDefaultDriveLC succeeds!"));   		
       
   686     	}
       
   687     else
       
   688     	{
       
   689     	iLog->Log(_L("ERROR:UiHelperDefaultDriveLC fails!%d returns!"),err);
       
   690     	}
       
   691     return err;
       
   692     }
       
   693 // ---------------------------------------------------------------------------
       
   694 // Cmpxmusicplayertest::UiHelperAvailableDriveLC
       
   695 // ?implementation_description
       
   696 // (other items were commented in a header).
       
   697 // ---------------------------------------------------------------------------
       
   698 //
       
   699 TInt Cmpxmusicplayertest::UiHelperAvailableDriveLC( CStifItemParser& /*aItem*/ )
       
   700     {
       
   701     iLog->Log(_L("Cmpxmusicplayertest::UiHelperAvailableDriveLC"));
       
   702     TInt err = KErrNone;    
       
   703     TRAP( err , CleanupStack::PopAndDestroy(iUiHelper->AvailableDriveLC(0)));   
       
   704     if ( err == KErrNone )
       
   705     	{    	
       
   706     	iLog->Log(_L("UiHelperAvailableDriveLC succeeds!"));   		
       
   707     	}
       
   708     else
       
   709     	{
       
   710     	iLog->Log(_L("ERROR:UiHelperAvailableDriveLC fails!%d returns!"),err);
       
   711     	}
       
   712     return err;
       
   713     }
       
   714 // ---------------------------------------------------------------------------
       
   715 // Cmpxmusicplayertest::UiHelperDisplayInfoNoteL
       
   716 // ?implementation_description
       
   717 // (other items were commented in a header).
       
   718 // ---------------------------------------------------------------------------
       
   719 //
       
   720 TInt Cmpxmusicplayertest::UiHelperDisplayInfoNoteLRSCID( CStifItemParser& aItem )
       
   721     {
       
   722     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDisplayInfoNoteLRSCID"));
       
   723     TInt err = KErrNone; 
       
   724     TPtrC string;
       
   725     if ( KErrNone == aItem.GetNextString(string) )
       
   726         {
       
   727         if(string==KMPXIliegalCharacters)
       
   728         	{
       
   729         	TRAP( err , iUiHelper->DisplayInfoNoteL(R_MPX_QTN_FLDR_ILLEGAL_CHARACTERS));   ;
       
   730         	}
       
   731         else if(string==KMPXFileNotFound)
       
   732         	{
       
   733         	TRAP( err , iUiHelper->DisplayInfoNoteL(R_MPX_FILE_NOT_FOUND_TEXT));   
       
   734         	}
       
   735         if ( err == KErrNone )
       
   736         	{    	
       
   737         	iLog->Log(_L("UiHelperDisplayInfoNoteLRSCID succeeds!"));   		
       
   738         	}
       
   739         else
       
   740         	{
       
   741         	iLog->Log(_L("ERROR:UiHelperDisplayInfoNoteLRSCID fails!%d returns!"),err);
       
   742         	}
       
   743         } 
       
   744     return err;
       
   745     }
       
   746 // ---------------------------------------------------------------------------
       
   747 // Cmpxmusicplayertest::UiHelperDisplayInfoNoteLText
       
   748 // ?implementation_description
       
   749 // (other items were commented in a header).
       
   750 // ---------------------------------------------------------------------------
       
   751 //
       
   752 TInt Cmpxmusicplayertest::UiHelperDisplayInfoNoteLText( CStifItemParser& aItem )
       
   753     {
       
   754     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDisplayInfoNoteLText"));
       
   755     TInt err = KErrNone; 
       
   756     TPtrC string;
       
   757     if ( KErrNone == aItem.GetNextString(string) )
       
   758         {
       
   759         if(string==KMPXIliegalCharacters)
       
   760         	{
       
   761         	_LIT(KilligalCharacters,"Name cannot contain the characters < > \\ /\" |:*?");
       
   762         	HBufC* text=HBufC::New(50);
       
   763         	(*text) = KilligalCharacters;
       
   764         	TRAP( err , iUiHelper->DisplayInfoNoteL(*text)); 
       
   765         	delete text;
       
   766         	}
       
   767         else if(string==KMPXFileNotFound)
       
   768         	{
       
   769         	_LIT(KfileNotFound,"File not found. Operation cancelled.");
       
   770         	HBufC* text=HBufC::New(40);
       
   771         	(*text) = KfileNotFound;
       
   772         	TRAP( err , iUiHelper->DisplayInfoNoteL(*text));
       
   773         	delete text;
       
   774         	}
       
   775         if ( err == KErrNone )
       
   776         	{    	
       
   777         	iLog->Log(_L("UiHelperDisplayInfoNoteLText succeeds!"));   		
       
   778         	}
       
   779         else
       
   780         	{
       
   781         	iLog->Log(_L("ERROR:UiHelperDisplayInfoNoteLText fails!%d returns!"),err);
       
   782         	}
       
   783         } 
       
   784     return err;
       
   785     }
       
   786 // ---------------------------------------------------------------------------
       
   787 // Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLRSCID
       
   788 // ?implementation_description
       
   789 // (other items were commented in a header).
       
   790 // ---------------------------------------------------------------------------
       
   791 //
       
   792 TInt Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLRSCID( CStifItemParser& aItem )
       
   793     {
       
   794     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLRSCID"));
       
   795     TInt err = KErrNone; 
       
   796     TPtrC string;
       
   797     if ( KErrNone == aItem.GetNextString(string) )
       
   798         {
       
   799         if(string==KMPXSaveToCollectionNote)
       
   800         	{
       
   801         	TRAP( err , iUiHelper->DisplayConfirmNoteL(R_MPX_SAVED_TO_COLLECTION_NOTE));   ;
       
   802         	}
       
   803         else if(string==KMPXSaveNote)
       
   804         	{
       
   805         	TRAP( err , iUiHelper->DisplayConfirmNoteL(R_MPX_SAVED_NOTE));   
       
   806         	}
       
   807         if ( err == KErrNone )
       
   808         	{    	
       
   809         	iLog->Log(_L("UiHelperDisplayConfirmNoteLRSCID succeeds!"));   		
       
   810         	}
       
   811         else
       
   812         	{
       
   813         	iLog->Log(_L("ERROR:UiHelperDisplayConfirmNoteLRSCID fails!%d returns!"),err);
       
   814         	}
       
   815         } 
       
   816     return err;
       
   817     }
       
   818 // ---------------------------------------------------------------------------
       
   819 // Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLText
       
   820 // ?implementation_description
       
   821 // (other items were commented in a header).
       
   822 // ---------------------------------------------------------------------------
       
   823 //
       
   824 TInt Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLText( CStifItemParser& aItem )
       
   825     {
       
   826     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDisplayConfirmNoteLText"));
       
   827     TInt err = KErrNone; 
       
   828     TPtrC string;
       
   829     if ( KErrNone == aItem.GetNextString(string) )
       
   830         {
       
   831         if(string==KMPXSaveToCollectionNote)
       
   832         	{
       
   833         	_LIT(KilligalCharacters,"Saved to Music library");
       
   834         	HBufC* text=HBufC::New(50);
       
   835         	(*text) = KilligalCharacters;
       
   836         	TRAP( err , iUiHelper->DisplayConfirmNoteL(*text)); 
       
   837         	delete text;
       
   838         	}
       
   839         else if(string==KMPXSaveNote)
       
   840         	{
       
   841         	_LIT(KfileNotFound,"Saved to Gallery");
       
   842         	HBufC* text=HBufC::New(40);
       
   843         	(*text) = KfileNotFound;
       
   844         	TRAP( err , iUiHelper->DisplayConfirmNoteL(*text));
       
   845         	delete text;
       
   846         	}
       
   847         if ( err == KErrNone )
       
   848         	{    	
       
   849         	iLog->Log(_L("UiHelperDisplayConfirmNoteLText succeeds!"));   		
       
   850         	}
       
   851         else
       
   852         	{
       
   853         	iLog->Log(_L("ERROR:UiHelperDisplayConfirmNoteLText fails!%d returns!"),err);
       
   854         	}
       
   855         } 
       
   856     return err;
       
   857     }
       
   858 // ---------------------------------------------------------------------------
       
   859 // Cmpxmusicplayertest::UiHelperUnitConversionL
       
   860 // ?implementation_description
       
   861 // (other items were commented in a header).
       
   862 // ---------------------------------------------------------------------------
       
   863 //
       
   864 TInt Cmpxmusicplayertest::UiHelperUnitConversionL( CStifItemParser& /*aItem*/ )
       
   865     {
       
   866     iLog->Log(_L("Cmpxmusicplayertest::UiHelperUnitConversionL"));
       
   867     TInt err = KErrNone;    
       
   868     HBufC* conversion;
       
   869     TInt64 byte=100000;
       
   870     TRAP( err , conversion=iUiHelper->UnitConversionL(byte));   
       
   871     delete conversion;
       
   872     if ( err == KErrNone )
       
   873     	{    	
       
   874     	iLog->Log(_L("UiHelperUnitConversionL succeeds!"));   		
       
   875     	}
       
   876     else
       
   877     	{
       
   878     	iLog->Log(_L("ERROR:UiHelperUnitConversionL fails!%d returns!"),err);
       
   879     	}
       
   880     return err;
       
   881     }
       
   882 // ---------------------------------------------------------------------------
       
   883 // Cmpxmusicplayertest::UiHelperFindPlaylistsL
       
   884 // ?implementation_description
       
   885 // (other items were commented in a header).
       
   886 // ---------------------------------------------------------------------------
       
   887 //
       
   888 TInt Cmpxmusicplayertest::UiHelperFindPlaylistsL( CStifItemParser& /*aItem*/ )
       
   889     {
       
   890     iLog->Log(_L("Cmpxmusicplayertest::UiHelperFindPlaylistsL"));
       
   891     TInt err = KErrNone;    
       
   892     CMPXMedia* media;
       
   893     TRAP( err , media=iUiHelper->FindPlaylistsL()); 
       
   894     delete media;
       
   895     if ( err == KErrNone )
       
   896     	{    	
       
   897     	iLog->Log(_L("UiHelperFindPlaylistsL succeeds!"));   		
       
   898     	}
       
   899     else
       
   900     	{
       
   901     	iLog->Log(_L("ERROR:UiHelperFindPlaylistsL fails!%d returns!"),err);
       
   902     	}
       
   903     return err;
       
   904     }
       
   905 // ---------------------------------------------------------------------------
       
   906 // Cmpxmusicplayertest::UiHelperAddToSavedPlaylistL
       
   907 // ?implementation_description
       
   908 // (other items were commented in a header).
       
   909 // ---------------------------------------------------------------------------
       
   910 //
       
   911 TInt Cmpxmusicplayertest::UiHelperAddToSavedPlaylistL( CStifItemParser& /*aItem*/ )
       
   912     {
       
   913     iLog->Log(_L("Cmpxmusicplayertest::UiHelperAddToSavedPlaylistL"));
       
   914     TInt err = KErrNone;  
       
   915     
       
   916     CMPXMedia* mediaPlaylist=CMPXMedia::NewL();
       
   917     CleanupStack::PushL(mediaPlaylist);
       
   918     CMPXMediaArray* mediaArrayForPlaylist=CMPXMediaArray::NewL();
       
   919     mediaPlaylist->SetCObjectValueL<CMPXMediaArray>(KMPXMediaArrayContents,mediaArrayForPlaylist);
       
   920     CMPXMedia* mediaPlaylistEntry1=CMPXMedia::NewL();
       
   921     CleanupStack::PushL(mediaPlaylistEntry1);
       
   922     mediaPlaylistEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ),EMPXSong);
       
   923     mediaPlaylistEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralId )   ,EMPXSong);
       
   924     mediaPlaylistEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralDrive ),EMPXSong);
       
   925     mediaArrayForPlaylist->AppendL(mediaPlaylistEntry1);
       
   926         
       
   927     CMPXMedia* mediaPlaylistEntry2=CMPXMedia::NewL();
       
   928     CleanupStack::PushL(mediaPlaylistEntry2);
       
   929     mediaPlaylistEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ) ,EMPXSong);
       
   930     mediaPlaylistEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralId )    ,EMPXSong);
       
   931     mediaPlaylistEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralDrive ) ,EMPXSong);
       
   932     mediaArrayForPlaylist->AppendL(mediaPlaylistEntry2);
       
   933         
       
   934     CMPXMedia* mediaTrack=CMPXMedia::NewL();
       
   935     CleanupStack::PushL(mediaTrack);
       
   936     CMPXMediaArray* mediaArrayForTrack=CMPXMediaArray::NewL();    
       
   937     mediaTrack->SetCObjectValueL<CMPXMediaArray>(KMPXMediaArrayContents,mediaArrayForTrack);
       
   938     CMPXMedia* mediaTrackEntry1=CMPXMedia::NewL();
       
   939     CleanupStack::PushL(mediaTrackEntry1);
       
   940     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralType ),    EMPXSong);
       
   941     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralCategory ),EMPXSong);
       
   942     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralId ),	  EMPXSong);  
       
   943     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ),	  EMPXSong);
       
   944     mediaArrayForTrack->AppendL(mediaTrackEntry1);
       
   945       
       
   946     CMPXMedia* mediaTrackEntry2=CMPXMedia::NewL();
       
   947     CleanupStack::PushL(mediaTrackEntry2);
       
   948     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralType ),    EMPXSong);
       
   949     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralCategory ),EMPXSong);
       
   950     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralId ),	  EMPXSong);  
       
   951     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ),	  EMPXSong);
       
   952     mediaArrayForTrack->AppendL(mediaTrackEntry2);
       
   953     
       
   954     TBool isPlaylistSaved(EFalse);
       
   955     TRAP(err,isPlaylistSaved=iUiHelper->AddToSavedPlaylistL(*mediaPlaylist,*mediaTrack,this,this));
       
   956 
       
   957     CleanupStack::Pop(mediaTrackEntry2);
       
   958     CleanupStack::Pop(mediaTrackEntry1);
       
   959     CleanupStack::PopAndDestroy(mediaTrack);
       
   960     CleanupStack::Pop(mediaPlaylistEntry2);
       
   961     CleanupStack::Pop(mediaPlaylistEntry1);
       
   962     CleanupStack::PopAndDestroy(mediaPlaylist);
       
   963     mediaPlaylist=NULL;
       
   964     delete mediaArrayForPlaylist;
       
   965     delete mediaArrayForTrack;
       
   966     mediaArrayForTrack=NULL;
       
   967 
       
   968     if ( err == KErrNone )
       
   969     	{
       
   970     	iLog->Log(_L("UiHelperAddToSavedPlaylistL succeeds!"));
       
   971     	}
       
   972     else
       
   973     	{
       
   974     	iLog->Log(_L("ERROR:UiHelperAddToSavedPlaylistL fails!%d returns!"),err);
       
   975     	}
       
   976     return err;
       
   977     }
       
   978 // ---------------------------------------------------------------------------
       
   979 // Cmpxmusicplayertest::UiHelperCreatePlaylistL
       
   980 // ?implementation_description
       
   981 // (other items were commented in a header).
       
   982 // ---------------------------------------------------------------------------
       
   983 //
       
   984 TInt Cmpxmusicplayertest::UiHelperCreatePlaylistL( CStifItemParser& /*aItem*/ )
       
   985     {
       
   986     iLog->Log(_L("Cmpxmusicplayertest::UiHelperCreatePlaylistL"));
       
   987     TInt err = KErrNone;  
       
   988          
       
   989     CMPXMedia* mediaTrack=CMPXMedia::NewL();
       
   990     CleanupStack::PushL(mediaTrack);
       
   991     CMPXMediaArray* mediaArrayForTrack=CMPXMediaArray::NewL();    
       
   992     mediaTrack->SetCObjectValueL<CMPXMediaArray>(KMPXMediaArrayContents,mediaArrayForTrack);
       
   993     CMPXMedia* mediaTrackEntry1=CMPXMedia::NewL();
       
   994     CleanupStack::PushL(mediaTrackEntry1);
       
   995     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralType ),    EMPXSong);
       
   996     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralCategory ),EMPXSong);
       
   997     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralId ),	  EMPXSong);  
       
   998     mediaTrackEntry1->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ),	  EMPXSong);
       
   999     mediaArrayForTrack->AppendL(mediaTrackEntry1);
       
  1000       
       
  1001     CMPXMedia* mediaTrackEntry2=CMPXMedia::NewL();
       
  1002     CleanupStack::PushL(mediaTrackEntry2);
       
  1003     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralType ),    EMPXSong);
       
  1004     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralCategory ),EMPXSong);
       
  1005     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralId ),	  EMPXSong);  
       
  1006     mediaTrackEntry2->SetTObjectValueL<TMPXGeneralCategory>(TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralTitle ),	  EMPXSong);
       
  1007     mediaArrayForTrack->AppendL(mediaTrackEntry2);
       
  1008 
       
  1009     TBool isPlaylistCreated = EFalse;
       
  1010     TRAP(err,isPlaylistCreated=iUiHelper->CreatePlaylistL( *mediaTrack, this, this ));
       
  1011     
       
  1012     CleanupStack::Pop(mediaTrackEntry2);
       
  1013     CleanupStack::Pop(mediaTrackEntry1);
       
  1014     CleanupStack::PopAndDestroy(mediaTrack);
       
  1015   
       
  1016     if ( err == KErrNone )
       
  1017     	{
       
  1018     	iLog->Log(_L("UiHelperCreatePlaylistL succeeds!"));
       
  1019     	}
       
  1020     else
       
  1021     	{
       
  1022     	iLog->Log(_L("ERROR:UiHelperCreatePlaylistL fails!%d returns!"),err);
       
  1023     	}
       
  1024     return err;
       
  1025     }
       
  1026 // ---------------------------------------------------------------------------
       
  1027 // Cmpxmusicplayertest::UiHelperLaunchRenameDialogL
       
  1028 // ?implementation_description
       
  1029 // (other items were commented in a header).
       
  1030 // ---------------------------------------------------------------------------
       
  1031 //
       
  1032 TInt Cmpxmusicplayertest::UiHelperLaunchRenameDialogL( CStifItemParser& aItem )
       
  1033     {
       
  1034     iLog->Log(_L("Cmpxmusicplayertest::UiHelperLaunchRenameDialogL"));
       
  1035     TInt err = KErrNone; 
       
  1036     TBuf<120> oldName;
       
  1037     TBuf<120> newName;
       
  1038     TBuf<120> path;
       
  1039     TPtrC ptrOldname;
       
  1040     TPtrC ptrNewname;
       
  1041     TPtrC ptrPath;
       
  1042     if ( KErrNone == aItem.GetNextString(ptrOldname) )
       
  1043     	{
       
  1044     	oldName.Append(ptrOldname);
       
  1045     	if(KErrNone == aItem.GetNextString(ptrNewname))
       
  1046     		{
       
  1047     		newName.Append(ptrNewname);
       
  1048     		if(KErrNone == aItem.GetNextString(ptrPath))
       
  1049     			{
       
  1050     			path.Append(ptrPath);
       
  1051     			TInt recievedInt;
       
  1052     			TRAP(err,recievedInt=iUiHelper->LaunchRenameDialogL(oldName,newName,path));
       
  1053     			if ( err == KErrNone )
       
  1054 		    		{
       
  1055 		    		iLog->Log(_L("UiHelperLaunchRenameDialogL succeeds!"));
       
  1056 		    		return err;
       
  1057 		    		}
       
  1058 		    	else
       
  1059 		    		{
       
  1060 		    		iLog->Log(_L("ERROR:UiHelperLaunchRenameDialogL fails!%d returns!"),err);
       
  1061 		    		return err;
       
  1062 		    		}
       
  1063     			}
       
  1064     		else
       
  1065     			{
       
  1066     			iLog->Log(_L("UiHelperLaunchRenameDialogL cannot get the path!"));
       
  1067     			return KErrBadTestParameter;
       
  1068     			}
       
  1069     		}
       
  1070     	else
       
  1071     		{
       
  1072     		iLog->Log(_L("UiHelperLaunchRenameDialogL cannot get the new name!"));
       
  1073     		return KErrBadTestParameter;
       
  1074     		}
       
  1075     	}
       
  1076     else
       
  1077     	{
       
  1078     	iLog->Log(_L("UiHelperLaunchRenameDialogL cannot get the old name!"));
       
  1079     	return KErrBadTestParameter;
       
  1080     	}   
       
  1081     }
       
  1082 // ---------------------------------------------------------------------------
       
  1083 // Cmpxmusicplayertest::UiHelperShowWaitNoteL
       
  1084 // ?implementation_description
       
  1085 // (other items were commented in a header).
       
  1086 // ---------------------------------------------------------------------------
       
  1087 //
       
  1088 TInt Cmpxmusicplayertest::UiHelperShowWaitNoteL( CStifItemParser& /*aItem*/ )
       
  1089     {
       
  1090     iLog->Log(_L("Cmpxmusicplayertest::UiHelperShowWaitNoteL"));
       
  1091     TInt err = KErrNone;  
       
  1092     HBufC* text = StringLoader::LoadLC(
       
  1093                                 R_MPX_QTN_NMP_NOTE_ADDING_ONE_SONG );
       
  1094     iUiHelper->ShowWaitNoteL(*text,R_AVKON_SOFTKEYS_EMPTY,EFalse,this);
       
  1095     CleanupStack::PopAndDestroy( text );
       
  1096     if ( err == KErrNone )
       
  1097     	{
       
  1098     	iLog->Log(_L("UiHelperShowWaitNoteL succeeds!"));
       
  1099     	}
       
  1100     else
       
  1101     	{
       
  1102     	iLog->Log(_L("ERROR:UiHelperShowWaitNoteL fails!%d returns!"),err);
       
  1103     	}
       
  1104     return err;
       
  1105     }
       
  1106 // ---------------------------------------------------------------------------
       
  1107 // Cmpxmusicplayertest::UiHelperDismissWaitNoteL
       
  1108 // ?implementation_description
       
  1109 // (other items were commented in a header).
       
  1110 // ---------------------------------------------------------------------------
       
  1111 //
       
  1112 TInt Cmpxmusicplayertest::UiHelperDismissWaitNoteL( CStifItemParser& /*aItem*/ )
       
  1113     {
       
  1114     iLog->Log(_L("Cmpxmusicplayertest::UiHelperDismissWaitNoteL"));
       
  1115     TInt err = KErrNone;  
       
  1116     TRAP(err,iUiHelper->DismissWaitNoteL());  
       
  1117     iLog->Log(_L("UiHelperDismissWaitNoteL succeeds!"));	
       
  1118     return err;
       
  1119     }
       
  1120 // ---------------------------------------------------------------------------
       
  1121 // Cmpxmusicplayertest::UiHelperHandleErrorL
       
  1122 // ?implementation_description
       
  1123 // (other items were commented in a header).
       
  1124 // ---------------------------------------------------------------------------
       
  1125 //
       
  1126 TInt Cmpxmusicplayertest::UiHelperHandleErrorL( CStifItemParser& /*aItem*/ )
       
  1127     {
       
  1128     iLog->Log(_L("Cmpxmusicplayertest::UiHelperHandleErrorL"));
       
  1129     TInt err = KErrNone;    
       
  1130     TRAP( err , iUiHelper->HandleErrorL(KMPXRightsAboutToExpire));  
       
  1131     if ( err == KErrNone )
       
  1132     	{
       
  1133     	iLog->Log(_L("UiHelperHandleErrorL succeeds!"));
       
  1134     	}
       
  1135     else
       
  1136     	{
       
  1137     	iLog->Log(_L("ERROR:UiHelperHandleErrorL fails!%d returns!"),err);
       
  1138     	}
       
  1139     return err;
       
  1140     }
       
  1141 // ---------------------------------------------------------------------------
       
  1142 // Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyLabelL
       
  1143 // ?implementation_description
       
  1144 // (other items were commented in a header).
       
  1145 // ---------------------------------------------------------------------------
       
  1146 //
       
  1147 TInt Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyLabelL( CStifItemParser& /*aItem*/ )
       
  1148     {
       
  1149     iLog->Log(_L("Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyLabelL"));
       
  1150     TInt err = KErrNone;  
       
  1151     CEikButtonGroupContainer::TUse use = CEikButtonGroupContainer::ECba;
       
  1152     CEikButtonGroupContainer::TOrientation oriecntation = CEikButtonGroupContainer::EVertical;
       
  1153     CEikButtonGroupContainer* groupContainer = CEikButtonGroupContainer::NewL(
       
  1154     																		use,
       
  1155     																		oriecntation,
       
  1156     																		this,
       
  1157     																		NULL,
       
  1158     																		CEikButtonGroupContainer::EDelayActivation);
       
  1159     CleanupStack::PushL(groupContainer);
       
  1160     TBuf<10> mskText;
       
  1161     _LIT(KMSKText,"MskKey");
       
  1162     mskText.Append(KMSKText);
       
  1163     groupContainer->AddCommandToStackL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, EPbCmdNext,mskText);
       
  1164     //cannot find the right resource ID
       
  1165     TRAP(err,iUiHelper->SetMiddleSoftKeyLabelL(*groupContainer,R_MPX_STATUS_PANE,EPbCmdPlay)); 
       
  1166     CleanupStack::PopAndDestroy(groupContainer);
       
  1167     if ( err == KErrNone )
       
  1168     	{
       
  1169     	iLog->Log(_L("UiHelperSetMiddleSoftKeyLabelL succeeds!"));
       
  1170     	}
       
  1171     else
       
  1172     	{
       
  1173     	iLog->Log(_L("ERROR:UiHelperSetMiddleSoftKeyLabelL fails!%d returns!"),err);
       
  1174     	}
       
  1175     return err;
       
  1176     }
       
  1177 // ---------------------------------------------------------------------------
       
  1178 // Cmpxmusicplayertest::UiHelperRemoveMiddleSoftKeyLabel
       
  1179 // ?implementation_description
       
  1180 // (other items were commented in a header).
       
  1181 // ---------------------------------------------------------------------------
       
  1182 //
       
  1183 TInt Cmpxmusicplayertest::UiHelperRemoveMiddleSoftKeyLabel( CStifItemParser& /*aItem*/ )
       
  1184     {
       
  1185     iLog->Log(_L("Cmpxmusicplayertest::UiHelperRemoveMiddleSoftKeyLabel"));
       
  1186     TInt err = KErrNone;   
       
  1187     CEikButtonGroupContainer::TUse use=CEikButtonGroupContainer::ECba;
       
  1188     CEikButtonGroupContainer::TOrientation oriecntation=CEikButtonGroupContainer::EVertical;
       
  1189     CEikButtonGroupContainer* groupContainer;
       
  1190     TRAP(err,groupContainer=CEikButtonGroupContainer::NewL(
       
  1191     																		use,
       
  1192     																		oriecntation,
       
  1193     																		this,
       
  1194     																		NULL,
       
  1195     																		CEikButtonGroupContainer::EDelayActivation));
       
  1196     CleanupStack::PushL( groupContainer );//added on 2009.3.18
       
  1197     //    CleanupStack::PushL(groupContainer);
       
  1198     TBuf<10> mskText;
       
  1199     _LIT(KMSKText,"MskKey");
       
  1200     mskText.Append(KMSKText);
       
  1201     TRAP(err,groupContainer->AddCommandToStackL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, EPbCmdNext,mskText));
       
  1202     
       
  1203     iUiHelper->RemoveMiddleSoftKeyLabel(*groupContainer);
       
  1204     CleanupStack::PopAndDestroy(groupContainer);
       
  1205     iLog->Log(_L("UiHelperRemoveMiddleSoftKeyLabel succeeds!"));
       
  1206     return err;
       
  1207     }
       
  1208 // ---------------------------------------------------------------------------
       
  1209 // Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyIconL
       
  1210 // ?implementation_description
       
  1211 // (other items were commented in a header).
       
  1212 // ---------------------------------------------------------------------------
       
  1213 //
       
  1214 TInt Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyIconL( CStifItemParser& /*aItem*/ )
       
  1215     {
       
  1216     iLog->Log(_L("Cmpxmusicplayertest::UiHelperSetMiddleSoftKeyIconL"));
       
  1217     TInt err = KErrNone; 
       
  1218     CEikButtonGroupContainer::TUse use=CEikButtonGroupContainer::ECba;
       
  1219     CEikButtonGroupContainer::TOrientation oriecntation=CEikButtonGroupContainer::EVertical;
       
  1220     CEikButtonGroupContainer* groupContainer=CEikButtonGroupContainer::NewL(
       
  1221     																		use,
       
  1222     																		oriecntation,
       
  1223     																		this,
       
  1224     																		NULL,
       
  1225     																		CEikButtonGroupContainer::EDelayActivation);
       
  1226     CleanupStack::PushL(groupContainer);
       
  1227     CFbsBitmap* bitmap = NULL;
       
  1228     CFbsBitmap* mask = NULL;
       
  1229     AknIconUtils::CreateIconLC( bitmap, mask, 
       
  1230                                TFileName(KAvkonBitmapFile), 
       
  1231                                (TInt)EMbmAvkonQgn_note_progress,
       
  1232                                (TInt)EMbmAvkonQgn_note_progress_mask );
       
  1233     TBuf<10> mskText;
       
  1234     _LIT(KMSKText,"MskKey");
       
  1235     mskText.Append(KMSKText);
       
  1236     groupContainer->AddCommandToStackL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, EPbCmdNext,mskText);
       
  1237     
       
  1238     TRAP(err,iUiHelper->SetMiddleSoftKeyIconL(*groupContainer,bitmap,mask));    
       
  1239     CleanupStack::Pop(2);
       
  1240     CleanupStack::PopAndDestroy(groupContainer); 
       
  1241     if ( err == KErrNone )
       
  1242     	{
       
  1243     	iLog->Log(_L("UiHelperSetMiddleSoftKeyIconL succeeds!"));
       
  1244     	}
       
  1245     else
       
  1246     	{
       
  1247     	iLog->Log(_L("ERROR:UiHelperSetMiddleSoftKeyIconL fails!%d returns!"),err);
       
  1248     	}
       
  1249     return err;
       
  1250     }
       
  1251 
       
  1252 // ---------------------------------------------------------------------------
       
  1253 // Cmpxmusicplayertest::UiHelperGenerateTitleL
       
  1254 // ?implementation_description
       
  1255 // (other items were commented in a header).
       
  1256 // ---------------------------------------------------------------------------
       
  1257 //
       
  1258 TInt Cmpxmusicplayertest::UiHelperGenerateTitleL( CStifItemParser& aItem )
       
  1259     {
       
  1260     iLog->Log(_L("Cmpxmusicplayertest::UiHelperGenerateTitleL"));
       
  1261     TInt err = KErrNone;   
       
  1262     TPtrC string;
       
  1263     if ( KErrNone == aItem.GetNextString(string) )
       
  1264     	{
       
  1265     	HBufC* retCategoryTitle;
       
  1266     	TBuf<120> newCategoryTitle;
       
  1267     	newCategoryTitle.Append(string);
       
  1268     	//Maybe we could modify the cfg file to make it really generate a new title.
       
  1269     	TRAP(err,retCategoryTitle=iUiHelper->GenerateTitleL(EMPXSong,newCategoryTitle);); 
       
  1270     	if ( err == KErrNone )
       
  1271     		{
       
  1272     		iLog->Log(_L("UiHelperGenerateTitleL succeeds!"));
       
  1273     		return err;
       
  1274     		}
       
  1275     	else
       
  1276     		{
       
  1277     		iLog->Log(_L("ERROR:UiHelperGenerateTitleL fails!%d returns!"),err);
       
  1278     		return err;
       
  1279     		}
       
  1280     	} 
       
  1281     else
       
  1282     	{
       
  1283     	return KErrBadTestParameter;
       
  1284     	}  
       
  1285     }
       
  1286 // ---------------------------------------------------------------------------
       
  1287 // Cmpxmusicplayertest::UiHelperExitOptionHiddenL
       
  1288 // ?implementation_description
       
  1289 // (other items were commented in a header).
       
  1290 // ---------------------------------------------------------------------------
       
  1291 //
       
  1292 TInt Cmpxmusicplayertest::UiHelperExitOptionHiddenL( CStifItemParser& /*aItem*/ )
       
  1293     {
       
  1294     iLog->Log(_L("Cmpxmusicplayertest::UiHelperExitOptionHiddenL"));
       
  1295     TInt err = KErrNone;   
       
  1296     TBool isHidden;
       
  1297     TRAP(err,isHidden=iUiHelper->ExitOptionHiddenL()); 
       
  1298     if ( err == KErrNone )
       
  1299     	{
       
  1300     	if(isHidden)
       
  1301     		{
       
  1302     		iLog->Log(_L("UiHelperExitOptionHiddenL succeeds with TBool ETrue!"));
       
  1303     		}
       
  1304     	else
       
  1305     		{
       
  1306     		iLog->Log(_L("UiHelperExitOptionHiddenL succeeds with TBool EFalse!"));
       
  1307     		}
       
  1308     	}
       
  1309     else
       
  1310     	{
       
  1311     	iLog->Log(_L("ERROR:UiHelperExitOptionHiddenL fails!%d returns!"),err);
       
  1312     	}
       
  1313     return err;
       
  1314     }
       
  1315 // ---------------------------------------------------------------------------
       
  1316 // Cmpxmusicplayertest::UiHelperSetStandAloneModePId
       
  1317 // ?implementation_description
       
  1318 // (other items were commented in a header).
       
  1319 // ---------------------------------------------------------------------------
       
  1320 //
       
  1321 TInt Cmpxmusicplayertest::UiHelperSetStandAloneModePId( CStifItemParser& /*aItem*/ )
       
  1322     {
       
  1323     iLog->Log(_L("Cmpxmusicplayertest::UiHelperSetStandAloneModePId"));
       
  1324     TInt err = KErrNone; 
       
  1325     RProcess proc;
       
  1326     TBool isSetDone;
       
  1327     isSetDone=iUiHelper->SetStandAloneModePId( proc.Id().Id());
       
  1328     if ( err == KErrNone )
       
  1329     	{
       
  1330     	if(isSetDone)
       
  1331     		{
       
  1332     		iLog->Log(_L("UiHelperSetStandAloneModePId succeeds with TBool ETrue!"));
       
  1333     		}
       
  1334     	else
       
  1335     		{
       
  1336     		iLog->Log(_L("UiHelperSetStandAloneModePId succeeds with TBool EFalse!"));
       
  1337     		}
       
  1338     	}
       
  1339     else
       
  1340     	{
       
  1341     	iLog->Log(_L("ERROR:UiHelperSetStandAloneModePId fails!%d returns!"),err);
       
  1342     	}
       
  1343     return err;
       
  1344     }
       
  1345 // ---------------------------------------------------------------------------
       
  1346 // Cmpxmusicplayertest::UiHelperStandAloneModePId
       
  1347 // ?implementation_description
       
  1348 // (other items were commented in a header).
       
  1349 // ---------------------------------------------------------------------------
       
  1350 //
       
  1351 TInt Cmpxmusicplayertest::UiHelperStandAloneModePId( CStifItemParser& /*aItem*/ )
       
  1352     {
       
  1353     iLog->Log(_L("Cmpxmusicplayertest::UiHelperStandAloneModePId"));
       
  1354     TInt err = KErrNone; 
       
  1355     TInt64 retPId;
       
  1356     retPId=iUiHelper->StandAloneModePId();
       
  1357     if ( err == KErrNone )
       
  1358     	{
       
  1359     	iLog->Log(_L("UiHelperStandAloneModePId succeeds with StandAloneModePId returned %d!"),retPId);
       
  1360     	}
       
  1361     else
       
  1362     	{
       
  1363     	iLog->Log(_L("ERROR:UiHelperStandAloneModePId fails!%d returns!"),err);
       
  1364     	}
       
  1365     return err;
       
  1366     }
       
  1367 // ---------------------------------------------------------------------------
       
  1368 // Cmpxmusicplayertest::UiHelperIsForegroundApplication
       
  1369 // ?implementation_description
       
  1370 // (other items were commented in a header).
       
  1371 // ---------------------------------------------------------------------------
       
  1372 //
       
  1373 TInt Cmpxmusicplayertest::UiHelperIsForegroundApplication( CStifItemParser& /*aItem*/ )
       
  1374     {
       
  1375     iLog->Log(_L("Cmpxmusicplayertest::UiHelperIsForegroundApplication"));
       
  1376     TInt err = KErrNone; 
       
  1377     TApaTaskList taskList(CCoeEnv::Static()->WsSession());
       
  1378     TApaTask taskInForeground = taskList.FindByPos( 0 );
       
  1379     TInt WindowGroupId=taskInForeground.WgId();
       
  1380     TBool isForeApp;
       
  1381     isForeApp=iUiHelper->IsForegroundApplication(WindowGroupId);
       
  1382     if ( err == KErrNone )
       
  1383     	{
       
  1384     	if(isForeApp)
       
  1385     		{
       
  1386     		iLog->Log(_L("UiHelperIsForegroundApplication succeeds.It's foreground application."));
       
  1387     		}
       
  1388     	else
       
  1389     		{
       
  1390     		iLog->Log(_L("UiHelperIsForegroundApplication succeeds.It's not foreground application."));
       
  1391     		}
       
  1392     	}
       
  1393     else
       
  1394     	{
       
  1395     	iLog->Log(_L("ERROR:UiHelperIsForegroundApplication fails!%d returns!"),err);
       
  1396     	}
       
  1397     return err;
       
  1398     }
       
  1399 // ---------------------------------------------------------------------------
       
  1400 // Cmpxmusicplayertest::UiHelperMMCDriveNumber
       
  1401 // ?implementation_description
       
  1402 // (other items were commented in a header).
       
  1403 // ---------------------------------------------------------------------------
       
  1404 //
       
  1405 TInt Cmpxmusicplayertest::UiHelperMMCDriveNumber( CStifItemParser& /*aItem*/ )
       
  1406     {
       
  1407     iLog->Log(_L("Cmpxmusicplayertest::UiHelperMMCDriveNumber"));
       
  1408     TInt err = KErrNone;    
       
  1409     TInt DriveNO;
       
  1410     DriveNO=iUiHelper->MMCDriveNumber();
       
  1411     if ( err == KErrNone )
       
  1412     	{
       
  1413     	iLog->Log(_L("UiHelperMMCDriveNumber succeeds.MMCDriveNumber is %d."),DriveNO);
       
  1414     	}
       
  1415     else
       
  1416     	{
       
  1417     	iLog->Log(_L("ERROR:UiHelperMMCDriveNumber fails!%d returns!"),err);
       
  1418     	}
       
  1419     return err;
       
  1420     }
       
  1421 // ---------------------------------------------------------------------------
       
  1422 // Cmpxmusicplayertest::UiHelperCancelCollectionOperation
       
  1423 // ?implementation_description
       
  1424 // (other items were commented in a header).
       
  1425 // ---------------------------------------------------------------------------
       
  1426 //
       
  1427 TInt Cmpxmusicplayertest::UiHelperCancelCollectionOperation( CStifItemParser& /*aItem*/ )
       
  1428     {
       
  1429     iLog->Log(_L("Cmpxmusicplayertest::UiHelperCancelCollectionOperation"));
       
  1430     TInt err = KErrNone;    
       
  1431     iUiHelper->CancelCollectionOperation();
       
  1432     if ( err == KErrNone )
       
  1433     	{
       
  1434     	iLog->Log(_L("UiHelperCancelCollectionOperation succeeds."));
       
  1435     	}
       
  1436     else
       
  1437     	{
       
  1438     	iLog->Log(_L("ERROR:UiHelperCancelCollectionOperation fails!%d returns!"),err);
       
  1439     	}
       
  1440     return err;
       
  1441     }
       
  1442