buildverification/smoketest/messaging/Src/TestMessBase.cpp
branchRCL_3
changeset 20 493058e57c8c
parent 0 9736f095102e
equal deleted inserted replaced
19:4ca382093dae 20:493058e57c8c
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This contains CTestCase which is the base class for all the TestCase DLLs
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "Configuration.cfg"
       
    19 
       
    20 #include "TestMessBase.h"
       
    21 #include "TestMessProcessor.h"
       
    22 #include "TestMessTimer.h"
       
    23 #include "TestMessPrintEntryUtil.h"
       
    24 
       
    25 // EPOC includes
       
    26 #include <smtpset.h>
       
    27 #include <pop3set.h>
       
    28 #include <imapset.h>
       
    29 #include <txtrich.h>
       
    30 #include <f32file.h>
       
    31 #include <msvids.h>
       
    32 #include <fbs.h>
       
    33 #include <emsuserpromptie.h>
       
    34 #ifdef __MESSAGING_API_V2__
       
    35 #include <smut.h>
       
    36 #include <miutset.h>
       
    37 #include <cemailaccounts.h>
       
    38 #include <csmsaccount.h>
       
    39 #endif
       
    40 /**
       
    41  * @name Constant Literals used.
       
    42  */
       
    43 /*@{*/
       
    44 _LIT(KDepth,					"depth");
       
    45 _LIT(KFolder,					"folder%d");
       
    46 
       
    47 // Default value for depth of the count
       
    48 #define KDefaultDepthCount		1
       
    49 
       
    50 // Default value for depth of the count
       
    51 #define KDefaultDepthCount		1
       
    52 
       
    53 _LIT(KDefault,					"default");
       
    54 
       
    55 _LIT(KScheduled,				"scheduled");
       
    56 _LIT(KProgress,					"progress");
       
    57 
       
    58 //_LIT(KIap,						"iap");
       
    59 //_LIT(KIapName,					"iapname");
       
    60 
       
    61 _LIT(KElements,					"elements");
       
    62 _LIT(KStartPosition,			"StartPosition%d");
       
    63 _LIT(KFile,						"File%d");
       
    64 _LIT(KType,						"Type%d");
       
    65 _LIT(KTypeFormat,				"Format");
       
    66 _LIT(KTypeSound,				"Sound");
       
    67 _LIT(KTypePreDefSound,			"PreDefSound");
       
    68 _LIT(KTypeAnimation,			"Animation");
       
    69 _LIT(KTypePreDefAnimation,		"PreDefAnimation");
       
    70 _LIT(KTypePicture,				"Picture");
       
    71 _LIT(KTypeUserPrompt,			"UserPrompt");
       
    72 _LIT(KFormatLength,				"FormatLength%d");
       
    73 _LIT(KBold,						"Bold%d");
       
    74 _LIT(KItalic,					"Italic%d");
       
    75 _LIT(KUnderline,				"Underline%d");
       
    76 _LIT(KStrikethrough,			"Strikethrough%d");
       
    77 _LIT(KAlignment,				"Alignment%d");
       
    78 _LIT(KFontSize,					"FontSize%d");
       
    79 
       
    80 _LIT(KLeftAlign,				"LeftAlign");
       
    81 _LIT(KRightAlign,				"RightAlign");
       
    82 _LIT(KCenterAlign,				"CenterAlign");
       
    83 _LIT(KLangDepend,				"LangDepend");
       
    84 
       
    85 _LIT(KNormal,					"Normal");
       
    86 _LIT(KLarge,					"Large");
       
    87 _LIT(KSmall,					"Small");
       
    88 _LIT(KVariable,					"Variable");
       
    89 _LIT(KReserved,					"Reserved");
       
    90 
       
    91 _LIT(KEmsPreDef,				"emspredef%d");
       
    92 
       
    93 _LIT(KEmsAnimTypeFlirty,		"a0");
       
    94 _LIT(KEmsAnimTypeGlad,			"a1");
       
    95 _LIT(KEmsAnimTypeSceptic,		"a2");
       
    96 _LIT(KEmsAnimTypeSad,			"a3");
       
    97 _LIT(KEmsAnimTypeWow,			"a4");
       
    98 _LIT(KEmsAnimTypeCrying,		"a5");
       
    99 _LIT(KEmsAnimTypeWinking,		"a6");
       
   100 _LIT(KEmsAnimTypeLaughing,		"a7");
       
   101 _LIT(KEmsAnimTypeIndifferent,	"a8");
       
   102 _LIT(KEmsAnimTypeKissing,		"a9");
       
   103 _LIT(KEmsAnimTypeConfused,		"a10");
       
   104 _LIT(KEmsAnimTypeTongueOut,		"a11");
       
   105 _LIT(KEmsAnimTypeAngry,			"a12");
       
   106 _LIT(KEmsAnimTypeGlasses,		"a13");
       
   107 _LIT(KEmsAnimTypeDevil,			"a14");
       
   108 
       
   109 _LIT(KEmsSoundTypeChimesHigh,	"s0");
       
   110 _LIT(KEmsSoundTypeChimesLow,	"s1");
       
   111 _LIT(KEmsSoundTypeDing,			"s2");
       
   112 _LIT(KEmsSoundTypeTaDa,			"s3");
       
   113 _LIT(KEmsSoundTypeNotify,		"s4");
       
   114 _LIT(KEmsSoundTypeDrum,			"s5");
       
   115 _LIT(KEmsSoundTypeClaps,		"s6");
       
   116 _LIT(KEmsSoundTypeFanFar,		"s7");
       
   117 _LIT(KEmsSoundTypeChordHigh,	"s8");
       
   118 _LIT(KEmsSoundTypeChordLow,		"s9");
       
   119 
       
   120 /*
       
   121 _LIT(KBioIAP,					"IAP");
       
   122 _LIT(KBioEmailNotification,		"EmailNotification");
       
   123 _LIT(KBioBusinessCard,			"BusinessCard");
       
   124 _LIT(KBioWAPAccessPoint,		"WAPAccessPoint");
       
   125 _LIT(KBioVCalendar,				"VCalendar");
       
   126 _LIT(KBioVCard,					"VCard");
       
   127 _LIT(KBioRingingTones,			"RingingTones");
       
   128 _LIT(KBioOperatorLogo,			"OperatorLogo");
       
   129 _LIT(KBioWPRV,					"WPRV");
       
   130 _LIT(KBioCLILogo,				"CLILogo");
       
   131 */
       
   132 _LIT(KObjectSize,				"ObjectSize%d");
       
   133 _LIT(KBody,						"body");
       
   134 /*@}*/
       
   135 
       
   136 const TInt KSmallObject		= 0;
       
   137 const TInt KLargeObject		= 1;
       
   138 const TInt KVariableObject	= 2;
       
   139 
       
   140 const TInt KDefaultStartPos	= 1;
       
   141 
       
   142 /**
       
   143  * Constructor.
       
   144  * @return - None
       
   145  * 
       
   146 */	
       
   147 CTestMessBase::CTestMessBase(TBool aSetDirectory)
       
   148 :	CTestStepSmokeTest()
       
   149 ,	iSession(NULL)
       
   150 ,	iMessageProcessor(NULL)
       
   151 ,   iParaFormatLayer(NULL)
       
   152 ,   iCharFormatLayer(NULL)
       
   153 ,   iBodyText(NULL)
       
   154 ,	iBodyAvailable(EFalse)
       
   155 ,	iSetDirectory(aSetDirectory)
       
   156 ,	iMessageTimer(NULL)
       
   157 ,	iSchedular(NULL)
       
   158 ,	iEntry(NULL)
       
   159 ,	iOrder(KMsvGroupByType|KMsvGroupByStandardFolders, EMsvSortById, ETrue)
       
   160 	{
       
   161 	}
       
   162 
       
   163 CTestMessBase::~CTestMessBase()
       
   164 	{
       
   165 	delete iEntry;
       
   166 	iEntry=NULL;
       
   167 	delete iMessageTimer;
       
   168 	iMessageTimer=NULL;
       
   169 	delete iMessageProcessor;
       
   170 	iMessageProcessor=NULL;
       
   171 	delete iSession;
       
   172 	iSession=NULL;
       
   173 	delete iSchedular;
       
   174 	iSchedular=NULL;
       
   175 	delete iBodyText;
       
   176 	iBodyText=NULL;
       
   177 	delete iCharFormatLayer;
       
   178 	iCharFormatLayer=NULL;
       
   179 	delete iParaFormatLayer;
       
   180 	iParaFormatLayer=NULL;
       
   181 	}
       
   182 
       
   183 enum TVerdict CTestMessBase::doTestStepPreambleL()
       
   184 	{
       
   185 	TVerdict	ret=CTestStepSmokeTest::doTestStepPreambleL();
       
   186 
       
   187 	// Printing to the console and log file
       
   188 	const TDesC&	stepName=TestStepName();
       
   189 	INFO_PRINTF2(_L("%S"), &stepName);
       
   190 
       
   191 	iSchedular=new (ELeave) CActiveScheduler();
       
   192 	CActiveScheduler::Install(iSchedular);
       
   193 	iSession=CMsvSession::OpenSyncL(*this);
       
   194 
       
   195 	//	Get progress
       
   196 	TInt	progress=0;
       
   197 	TBool	hasProgress=GetIntFromConfig(ConfigSection(), KProgress, progress);
       
   198 	if ( !hasProgress )
       
   199 		{
       
   200 		hasProgress=GetIntFromConfig(KDefault, KProgress, progress);
       
   201 		}
       
   202 
       
   203 	iMessageProcessor=CTestMessProcessor::NewL(*this, *iSession);
       
   204 	if ( hasProgress )
       
   205 		{
       
   206 		iMessageTimer=CTestMessTimer::NewL(progress*KOneSecond, *iMessageProcessor);
       
   207 		}
       
   208 
       
   209 	if ( iSetDirectory )
       
   210 		{
       
   211 		TInt	depth=KDefaultDepthCount;
       
   212 		TBool	returnValue=GetIntFromConfig(ConfigSection(), KDepth, depth);
       
   213 		if ( !returnValue )
       
   214 			{
       
   215 			depth=KDefaultDepthCount;
       
   216 			}
       
   217 		INFO_PRINTF2(_L("Depth = %d"), depth);
       
   218 
       
   219 		//	Searce for the entry
       
   220 		TRAPD(error,SetEntryL(KMsvRootIndexEntryId));
       
   221 		if( error != KErrNone)
       
   222 			{
       
   223 			INFO_PRINTF2(_L("Set Entry failed, Error %D"),error);
       
   224 			SetTestStepError(error);
       
   225 			ret=EFail;
       
   226 			}
       
   227 		else
       
   228 			{
       
   229 
       
   230 			TBuf<KMaxTestExecuteCommandLength>	tempStore;
       
   231 			TBool								found=ETrue;
       
   232 			for (TInt entry=0; entry<depth && found;)
       
   233 				{
       
   234 				TPtrC	subject;
       
   235 				tempStore.Format(KFolder(), ++entry);
       
   236 				returnValue =GetStringFromConfig(ConfigSection(), tempStore, subject);
       
   237 				if ( !returnValue )
       
   238 					{
       
   239 					INFO_PRINTF1(_L("Null Folder"));
       
   240 					}
       
   241 				INFO_PRINTF2(_L("Folder = %S"), &subject);
       
   242 
       
   243 				CMsvEntrySelection*	selection=EntryL().ChildrenL();
       
   244 				CleanupStack::PushL(selection);
       
   245 				TInt				count=selection->Count();
       
   246 		
       
   247 				found=EFalse;
       
   248 				for (TInt i=count; i>0 && !found; )
       
   249 					{
       
   250 					TMsvId	childId=selection->At(--i);
       
   251 
       
   252 					SetEntryL(childId);
       
   253 					INFO_PRINTF2(_L("Entry Detail : %S"), &(EntryL().Entry().iDetails));
       
   254 					INFO_PRINTF2(_L("Entry Description: %S"), &(EntryL().Entry().iDescription));
       
   255 					if ( subject.Compare(EntryL().Entry().iDetails) == 0 ||
       
   256 						 subject.Compare(EntryL().Entry().iDescription) == 0 )
       
   257 						{
       
   258 						found=ETrue;
       
   259 						}
       
   260 					}
       
   261 				CleanupStack::PopAndDestroy(selection);
       
   262 				}
       
   263 
       
   264 			if ( !found )
       
   265 				{
       
   266 				ERR_PRINTF1(_L("Folder not found"));
       
   267 				ret=EFail;
       
   268 				}
       
   269 			}
       
   270 		}
       
   271 	if (TestStepResult() == EPass)
       
   272 		{
       
   273 		//Get body(file path) from ini file and read respective file. Store it into CRichText format.
       
   274 		iParaFormatLayer=CParaFormatLayer::NewL();
       
   275 		iCharFormatLayer=CCharFormatLayer::NewL(); 
       
   276 		iBodyText=CRichText::NewL(iParaFormatLayer, iCharFormatLayer);
       
   277 		iBodyAvailable=EFalse;
       
   278 	
       
   279 		TPtrC	body;
       
   280 		if(GetStringFromConfig(ConfigSection(), KBody, body))
       
   281 			{
       
   282 			INFO_PRINTF2(_L("Body = %S"), &body);
       
   283 			iBodyAvailable=ETrue;
       
   284 			}
       
   285 		else
       
   286 			{
       
   287 			INFO_PRINTF1(_L("No Body"));
       
   288 			}
       
   289 
       
   290 		if ( iBodyAvailable )
       
   291 			{
       
   292 			// open the file
       
   293 			RFile	file;
       
   294 	
       
   295 			TInt anError = file.Open(iSession->FileSession(), body, EFileShareAny);
       
   296 			if(anError == KErrNone)
       
   297 				{
       
   298 				TBool		reading=ETrue;
       
   299 				TInt		pos=0;
       
   300 				TBuf8<1>	charIn;
       
   301 				while (reading)
       
   302 					{
       
   303 					file.Read(charIn, 1);
       
   304 					if(charIn.Length())
       
   305 						{
       
   306 						switch ( charIn[0] )
       
   307 							{
       
   308 						case '\r':
       
   309 							iBodyText->InsertL(pos++, CEditableText::ELineBreak);
       
   310 						case '\n':
       
   311 							break;
       
   312 						default:
       
   313 							iBodyText->InsertL(pos++, TChar(charIn[0]));
       
   314 							}
       
   315 						}
       
   316 					else
       
   317 						{
       
   318 						reading = EFalse;	// stop at the end of the file
       
   319 						}
       
   320 					}
       
   321 				iBodyAvailable=ETrue;
       
   322 				file.Close();
       
   323 				}
       
   324 			else
       
   325 			{
       
   326 			INFO_PRINTF2(_L("Cannot open file = %S"), &body);
       
   327 			iBodyAvailable=EFalse;
       
   328 			}
       
   329 		}//End of read file.
       
   330 	}
       
   331 
       
   332 	SetTestStepResult(ret);
       
   333 	return ret;
       
   334 	}
       
   335 
       
   336 enum TVerdict CTestMessBase::doTestStepPostambleL()
       
   337 	{
       
   338 	delete iEntry;
       
   339 	iEntry=NULL;
       
   340 	delete iMessageTimer;
       
   341 	iMessageTimer=NULL;
       
   342 	delete iMessageProcessor;
       
   343 	iMessageProcessor=NULL;
       
   344 	delete iSession;
       
   345 	iSession=NULL;
       
   346 	delete iSchedular;
       
   347 	iSchedular=NULL;
       
   348 	CActiveScheduler::Install(NULL);
       
   349 	return CTestStepSmokeTest::doTestStepPostambleL();
       
   350 	}
       
   351 
       
   352 void CTestMessBase::SetEntryL(TMsvId aId)
       
   353 	{
       
   354 	delete iEntry;
       
   355 	iEntry=NULL;
       
   356 	iEntry=iSession->GetEntryL(aId);
       
   357 	}
       
   358 
       
   359 CMsvEntry& CTestMessBase::EntryL()
       
   360 	{
       
   361 	if ( iEntry == NULL )
       
   362 		{
       
   363 		User::Leave(KErrGeneral);
       
   364 		}
       
   365 
       
   366 	return *iEntry;
       
   367 	}
       
   368 
       
   369 
       
   370 HBufC8* CTestMessBase::CopyToBuf8LC(const TDesC& aDesC)
       
   371 //
       
   372 // @return - HBufC8*
       
   373 // Converts TDesC to HBufC8*.
       
   374 //
       
   375 	{
       
   376 	HBufC8*	itemBuff8 = HBufC8::NewLC(aDesC.Length());
       
   377 	itemBuff8->Des().Copy(aDesC);
       
   378 
       
   379 	return itemBuff8;
       
   380 	}
       
   381 
       
   382 HBufC* CTestMessBase::CopyToBufLC(const TDesC8& aDesC)
       
   383 //
       
   384 // @return - HBufC8*
       
   385 // Converts TDesC to HBufC8*.
       
   386 //
       
   387 	{
       
   388 	HBufC*	itemBuff = HBufC::NewLC(aDesC.Length());
       
   389 	itemBuff->Des().Copy(aDesC);
       
   390 
       
   391 	return itemBuff;
       
   392 	}
       
   393 
       
   394 
       
   395 #ifndef __MESSAGING_API_V2__
       
   396 void CTestMessBase::SetDefaultServiceL(TUid aMtm, TMsvId aService) const
       
   397 	{
       
   398 	// --- Now restore the default services from the root store ---
       
   399 	CMsvEntry*				rootEntry=iSession->GetEntryL(KMsvRootIndexEntryIdValue);
       
   400 	CleanupStack::PushL(rootEntry);
       
   401 	CMsvStore*				store = rootEntry->EditStoreL();
       
   402 	CleanupStack::PushL(store);
       
   403 	CMsvDefaultServices*	services = new(ELeave)CMsvDefaultServices;
       
   404 	CleanupStack::PushL(services);
       
   405 	services->RestoreL(*store);
       
   406 
       
   407 	// --- And now re-set the default service for the MTM to the one given ---
       
   408 	TMsvDefaultService	defaultService;
       
   409 	defaultService.iMtm=aMtm;
       
   410 	defaultService.iService=aService;
       
   411 	services->ChangeDefaultServiceL(defaultService);
       
   412 	services->StoreL(*store);
       
   413 	store->CommitL();
       
   414 	CleanupStack::PopAndDestroy(3, rootEntry);
       
   415 	}
       
   416 
       
   417 TInt CTestMessBase::DefaultServiceL(TUid aMtm, TMsvId& aService) const
       
   418 	{
       
   419 	// --- Now restore the default services from the root store ---
       
   420 	CMsvEntry*				rootEntry=iSession->GetEntryL(KMsvRootIndexEntryIdValue);
       
   421 	CleanupStack::PushL(rootEntry);
       
   422 	CMsvStore*				store=rootEntry->ReadStoreL();
       
   423 	CleanupStack::PushL(store);
       
   424 	CMsvDefaultServices*	services=new(ELeave)CMsvDefaultServices;
       
   425 	CleanupStack::PushL(services);
       
   426 	services->RestoreL(*store);
       
   427 
       
   428 	TInt					ret=services->DefaultService(aMtm, aService);
       
   429 
       
   430 	CleanupStack::PopAndDestroy(3, rootEntry);
       
   431 
       
   432 	return ret;
       
   433 	}
       
   434 #endif
       
   435 
       
   436 void CTestMessBase::PrintTreeL(TMsvId aRoot)
       
   437 	{
       
   438 	INFO_PRINTF1(_L("PrintTreeL In"));
       
   439 	CMsvEntry*			entry=iSession->GetEntryL(aRoot);
       
   440 	CleanupStack::PushL(entry);
       
   441 	entry->SetSortTypeL(SelectionOrdering());
       
   442 	CMsvEntrySelection*	selection=entry->ChildrenL();
       
   443 	CleanupStack::PushL(selection);
       
   444 
       
   445 	PrintEntryL(*entry);
       
   446 	for (TInt i=0; i<selection->Count(); )
       
   447 		{
       
   448 		PrintTreeL(selection->At(i++));
       
   449 		}
       
   450 
       
   451 	CleanupStack::PopAndDestroy(2, entry);
       
   452 	INFO_PRINTF1(_L("PrintTreeL Out"));
       
   453 	}
       
   454 
       
   455 void CTestMessBase::PrintEntryL(CMsvEntry& aEntry)
       
   456 	{
       
   457 	TMsvEntry	entry=aEntry.Entry();
       
   458 
       
   459 	INFO_PRINTF2(_L("Entry Detail : %S"), &(entry.iDetails));
       
   460 	INFO_PRINTF2(_L("  Description: %S"), &(entry.iDescription));
       
   461 	INFO_PRINTF2(_L("  Id         : %x"), entry.Id());
       
   462 	INFO_PRINTF2(_L("  Parent Id  : %x"), entry.Parent());
       
   463 	INFO_PRINTF2(_L("  Service Id : %x"), entry.iServiceId);
       
   464 	if ( entry.iRelatedId != 0 )
       
   465 		{
       
   466 		INFO_PRINTF2(_L("  Related Id : %x"), entry.iRelatedId);
       
   467 		}
       
   468 	INFO_PRINTF2(_L("  Type       : %x"), entry.iType);
       
   469 	INFO_PRINTF2(_L("  Mtm        : %x"), entry.iMtm);
       
   470 
       
   471 
       
   472 	if ( entry.iSize != 0 )
       
   473 		{
       
   474 		INFO_PRINTF2(_L("  Size       : %x"), entry.iSize);
       
   475 		}
       
   476 	if ( entry.iError != 0 )
       
   477 		{
       
   478 		INFO_PRINTF2(_L("  Error      : %d"), entry.iError);
       
   479 		}
       
   480 	if ( entry.iBioType != 0 )
       
   481 		{
       
   482 		INFO_PRINTF2(_L("  BioType    : %x"), entry.iBioType);
       
   483 		}
       
   484 	if ( entry.MtmData1() != 0 )
       
   485 		{
       
   486 		INFO_PRINTF2(_L("  MtmData1   : %x"), entry.MtmData1());
       
   487 		}
       
   488 	if ( entry.MtmData2() != 0 )
       
   489 		{
       
   490 		INFO_PRINTF2(_L("  MtmData2   : %x"), entry.MtmData2());
       
   491 		}
       
   492 	if ( entry.MtmData3() != 0 )
       
   493 		{
       
   494 		INFO_PRINTF2(_L("  MtmData3   : %x"), entry.MtmData3());
       
   495 		}
       
   496 	if ( entry.Attachment() != 0 )
       
   497 		{
       
   498 		INFO_PRINTF2(_L("  Attachment : %x"), entry.Attachment());
       
   499 		}
       
   500 	if ( entry.Complete() != 0 )
       
   501 		{
       
   502 		INFO_PRINTF2(_L("  Complete   : %x"), entry.Complete());
       
   503 		}
       
   504 	if ( entry.Connected() != 0 )
       
   505 		{
       
   506 		INFO_PRINTF2(_L("  Connected  : %x"), entry.Connected());
       
   507 		}
       
   508 	if ( entry.Deleted() != 0 )
       
   509 		{
       
   510 		INFO_PRINTF2(_L("  Deleted    : %x"), entry.Deleted());
       
   511 		}
       
   512 	if ( entry.Failed() != 0 )
       
   513 		{
       
   514 		INFO_PRINTF2(_L("  Failed     : %x"), entry.Failed());
       
   515 		}
       
   516 	if ( entry.InPreparation() != 0 )
       
   517 		{
       
   518 		INFO_PRINTF2(_L("  InPrep     : %x"), entry.InPreparation());
       
   519 		}
       
   520 	if ( entry.MultipleRecipients() != 0 )
       
   521 		{
       
   522 		INFO_PRINTF2(_L("  MultiRecip : %x"), entry.MultipleRecipients());
       
   523 		}
       
   524 	if ( entry.OffPeak() != 0 )
       
   525 		{
       
   526 		INFO_PRINTF2(_L("  OffPeak    : %x"), entry.OffPeak());
       
   527 		}
       
   528 	if ( entry.Operation() != 0 )
       
   529 		{
       
   530 		INFO_PRINTF2(_L("  Operation  : %x"), entry.Operation());
       
   531 		}
       
   532 	if ( entry.Owner() != 0 )
       
   533 		{
       
   534 		INFO_PRINTF2(_L("  Owner      : %x"), entry.Owner());
       
   535 		}
       
   536 	if ( entry.PcSyncCount() != 0 )
       
   537 		{
       
   538 		INFO_PRINTF2(_L("  PcSyncCount: %x"), entry.PcSyncCount());
       
   539 		}
       
   540 	if ( entry.Priority() != 0 )
       
   541 		{
       
   542 		INFO_PRINTF2(_L("  Priority   : %x"), entry.Priority());
       
   543 		}
       
   544 	if ( entry.ReadOnly() != 0 )
       
   545 		{
       
   546 		INFO_PRINTF2(_L("  ReadOnly   : %x"), entry.ReadOnly());
       
   547 		}
       
   548 	if ( entry.Scheduled() != 0 )
       
   549 		{
       
   550 		INFO_PRINTF2(_L("  Scheduled  : %x"), entry.Scheduled());
       
   551 		}
       
   552 	if ( entry.SendingState() != 0 )
       
   553 		{
       
   554 		INFO_PRINTF2(_L("  Send State : %x"), entry.SendingState());
       
   555 		}
       
   556 	if ( entry.StandardFolder() != 0 )
       
   557 		{
       
   558 		INFO_PRINTF2(_L("  StdFolder  : %x"), entry.StandardFolder());
       
   559 		}
       
   560 	if ( entry.Unread() != 0 )
       
   561 		{
       
   562 		INFO_PRINTF2(_L("  Unread     : %x"), entry.Unread());
       
   563 		}
       
   564 	if ( entry.Visible() != 0 )
       
   565 		{
       
   566 		INFO_PRINTF2(_L("  Visible    : %x"), entry.Visible());
       
   567 		}
       
   568 
       
   569 #if (!defined CDMA_API_ENABLED)
       
   570 	if ( aEntry.HasStoreL() )
       
   571 		{
       
   572 		PrintStoreL(aEntry);
       
   573 		}
       
   574 #endif
       
   575 	}
       
   576 
       
   577 void CTestMessBase::PrintStoreL(CMsvEntry& aEntry)
       
   578 	{
       
   579 	TMsvEntry					entry=aEntry.Entry();
       
   580 	CTestMessPrintEntryUtil*	printUtil=new (ELeave) CTestMessPrintEntryUtil(*this);
       
   581 	CleanupStack::PushL(printUtil);
       
   582 
       
   583 	printUtil->ProcessEntryL(entry.Id());
       
   584 	CleanupStack::PopAndDestroy(printUtil);
       
   585 
       
   586 	if ( entry.iMtm==KUidMsgTypeSMTP )
       
   587 		{
       
   588 		PrintStoreSmtpL(aEntry);
       
   589 		}
       
   590 	else if ( entry.iMtm == KUidMsgTypePOP3 )
       
   591 		{
       
   592 		PrintStorePop3L(aEntry);
       
   593 		}
       
   594 	else if ( entry.iMtm == KUidMsgTypeIMAP4 )
       
   595 		{
       
   596 		PrintStoreImap4L(aEntry);
       
   597 		}
       
   598 	else if ( entry.iMtm == KUidMsgTypeSMS )
       
   599 		{
       
   600 		PrintStoreSmsL(aEntry);
       
   601 		}
       
   602 	}
       
   603 
       
   604 void CTestMessBase::PrintStoreSmtpL(CMsvEntry& aEntry)
       
   605 	{
       
   606 	TMsvEntry	entry=aEntry.Entry();
       
   607 	CMsvStore*	store=aEntry.ReadStoreL();
       
   608 	CleanupStack::PushL(store);
       
   609 
       
   610 	TPtrC	ptrTemp;
       
   611 	if ( entry.iType == KUidMsvServiceEntry )
       
   612 		{
       
   613 		CImSmtpSettings*	settings = new(ELeave) CImSmtpSettings();
       
   614 		CleanupStack::PushL(settings);
       
   615 #ifdef __MESSAGING_API_V2__
       
   616 		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
       
   617 		TSmtpAccount smtpAccountId;
       
   618 		accounts->GetSmtpAccountL(aEntry.EntryId(), smtpAccountId);
       
   619 		TRAPD(err, accounts->LoadSmtpSettingsL(smtpAccountId, *settings));
       
   620 		CleanupStack::PopAndDestroy(accounts);
       
   621 #else
       
   622 		TRAPD(err, settings->RestoreL(*store));
       
   623 #endif
       
   624 		if ( err == KErrNone )
       
   625 			{
       
   626 			ptrTemp.Set(settings->ServerAddress());
       
   627 			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
       
   628 #ifndef __MESSAGING_API_V2__
       
   629 			ptrTemp.Set(settings->UserAddress());
       
   630 			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
       
   631 			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
       
   632 #endif
       
   633 			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
       
   634 			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
       
   635 			ptrTemp.Set(settings->EmailAlias());
       
   636 			INFO_PRINTF2(_L("  EmailAlias                   : %S"), &ptrTemp);
       
   637 			ptrTemp.Set(settings->EmailAddress());
       
   638 			INFO_PRINTF2(_L("  EmailAddress                 : %S"), &ptrTemp);
       
   639 			ptrTemp.Set(settings->ReplyToAddress());
       
   640 			INFO_PRINTF2(_L("  ReplyToAddress               : %S"), &ptrTemp);
       
   641 			ptrTemp.Set(settings->ReceiptAddress());
       
   642 			INFO_PRINTF2(_L("  ReceiptAddress               : %S"), &ptrTemp);
       
   643 			if ( settings->RequestReceipts() != 0 )
       
   644 				{
       
   645 				INFO_PRINTF2(_L("  RequestReceipts              : %x"), (TUint)settings->RequestReceipts());
       
   646 				}
       
   647 			if ( settings->SendCopyToSelf() != 0 )
       
   648 				{
       
   649 				INFO_PRINTF2(_L("  SendCopyToSelf               : %x"), (TUint)settings->SendCopyToSelf());
       
   650 				}
       
   651 			INFO_PRINTF2(_L("  SendMessageOption            : %x"), (TUint)settings->SendMessageOption());
       
   652 			}
       
   653 		CleanupStack::PopAndDestroy(settings);
       
   654 		}
       
   655 
       
   656 	CleanupStack::PopAndDestroy(store);
       
   657 	}
       
   658 
       
   659 void CTestMessBase::PrintStorePop3L(CMsvEntry& aEntry)
       
   660 	{
       
   661 	TMsvEntry	entry=aEntry.Entry();
       
   662 	CMsvStore*	store=aEntry.ReadStoreL();
       
   663 	CleanupStack::PushL(store);
       
   664 
       
   665 	TPtrC	ptrTemp;
       
   666 	if ( entry.iType == KUidMsvServiceEntry )
       
   667 		{
       
   668 		CImPop3Settings*	settings = new(ELeave) CImPop3Settings();
       
   669 		CleanupStack::PushL(settings);
       
   670 
       
   671 #ifdef __MESSAGING_API_V2__
       
   672 		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
       
   673 		TPopAccount popAccountId;
       
   674 		accounts->GetPopAccountL(aEntry.EntryId(), popAccountId);
       
   675 		TRAPD(err, accounts->LoadPopSettingsL(popAccountId, *settings));
       
   676 		CleanupStack::PopAndDestroy(accounts);
       
   677 #else
       
   678 		TRAPD(err, settings->RestoreL(*store));
       
   679 #endif
       
   680 		if ( err == KErrNone )
       
   681 			{
       
   682 			ptrTemp.Set(settings->ServerAddress());
       
   683 			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
       
   684 #ifndef __MESSAGING_API_V2__
       
   685 			ptrTemp.Set(settings->UserAddress());
       
   686 			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
       
   687 			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
       
   688 #endif
       
   689 			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
       
   690 			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
       
   691 			HBufC*	loginName=CopyToBufLC(settings->LoginName());
       
   692 			INFO_PRINTF2(_L("  LoginName                    : %S"), loginName);
       
   693 			CleanupStack::PopAndDestroy(loginName);
       
   694 			if ( settings->AutoSendOnConnect() != 0 )
       
   695 				{
       
   696 				INFO_PRINTF2(_L("  AutoSendOnConnect            : %x"), (TUint)settings->AutoSendOnConnect());
       
   697 				}
       
   698 			if ( settings->Apop() != 0 )
       
   699 				{
       
   700 				INFO_PRINTF2(_L("  Apop                         : %x"), (TUint)settings->Apop());
       
   701 				}
       
   702 			if ( settings->DisconnectedUserMode() != 0 )
       
   703 				{
       
   704 				INFO_PRINTF2(_L("  DisconnectedUserMode         : %x"), (TUint)settings->DisconnectedUserMode());
       
   705 				}
       
   706 			if ( settings->DeleteEmailsWhenDisconnecting() != 0 )
       
   707 				{
       
   708 				INFO_PRINTF2(_L("  DeleteEmailsWhenDisconnecting: %x"), (TUint)settings->DeleteEmailsWhenDisconnecting());
       
   709 				}
       
   710 			if ( settings->AcknowledgeReceipts() != 0 )
       
   711 				{
       
   712 				INFO_PRINTF2(_L("  AcknowledgeReceipts          : %x"), (TUint)settings->AcknowledgeReceipts());
       
   713 				}
       
   714 			if ( settings->MaxEmailSize() != 0 )
       
   715 				{
       
   716 				INFO_PRINTF2(_L("  MaxEmailSize                 : %x"), (TUint)settings->MaxEmailSize());
       
   717 				}
       
   718 			if ( settings->GetMailOptions() != 0 )
       
   719 				{
       
   720 				INFO_PRINTF2(_L("  GetMailOptions               : %x"), (TUint)settings->GetMailOptions());
       
   721 				}
       
   722 			if ( settings->InboxSynchronisationLimit() != 0 )
       
   723 				{
       
   724 				INFO_PRINTF2(_L("  InboxSynchronisationLimit    : %x"), (TUint)settings->InboxSynchronisationLimit());
       
   725 				}
       
   726 			}
       
   727 		CleanupStack::PopAndDestroy(settings);
       
   728 		}
       
   729 
       
   730 	CleanupStack::PopAndDestroy(store);
       
   731 	}
       
   732 
       
   733 void CTestMessBase::PrintStoreImap4L(CMsvEntry& aEntry)
       
   734 	{
       
   735 	TMsvEntry	entry=aEntry.Entry();
       
   736 	CMsvStore*	store=aEntry.ReadStoreL();
       
   737 	CleanupStack::PushL(store);
       
   738 
       
   739 	TPtrC	ptrTemp;
       
   740 	if ( entry.iType == KUidMsvServiceEntry )
       
   741 		{
       
   742 		CImImap4Settings*	settings = new(ELeave) CImImap4Settings();
       
   743 		CleanupStack::PushL(settings);
       
   744 
       
   745 #ifdef __MESSAGING_API_V2__
       
   746 		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
       
   747 		TImapAccount imapAccountId;
       
   748 		accounts->GetImapAccountL(aEntry.EntryId(), imapAccountId);
       
   749 		TRAPD(err, accounts->LoadImapSettingsL(imapAccountId, *settings));
       
   750 		CleanupStack::PopAndDestroy(accounts);
       
   751 #else
       
   752 		TRAPD(err, settings->RestoreL(*store));
       
   753 #endif
       
   754 		if ( err == KErrNone )
       
   755 			{
       
   756 			ptrTemp.Set(settings->ServerAddress());
       
   757 			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
       
   758 #ifndef __MESSAGING_API_V2__
       
   759 			ptrTemp.Set(settings->UserAddress());
       
   760 			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
       
   761 			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
       
   762 #endif
       
   763 			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
       
   764 			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
       
   765 
       
   766 			HBufC*	loginName=CopyToBufLC(settings->LoginName());
       
   767 			INFO_PRINTF2(_L("  LoginName                    : %S"), loginName);
       
   768 			HBufC*	folderPath=CopyToBufLC(settings->FolderPath());
       
   769 			INFO_PRINTF2(_L("  FolderPath                   : %S"), folderPath);
       
   770 			CleanupStack::PopAndDestroy(2, loginName);
       
   771 			if ( settings->PathSeparator() != 0 )
       
   772 				{
       
   773 				INFO_PRINTF2(_L("  PathSeparator                : %c"), (TText)settings->PathSeparator());
       
   774 				}
       
   775 			if ( settings->DisconnectedUserMode() != 0 )
       
   776 				{
       
   777 				INFO_PRINTF2(_L("  DisconnectedUserMode         : %x"), (TUint)settings->DisconnectedUserMode());
       
   778 				}
       
   779 			if ( settings->Synchronise() != 0 )
       
   780 				{
       
   781 				INFO_PRINTF2(_L("  Synchronise                  : %x"), (TUint)settings->Synchronise());
       
   782 				}
       
   783 			if ( settings->Subscribe() != 0 )
       
   784 				{
       
   785 				INFO_PRINTF2(_L("  Subscribe                    : %x"), (TUint)settings->Subscribe());
       
   786 				}
       
   787 			if ( settings->AutoSendOnConnect() != 0 )
       
   788 				{
       
   789 				INFO_PRINTF2(_L("  AutoSendOnConnect            : %x"), (TUint)settings->AutoSendOnConnect());
       
   790 				}
       
   791 			if ( settings->MaxEmailSize() != 0 )
       
   792 				{
       
   793 				INFO_PRINTF2(_L("  MaxEmailSize                 : %x"), (TUint)settings->MaxEmailSize());
       
   794 				}
       
   795 			if ( settings->DeleteEmailsWhenDisconnecting() != 0 )
       
   796 				{
       
   797 				INFO_PRINTF2(_L("  DeleteEmailsWhenDisconnecting: %x"), (TUint)settings->DeleteEmailsWhenDisconnecting());
       
   798 				}
       
   799 			if ( settings->AcknowledgeReceipts() != 0 )
       
   800 				{
       
   801 				INFO_PRINTF2(_L("  AcknowledgeReceipts          : %x"), (TUint)settings->AcknowledgeReceipts());
       
   802 				}
       
   803 			if ( settings->GetMailOptions() != 0 )
       
   804 				{
       
   805 				INFO_PRINTF2(_L("  GetMailOptions               : %x"), (TUint)settings->GetMailOptions());
       
   806 				}
       
   807 			if ( settings->InboxSynchronisationLimit() != 0 )
       
   808 				{
       
   809 				INFO_PRINTF2(_L("  InboxSynchronisationLimit    : %x"), (TUint)settings->InboxSynchronisationLimit());
       
   810 				}
       
   811 			if ( settings->MailboxSynchronisationLimit() != 0 )
       
   812 				{
       
   813 				INFO_PRINTF2(_L("  MailboxSynchronisationLimit  : %x"), (TUint)settings->MailboxSynchronisationLimit());
       
   814 				}
       
   815 			}
       
   816 		CleanupStack::PopAndDestroy(settings);
       
   817 		}
       
   818 
       
   819 	CleanupStack::PopAndDestroy(store);
       
   820 	}
       
   821 
       
   822 void CTestMessBase::PrintStoreSmsL(CMsvEntry& aEntry)
       
   823 	{
       
   824 	TMsvEntry	entry=aEntry.Entry();
       
   825 	CMsvStore*	store=aEntry.ReadStoreL();
       
   826 	CleanupStack::PushL(store);
       
   827 
       
   828 	TPtrC	ptrTemp;
       
   829 	if ( entry.iType == KUidMsvServiceEntry )
       
   830 		{
       
   831 		CSmsSettings*	settings = CSmsSettings::NewL();
       
   832 		CleanupStack::PushL(settings);
       
   833 
       
   834 #ifdef __MESSAGING_API_V2__
       
   835 		CSmsAccount*		smsAccount = CSmsAccount::NewLC();
       
   836 		TRAPD(err, smsAccount->LoadSettingsL(*settings));
       
   837 		CleanupStack::PopAndDestroy(smsAccount);
       
   838 #else
       
   839 		TRAPD(err, settings->RestoreL(*store));
       
   840 #endif
       
   841 		if ( err == KErrNone )
       
   842 			{
       
   843 			TSmsDelivery	delivery(settings->Delivery());
       
   844 			INFO_PRINTF2(_L("  Delivery                     : %d"), delivery);
       
   845 			CSmsSettings::TSmsReportHandling	reportHandling(settings->StatusReportHandling());
       
   846 			INFO_PRINTF2(_L("  StatusReportHandling         : %d"), reportHandling);
       
   847 			CSmsSettings::TSmsReportHandling	specialMsgHandling(settings->SpecialMessageHandling());
       
   848 			INFO_PRINTF2(_L("  SpecialMessageHandling       : %d"), specialMsgHandling);
       
   849 			INFO_PRINTF2(_L("  ReplyQuoted                  : %d"), settings->ReplyQuoted());
       
   850 #ifdef __MESSAGING_API_V2__
       
   851 			const TInt	numSCAddr = settings->ServiceCenterCount();
       
   852 #else
       
   853 			const TInt	numSCAddr = settings->NumSCAddresses();
       
   854 #endif
       
   855 			for( TInt index=0;index<numSCAddr;index++ )
       
   856 				{
       
   857 #ifdef __MESSAGING_API_V2__
       
   858 				CSmsServiceCenter&	scAddr = settings->GetServiceCenter(index);
       
   859 #else
       
   860 				CSmsNumber&			scAddr = settings->SCAddress(index);
       
   861 #endif
       
   862 				ptrTemp.Set(scAddr.Name());
       
   863 				INFO_PRINTF2(_L("  SC Name                      : %S"), &ptrTemp);
       
   864 				ptrTemp.Set(scAddr.Address());
       
   865 				INFO_PRINTF2(_L("  SC Address                   : %S"), &ptrTemp);
       
   866 				}
       
   867 			CSmsSettings::TSmsSettingsCommDbAction	commDbAction(settings->SmsBearerAction());
       
   868 			INFO_PRINTF2(_L("  SmsBearerAction              : %d"), commDbAction);
       
   869 
       
   870 			CSmsSettings::TMobileSmsBearer	smsBearer(settings->SmsBearer());
       
   871 			INFO_PRINTF2(_L("  SmsBearer                    : %d"), smsBearer);
       
   872 			}
       
   873 		CleanupStack::PopAndDestroy(settings);
       
   874 		}
       
   875 
       
   876 	CleanupStack::PopAndDestroy(store);
       
   877 	}
       
   878 
       
   879 void CTestMessBase::IssueTimerRequest()
       
   880 	{
       
   881 	if (iMessageTimer!= NULL)
       
   882 		{
       
   883 		iMessageTimer->IssueRequest();
       
   884 		}
       
   885 	}
       
   886 
       
   887 void CTestMessBase::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny*, TAny*)
       
   888 /**
       
   889  Handler for the Session Event
       
   890  @param aEvent - TMsvSessionEvent object
       
   891  @param aArg1 - TAny object pointer, used to store the argument for the event
       
   892  @leave - System wide error codes
       
   893 */
       
   894 	{
       
   895 	TBool	printSelection=EFalse;
       
   896 
       
   897 	switch (aEvent)
       
   898 		{
       
   899 	case EMsvEntriesCreated:
       
   900 		INFO_PRINTF1(_L("EMsvEntriesCreated"));
       
   901 		printSelection=ETrue;
       
   902 		break;
       
   903 	case EMsvEntriesChanged:
       
   904 		INFO_PRINTF1(_L("EMsvEntriesChanged"));
       
   905 		printSelection=ETrue;
       
   906 		break;
       
   907 	case EMsvEntriesDeleted:
       
   908 		INFO_PRINTF1(_L("EMsvEntriesDeleted"));
       
   909 		break;
       
   910 	case EMsvEntriesMoved:
       
   911 		INFO_PRINTF1(_L("EMsvEntriesMoved"));
       
   912 		printSelection=ETrue;
       
   913 		break;
       
   914 	case EMsvMtmGroupInstalled:
       
   915 		INFO_PRINTF1(_L("EMsvMtmGroupInstalled"));
       
   916 		break;
       
   917 	case EMsvMtmGroupDeInstalled:
       
   918 		INFO_PRINTF1(_L("EMsvMtmGroupDeInstalled"));
       
   919 		break;
       
   920 	case EMsvGeneralError:
       
   921 		INFO_PRINTF1(_L("EMsvGeneralError"));
       
   922 		break;
       
   923 	case EMsvCloseSession:
       
   924 		INFO_PRINTF1(_L("EMsvCloseSession"));
       
   925 		break;
       
   926 	case EMsvServerReady:
       
   927 		INFO_PRINTF1(_L("EMsvServerReady"));
       
   928 		break;
       
   929 	case EMsvServerFailedToStart:
       
   930 		INFO_PRINTF1(_L("EMsvServerFailedToStart"));
       
   931 		break;
       
   932 	case EMsvCorruptedIndexRebuilt:
       
   933 		INFO_PRINTF1(_L("EMsvCorruptedIndexRebuilt"));
       
   934 		break;
       
   935 	case EMsvServerTerminated:
       
   936 		INFO_PRINTF1(_L("EMsvServerTerminated"));
       
   937 		break;
       
   938 	case EMsvMediaChanged:
       
   939 		INFO_PRINTF1(_L("EMsvMediaChanged"));
       
   940 		break;
       
   941 	case EMsvMediaUnavailable:
       
   942 		INFO_PRINTF1(_L("EMsvMediaUnavailable"));
       
   943 		break;
       
   944 	case EMsvMediaAvailable:
       
   945 		INFO_PRINTF1(_L("EMsvMediaAvailable"));
       
   946 		break;
       
   947 	case EMsvMediaIncorrect:
       
   948 		INFO_PRINTF1(_L("EMsvMediaIncorrect"));
       
   949 		break;
       
   950 	case EMsvCorruptedIndexRebuilding:
       
   951 		INFO_PRINTF1(_L("EMsvCorruptedIndexRebuilding"));
       
   952 		break;
       
   953 	default:
       
   954 		INFO_PRINTF2(_L("EMsv Unknown event:%d"), aEvent);
       
   955 		break;
       
   956 	}
       
   957 
       
   958 	if ( printSelection )
       
   959 		{
       
   960 		CMsvEntrySelection*	selection=STATIC_CAST(CMsvEntrySelection*, aArg1);
       
   961 		CMsvEntry*			entry=NULL;
       
   962 		for ( int i=0; i<selection->Count(); )
       
   963 			{
       
   964 			entry=iSession->GetEntryL(selection->At(i++));
       
   965 			CleanupStack::PushL(entry);
       
   966 			PrintEntryL(*entry);
       
   967 			CleanupStack::PopAndDestroy(entry);
       
   968 			}
       
   969 		}
       
   970 	}
       
   971 
       
   972 
       
   973 void CTestMessBase::PrepareSmsHeaderFromIniFileL(CSmsHeader& aSmsHeader)
       
   974 	{
       
   975 	// Starts the Bitmap server
       
   976 	FbsStartup();
       
   977 	// start the server
       
   978 	RFbsSession::Connect();
       
   979 
       
   980 	// Add the Fromating required for EMS if required
       
   981 	TInt	emsElements=0;
       
   982 	if ( !GetIntFromConfig(ConfigSection(), KElements, emsElements) )
       
   983 		{
       
   984 		ERR_PRINTF1(_L("Elements not set"));
       
   985 		SetTestStepResult(EFail);
       
   986 		}
       
   987 
       
   988 // Macro usage for CDMA mtm
       
   989 #if (defined CDMA_API_ENABLED)
       
   990 	TMsvMessageSms&	message=aSmsHeader.SmsMessage();
       
   991 #else
       
   992 	CSmsMessage&	message=aSmsHeader.Message(); 
       
   993 #endif
       
   994 
       
   995 	TBuf<KMaxTestExecuteCommandLength>	tempStore;
       
   996 	for ( TInt element=0; element<emsElements && TestStepResult()==EPass;)
       
   997 		{
       
   998 		++element;
       
   999 		INFO_PRINTF2(_L("==== PROCESSING ELEMENT %d ===="), element);
       
  1000 		//	Start position
       
  1001 		tempStore.Format(KStartPosition, element);
       
  1002 		TInt	startPosition=KDefaultStartPos;
       
  1003 		if ( GetIntFromConfig(ConfigSection(), tempStore, startPosition) )
       
  1004 			{
       
  1005 			INFO_PRINTF2(_L("Start position %d"), startPosition);
       
  1006 			}
       
  1007 
       
  1008 		//	File
       
  1009 		tempStore.Format(KFile, element);
       
  1010 		TPtrC	file;
       
  1011 		TParse	fileName;
       
  1012 		TBool	hasFile=GetStringFromConfig(ConfigSection(), tempStore, file);
       
  1013 		if ( hasFile )
       
  1014 			{
       
  1015 			INFO_PRINTF2(_L("File %S"), &file);
       
  1016 			fileName.Set(file,NULL,NULL);
       
  1017 			}
       
  1018 
       
  1019 		tempStore.Format(KType, element);
       
  1020 		TPtrC	type;
       
  1021 		if ( GetStringFromConfig(ConfigSection(), tempStore, type) )
       
  1022 			{
       
  1023 			if ( type.Compare(KTypeFormat) == 0 )
       
  1024 				{
       
  1025 				//	=== Process text formating Information Element ===
       
  1026 				CEmsFormatIE*	newElement=CEmsFormatIE::NewL();
       
  1027 				CleanupStack::PushL(newElement);
       
  1028 				newElement->SetStartPosition(startPosition);
       
  1029 
       
  1030 				TInt			intTemp;
       
  1031 				TBool			boolTemp;
       
  1032 				TPtrC			alignment;
       
  1033 				TPtrC			fontSize;
       
  1034 
       
  1035 				// Set the Format length and other information
       
  1036 				tempStore.Format(KFormatLength, element);
       
  1037 				if ( GetIntFromConfig(ConfigSection(), tempStore, intTemp) )
       
  1038 					{
       
  1039 					INFO_PRINTF2(_L("Format Length %d"), intTemp);
       
  1040 					newElement->SetFormatLength(intTemp);
       
  1041 					}
       
  1042 				tempStore.Format(KBold, element);
       
  1043 				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
       
  1044 					{
       
  1045 					INFO_PRINTF2(_L("Bold %d"), boolTemp);
       
  1046 					newElement->SetBold(boolTemp);
       
  1047 					}
       
  1048 				tempStore.Format(KItalic, element);
       
  1049 				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
       
  1050 					{
       
  1051 					INFO_PRINTF2(_L("Italic %d"), boolTemp);
       
  1052 				    newElement->SetItalic(boolTemp);
       
  1053 					}
       
  1054 				tempStore.Format(KUnderline, element);
       
  1055 				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
       
  1056 					{
       
  1057 					INFO_PRINTF2(_L("Underline %d"), boolTemp);
       
  1058 					newElement->SetUnderline(boolTemp);
       
  1059 					}
       
  1060 				tempStore.Format(KStrikethrough, element);
       
  1061 				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
       
  1062 					{
       
  1063 					INFO_PRINTF2(_L("Strikethrough %d"), boolTemp);
       
  1064 					newElement->SetStrikethrough(boolTemp);
       
  1065 					}
       
  1066 				tempStore.Format(KAlignment,element);
       
  1067 				if(GetStringFromConfig(ConfigSection(),tempStore,alignment))
       
  1068 					{
       
  1069 					SetAlignmentFormat(*newElement, alignment);
       
  1070 					}
       
  1071 				
       
  1072 				tempStore.Format(KFontSize,element);
       
  1073 				if(GetStringFromConfig(ConfigSection(),tempStore,fontSize))
       
  1074 					{
       
  1075 					//
       
  1076 					SetFontSizeFormat(*newElement, fontSize);
       
  1077 					}
       
  1078 			    message.AddEMSInformationElementL(*newElement); 
       
  1079 				CleanupStack::PopAndDestroy(newElement);
       
  1080 				}
       
  1081 			else if ( type.Compare(KTypeSound) == 0 )
       
  1082 				{
       
  1083 				//	=== Process sound Information Element ===
       
  1084 				if ( hasFile )
       
  1085 					{
       
  1086 					HBufC8*			buffFile=CopyToBuf8LC(fileName.FullName());
       
  1087 					CEmsSoundIE*	newElement=CEmsSoundIE::NewL(buffFile->Des());
       
  1088 					CleanupStack::PushL(newElement);
       
  1089 					newElement->SetStartPosition(startPosition); 
       
  1090 				    message.AddEMSInformationElementL(*newElement); 
       
  1091 					CleanupStack::PopAndDestroy(2, buffFile);
       
  1092 					}
       
  1093 				else
       
  1094 					{
       
  1095 					ERR_PRINTF1(_L("No Sound file name"));
       
  1096 					SetTestStepResult(EFail);
       
  1097 					}
       
  1098 				}
       
  1099 			else if ( type.Compare(KTypePreDefSound) == 0 )
       
  1100 				{
       
  1101 				//	=== Process predefined sound Information Element ===
       
  1102 				TPtrC	preDefSound;
       
  1103 				tempStore.Format(KEmsPreDef, element);
       
  1104 				if ( !GetStringFromConfig(ConfigSection(),tempStore, preDefSound))
       
  1105 					{
       
  1106 					ERR_PRINTF1(_L("Predefined sound not present"));
       
  1107 					SetTestStepResult(EFail);
       
  1108 					}
       
  1109 				else
       
  1110 					{
       
  1111 					INFO_PRINTF2(_L("Predefined sound %S"), &preDefSound);
       
  1112 					CEmsPreDefSoundIE*	newElement=NewPreDefSoundL(preDefSound);
       
  1113 
       
  1114 					if ( newElement != NULL )
       
  1115 						{
       
  1116 						//Assign the predef animation element to newElement
       
  1117 						CleanupStack::PushL(newElement);
       
  1118 						newElement->SetStartPosition(startPosition);
       
  1119 					    message.AddEMSInformationElementL(*newElement); 
       
  1120 						CleanupStack::PopAndDestroy(newElement);
       
  1121 						}
       
  1122 					else
       
  1123 						{
       
  1124 						ERR_PRINTF1(_L("Unable to create predefined sound"));
       
  1125 						SetTestStepResult(EFail);
       
  1126 						}
       
  1127 					}
       
  1128 				}
       
  1129 			else if ( type.Compare(KTypeAnimation) == 0 )
       
  1130 				{
       
  1131 				//	=== Process animation Information Element ===
       
  1132 				if ( hasFile )
       
  1133 					{
       
  1134 					TPtrC	objectSize;
       
  1135 
       
  1136 					tempStore.Format(KObjectSize, element);
       
  1137 					if ( !GetStringFromConfig(ConfigSection(),tempStore,objectSize) )
       
  1138 						{
       
  1139 						ERR_PRINTF1(_L("No size provided"));
       
  1140 						SetTestStepResult(EFail);
       
  1141 						}
       
  1142 					else
       
  1143 						{
       
  1144 						CFbsBitmap*	bmp=NewBitmapL(fileName, objectSize);
       
  1145 						if ( bmp == NULL )
       
  1146 							{
       
  1147 							ERR_PRINTF1(_L("Failed to Load Animation File. Error %d"));
       
  1148 							SetTestStepResult(EFail);
       
  1149 							}
       
  1150 						else
       
  1151 							{
       
  1152 							CleanupStack::PushL(bmp);
       
  1153 							CEmsAnimationIE*	newElement=CEmsAnimationIE::NewL(*bmp);
       
  1154 							CleanupStack::PushL(newElement);
       
  1155 							newElement->SetStartPosition(startPosition);
       
  1156 						    message.AddEMSInformationElementL(*newElement); 
       
  1157 							CleanupStack::PopAndDestroy(2, bmp);
       
  1158 							}
       
  1159 						}
       
  1160 					}
       
  1161 				else
       
  1162 					{
       
  1163 					ERR_PRINTF1(_L("No Animation file name"));
       
  1164 					SetTestStepResult(EFail);
       
  1165 					}
       
  1166 				}
       
  1167 			else if ( type.Compare(KTypePreDefAnimation) == 0 )
       
  1168 				{
       
  1169 				//	=== Process predefined animation Information Element ===
       
  1170 				TPtrC	preDefAnim;
       
  1171 				tempStore.Format(KEmsPreDef, element);
       
  1172 				if ( !GetStringFromConfig(ConfigSection(),tempStore, preDefAnim) )
       
  1173 					{
       
  1174 					ERR_PRINTF1(_L("Predefined animations not present"));
       
  1175 					SetTestStepResult(EFail);
       
  1176 					}
       
  1177 				else
       
  1178 					{
       
  1179 					INFO_PRINTF2(_L("Predefined animation %S"), &preDefAnim);
       
  1180 					CEmsPreDefAnimationIE*	newElement=NewPreDefAnimationL(preDefAnim);
       
  1181 
       
  1182 					if ( newElement != NULL )
       
  1183 						{
       
  1184 						//Assign the predef animation element to newElement
       
  1185 						CleanupStack::PushL(newElement);
       
  1186 						newElement->SetStartPosition(startPosition);
       
  1187 					    message.AddEMSInformationElementL(*newElement); 
       
  1188 						CleanupStack::PopAndDestroy(newElement);
       
  1189 						}
       
  1190 					else
       
  1191 						{
       
  1192 						ERR_PRINTF1(_L("Unable to create predefined animation"));
       
  1193 						SetTestStepResult(EFail);
       
  1194 						}
       
  1195 					}
       
  1196 				}
       
  1197 			else if ( type.Compare(KTypePicture) == 0 )
       
  1198 				{
       
  1199 				//	=== Process picture Information Element ===
       
  1200 				if ( hasFile )
       
  1201 					{
       
  1202 					TPtrC	objectSize;
       
  1203 
       
  1204 					tempStore.Format(KObjectSize, element);
       
  1205 					if ( !GetStringFromConfig(ConfigSection(),tempStore,objectSize) )
       
  1206 						{
       
  1207 						ERR_PRINTF1(_L("No size provided"));
       
  1208 						SetTestStepResult(EFail);
       
  1209 						}
       
  1210 					else
       
  1211 						{
       
  1212 						CFbsBitmap*	bmp=NewBitmapL(fileName, objectSize);
       
  1213 						if ( bmp == NULL )
       
  1214 							{
       
  1215 							ERR_PRINTF1(_L("Failed to Load Animation File. Error %d"));
       
  1216 							SetTestStepResult(EFail);
       
  1217 							}
       
  1218 						else
       
  1219 							{
       
  1220 							CleanupStack::PushL(bmp);
       
  1221 							CEmsPictureIE*	newElement=CEmsPictureIE::NewL(*bmp);
       
  1222 							CleanupStack::PushL(newElement);
       
  1223 							newElement->SetStartPosition(startPosition);
       
  1224 						    message.AddEMSInformationElementL(*newElement); 
       
  1225 							CleanupStack::PopAndDestroy(2, bmp);
       
  1226 							}
       
  1227 						}
       
  1228 					}
       
  1229 				else
       
  1230 					{
       
  1231 					ERR_PRINTF1(_L("No Picture file name"));
       
  1232 					SetTestStepResult(EFail);
       
  1233 					}
       
  1234 				}
       
  1235 			else if ( type.Compare(KTypeUserPrompt) == 0 )
       
  1236 				{
       
  1237 				//	=== Process user prompt Information Element ===
       
  1238 				CEmsUserPrompt*	newElement=CEmsUserPrompt::NewL(2);
       
  1239 				CleanupStack::PushL(newElement);
       
  1240 				newElement->SetStartPosition(startPosition);
       
  1241 			    message.AddEMSInformationElementL(*newElement); 
       
  1242 				CleanupStack::PopAndDestroy(newElement);
       
  1243 				}
       
  1244 			else
       
  1245 				{
       
  1246 				ERR_PRINTF2(_L("Unknown element type %S"), &type);
       
  1247 				SetTestStepResult(EFail);
       
  1248 				}
       
  1249 			}
       
  1250 		else
       
  1251 			{
       
  1252 			ERR_PRINTF1(_L("No type given"));
       
  1253 			SetTestStepResult(EFail);
       
  1254 			}
       
  1255 		}
       
  1256 
       
  1257 	RFbsSession::Disconnect(); 
       
  1258 	}
       
  1259 
       
  1260 /**
       
  1261  This function reads the schedule time from ini file
       
  1262  @return - returns the schedule time read from the ini file
       
  1263 */
       
  1264 TTimeIntervalMinutes CTestMessBase::ReadScheduleTime()
       
  1265 	{
       
  1266 	// Read  the schedule time from ini file. Add this schedule time to current time.
       
  1267 	// This time will be set as the scheduled time for sending the SMS message from task scheduler
       
  1268 	// By default schedule time will be 1 min
       
  1269 	TInt	scheduled=0;
       
  1270 	GetIntFromConfig(ConfigSection(), KScheduled, scheduled);
       
  1271 	INFO_PRINTF2(_L("Scheduled Time in minutes is %d"), scheduled);
       
  1272 	return TTimeIntervalMinutes(scheduled);
       
  1273 	}
       
  1274 
       
  1275 void CTestMessBase::SetAlignmentFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aAlignment)
       
  1276 	{
       
  1277 	//Sets the alignment to the text
       
  1278 	INFO_PRINTF2(_L("Alignment %S"), &aAlignment);
       
  1279 	if( aAlignment.Compare(KLeftAlign)== 0 )
       
  1280 		{
       
  1281 		aEmsFormatIE.SetAlignment(CEmsFormatIE::ELeft);
       
  1282 		}
       
  1283 	else if( aAlignment.Compare(KRightAlign)== 0 )
       
  1284 		{
       
  1285 		aEmsFormatIE.SetAlignment(CEmsFormatIE::ERight);
       
  1286 		}
       
  1287 	else if( aAlignment.Compare(KCenterAlign)== 0 )
       
  1288 		{
       
  1289 		aEmsFormatIE.SetAlignment(CEmsFormatIE::ECenter);
       
  1290 		}
       
  1291 	else if( aAlignment.Compare(KLangDepend)== 0 )
       
  1292 		{
       
  1293 		aEmsFormatIE.SetAlignment(CEmsFormatIE::ELangDepend);
       
  1294 		}
       
  1295 	else
       
  1296 		{
       
  1297 		ERR_PRINTF1(_L("Illegal alignment value"));
       
  1298 		SetTestStepResult(EFail);
       
  1299 		}
       
  1300 	}
       
  1301 
       
  1302 void CTestMessBase::SetFontSizeFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aFontSize)
       
  1303 	{
       
  1304 	//Sets the specified font to the text 
       
  1305 	INFO_PRINTF2(_L("FontSize %S"), &aFontSize);
       
  1306 	if( aFontSize.Compare(KNormal)== 0 )
       
  1307 		{
       
  1308 		aEmsFormatIE.SetFontSize(CEmsFormatIE::ENormal);
       
  1309 		}
       
  1310 	else if( aFontSize.Compare(KLarge)== 0 )
       
  1311 		{
       
  1312 		aEmsFormatIE.SetFontSize(CEmsFormatIE::ELarge);
       
  1313 		}
       
  1314 	else if( aFontSize.Compare(KSmall)== 0 )
       
  1315 		{
       
  1316 		aEmsFormatIE.SetFontSize(CEmsFormatIE::ESmall);
       
  1317 		}
       
  1318 	else if( aFontSize.Compare(KReserved)== 0 )
       
  1319 		{
       
  1320 		aEmsFormatIE.SetFontSize(CEmsFormatIE::EReserved);
       
  1321 		}
       
  1322 	else
       
  1323 		{
       
  1324 		ERR_PRINTF1(_L("Illegal fonst size value"));
       
  1325 		SetTestStepResult(EFail);
       
  1326 		}
       
  1327 	}
       
  1328 
       
  1329 CEmsPreDefAnimationIE* CTestMessBase::NewPreDefAnimationL(const TDesC& aPreDefType) 
       
  1330 //
       
  1331 // Attaches the required predef animation. 
       
  1332 // Arguments - aString - holds the TAnim type to be attached 
       
  1333 // Return Value - Returns a Pointer of CEmsPreDefAnimationIE 
       
  1334 //
       
  1335 	{
       
  1336 	//Initialize emsPreDef to NULL
       
  1337 	CEmsPreDefAnimationIE::TAnimType	animType=CEmsPreDefAnimationIE::EFlirty;
       
  1338 	TBool								validType=ETrue;
       
  1339 
       
  1340 	//Set a value for emsPreDef 
       
  1341 	if ( aPreDefType.Compare(KEmsAnimTypeFlirty) == 0 )
       
  1342 		{
       
  1343 		animType = CEmsPreDefAnimationIE::EFlirty;
       
  1344 		}
       
  1345 	else if ( aPreDefType.Compare(KEmsAnimTypeGlad) == 0 )
       
  1346 		{
       
  1347 		animType = CEmsPreDefAnimationIE::EGlad;
       
  1348 		}
       
  1349 	else if ( aPreDefType.Compare(KEmsAnimTypeSceptic) == 0 )
       
  1350 		{
       
  1351 		animType = CEmsPreDefAnimationIE::ESceptic;
       
  1352 		}
       
  1353 	else if ( aPreDefType.Compare(KEmsAnimTypeSad) == 0 )
       
  1354 		{
       
  1355 		animType = CEmsPreDefAnimationIE::ESad;
       
  1356 		}
       
  1357 	else if ( aPreDefType.Compare(KEmsAnimTypeWow) == 0 )
       
  1358 		{
       
  1359 		animType = CEmsPreDefAnimationIE::EWow;
       
  1360 		}
       
  1361 	else if ( aPreDefType.Compare(KEmsAnimTypeCrying) == 0 )
       
  1362 		{
       
  1363 		animType = CEmsPreDefAnimationIE::ECrying;
       
  1364 		}
       
  1365 	else if ( aPreDefType.Compare(KEmsAnimTypeWinking) == 0 )
       
  1366 		{
       
  1367 		animType = CEmsPreDefAnimationIE::EWinking;
       
  1368 		}
       
  1369 	else if ( aPreDefType.Compare(KEmsAnimTypeLaughing) == 0 )
       
  1370 		{
       
  1371 		animType = CEmsPreDefAnimationIE::ELaughing;
       
  1372 		}
       
  1373 	else if ( aPreDefType.Compare(KEmsAnimTypeIndifferent) == 0 )
       
  1374 		{
       
  1375 		animType = CEmsPreDefAnimationIE::EIndifferent;
       
  1376 		}
       
  1377 	else if ( aPreDefType.Compare(KEmsAnimTypeKissing) == 0 )
       
  1378 		{
       
  1379 		animType = CEmsPreDefAnimationIE::EKissing;
       
  1380 		}
       
  1381 	else if ( aPreDefType.Compare(KEmsAnimTypeConfused) == 0 )
       
  1382 		{
       
  1383 		animType = CEmsPreDefAnimationIE::EConfused;
       
  1384 		}
       
  1385 	else if ( aPreDefType.Compare(KEmsAnimTypeTongueOut) == 0 )
       
  1386 		{
       
  1387 		animType = CEmsPreDefAnimationIE::ETongueOut;
       
  1388 		}
       
  1389 	else if ( aPreDefType.Compare(KEmsAnimTypeAngry) == 0 )
       
  1390 		{
       
  1391 		animType = CEmsPreDefAnimationIE::EAngry;
       
  1392 		}
       
  1393 	else if ( aPreDefType.Compare(KEmsAnimTypeGlasses) == 0 )
       
  1394 		{
       
  1395 		animType = CEmsPreDefAnimationIE::EGlasses;
       
  1396 		}
       
  1397 	else if ( aPreDefType.Compare(KEmsAnimTypeDevil) == 0 )
       
  1398 		{
       
  1399 		animType = CEmsPreDefAnimationIE::EDevil;
       
  1400 		}
       
  1401 	else
       
  1402 		{
       
  1403 		validType=EFalse;
       
  1404 		}
       
  1405 
       
  1406 	CEmsPreDefAnimationIE*	emsPreDef=NULL;
       
  1407 	if ( validType )
       
  1408 		{
       
  1409 		emsPreDef=CEmsPreDefAnimationIE::NewL(animType);
       
  1410 		}
       
  1411 
       
  1412 	return emsPreDef;
       
  1413 	}
       
  1414 
       
  1415 CEmsPreDefSoundIE* CTestMessBase::NewPreDefSoundL(const TDesC& aPreDefType) 
       
  1416 //
       
  1417 // Attaches the required predef animation. 
       
  1418 // Arguments - aString - holds the TAnim type to be attached 
       
  1419 // Return Value - Returns a Pointer of CEmsPreDefAnimationIE 
       
  1420 //
       
  1421 	{
       
  1422 	//Initialize emsPreDef to NULL
       
  1423 	CEmsPreDefSoundIE::TPredefinedSound	soundType=CEmsPreDefSoundIE::EChimesHigh;
       
  1424 	TBool								validType=ETrue;
       
  1425 
       
  1426 	//Set a value for emsPreDef 
       
  1427 	if ( aPreDefType.Compare(KEmsSoundTypeChimesHigh) == 0 )
       
  1428 		{
       
  1429 		soundType = CEmsPreDefSoundIE::EChimesHigh;
       
  1430 		}
       
  1431 	else if ( aPreDefType.Compare(KEmsSoundTypeChimesLow) == 0 )
       
  1432 		{
       
  1433 		soundType = CEmsPreDefSoundIE::EChimesLow;
       
  1434 		}
       
  1435 	else if ( aPreDefType.Compare(KEmsSoundTypeDing) == 0 )
       
  1436 		{
       
  1437 		soundType = CEmsPreDefSoundIE::EDing;
       
  1438 		}
       
  1439 	else if ( aPreDefType.Compare(KEmsSoundTypeTaDa) == 0 )
       
  1440 		{
       
  1441 		soundType = CEmsPreDefSoundIE::ETaDa;
       
  1442 		}
       
  1443 	else if ( aPreDefType.Compare(KEmsSoundTypeNotify) == 0 )
       
  1444 		{
       
  1445 		soundType = CEmsPreDefSoundIE::ENotify;
       
  1446 		}
       
  1447 	else if ( aPreDefType.Compare(KEmsSoundTypeDrum) == 0 )
       
  1448 		{
       
  1449 		soundType = CEmsPreDefSoundIE::EDrum;
       
  1450 		}
       
  1451 	else if ( aPreDefType.Compare(KEmsSoundTypeClaps) == 0 )
       
  1452 		{
       
  1453 		soundType = CEmsPreDefSoundIE::EClaps;
       
  1454 		}
       
  1455 	else if ( aPreDefType.Compare(KEmsSoundTypeFanFar) == 0 )
       
  1456 		{
       
  1457 		soundType = CEmsPreDefSoundIE::EFanFar;
       
  1458 		}
       
  1459 	else if ( aPreDefType.Compare(KEmsSoundTypeChordHigh) == 0 )
       
  1460 		{
       
  1461 		soundType = CEmsPreDefSoundIE::EChordHigh;
       
  1462 		}
       
  1463 	else if ( aPreDefType.Compare(KEmsSoundTypeChordLow) == 0 )
       
  1464 		{
       
  1465 		soundType = CEmsPreDefSoundIE::EChordLow;
       
  1466 		}
       
  1467 	else
       
  1468 		{
       
  1469 		validType=EFalse;
       
  1470 		}
       
  1471 
       
  1472 	CEmsPreDefSoundIE*	emsPreDef=NULL;
       
  1473 	if ( validType )
       
  1474 		{
       
  1475 		emsPreDef=CEmsPreDefSoundIE::NewL(soundType);
       
  1476 		}
       
  1477 
       
  1478 	return emsPreDef;
       
  1479 	}
       
  1480 
       
  1481 CFbsBitmap* CTestMessBase::NewBitmapL(const TParse& aFileName, const TDesC& aObjectSize)
       
  1482 	{
       
  1483 	TInt	bitmapType=KSmallObject;
       
  1484 	TBool	validType=ETrue;
       
  1485 	if( aObjectSize.Compare(KSmall) == 0 )
       
  1486 		{
       
  1487 		bitmapType=KSmallObject;
       
  1488 		}
       
  1489 	else if ( aObjectSize.Compare(KLarge) == 0 )
       
  1490 		{
       
  1491 		bitmapType=KLargeObject;
       
  1492 		}
       
  1493 	else if ( aObjectSize.Compare(KVariable) == 0 )
       
  1494 		{
       
  1495 		bitmapType=KVariableObject;
       
  1496 		}
       
  1497 	else
       
  1498 		{
       
  1499 		ERR_PRINTF2(_L("Invalid bitmap type %S"), &aObjectSize);
       
  1500 		validType=EFalse;
       
  1501 		}
       
  1502 
       
  1503 	CFbsBitmap*	bmp = NULL;
       
  1504 	if ( validType )
       
  1505 		{
       
  1506 		bmp = new (ELeave) CFbsBitmap();
       
  1507 
       
  1508 		TInt	error = bmp->Load(aFileName.FullName(), bitmapType, EFalse);
       
  1509 		INFO_PRINTF2(_L("Bimap load %d"), error);
       
  1510 		if ( error != KErrNone)
       
  1511 			{
       
  1512 			delete bmp;
       
  1513 			bmp=NULL;
       
  1514 			}
       
  1515 		}
       
  1516 
       
  1517 	return bmp;
       
  1518 	}
       
  1519